𝘵𝘳𝘢𝘮𝘱𝘰𝘹
𝘵𝘳𝘢𝘮𝘱𝘰𝘹
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
also, is there a way that I can use typesafe inputs while validating?
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
but is there a way in the same way that you can use "&" and "|"?
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
hey, I was thinking if there's a way to use .merge without using the fluent way, I know that type.module you can use the Merge generic
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
got it, thank you
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
wouldn't it turn into just "'foo' | 'bar'"? Because I'm actually aiming for it to be an array with one of the options
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
I'm asking this because I already used type.enumerated(Object.values(options)), that results in "('foo' | 'bar')[]", but for some reason, it says that the input must include all the options available, and not one of
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
another unrelated question, but how do I create an type from object in arktype? Where I have like:
const options = {
foo: "foo",
bar: "bar",
} as const;

const optionsSchema = type(options) // : "'foo' | 'bar'"
const options = {
foo: "foo",
bar: "bar",
} as const;

const optionsSchema = type(options) // : "'foo' | 'bar'"
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
Found the issue: I have a file called arktype.ts, where I use arktype/config to delete undeclared keys with
import { configure } from "arktype/config";
configure({ onUndeclaredKey: "delete" });
import { configure } from "arktype/config";
configure({ onUndeclaredKey: "delete" });
after commenting those lines, it started working
17 replies
Aarktype
Created by 𝘵𝘳𝘢𝘮𝘱𝘰𝘹 on 4/25/2025 in #questions
Unsatisfiable type
I just deleted the node_modules, and pnpm-lock, but the error persists. I tried creating a new react-router project, and the error is gone. Really weird
17 replies