Arktype Versions Save

TypeScript's 1:1 validator, optimized from editor to runtime

[email protected]

4 months ago

Patch Changes

  • fix: don't freeze definitions for compatibility with sass

[email protected]

6 months ago

Patch Changes

  • Allow instanceof abstract classes, avoid treating some function props as morphs

[email protected]

6 months ago

Patch Changes

[email protected]

6 months ago

Patch Changes

  • Fix an issue where optional paths could be used as discriminants

[email protected]

6 months ago

Patch Changes

  • Fix an issue causing some morphs to not be properly extracted when .infer(red)

[email protected]

7 months ago

Patch Changes

  • Add inferDefinition, validateDefinition and PrecompiledDefaults to primary entrypoint

[email protected]

7 months ago

Patch Changes

  • Preserve named classes not including morphs

[email protected]

7 months ago

Patch Changes

  • Fix a bug inferring certain recursive unions.

    Previously, a scoped type like this failed to infer correctly. Thanks to @Vanilagy for the repro!

    scope({
        a: {
            name: '"a"'
        },
        b: {
            name: '"b"',
            children: "(a|b)[]"
        }
    })
    

[email protected]

8 months ago

Patch Changes

  • Remove preinstall script from package.json

[email protected]

8 months ago

Patch Changes

  • Fixes a bug causing intersections including cross scope references to be inferred as unknown

    Unfortunately, some cross-scope operations will still result in an error at runtime. You will know at build time if this occurs by a message in an intersection like "Unable to resolve alias 'myExternalAlias'". The workaround is to use the in-scope type parser as follows until next release for these scenarios:

    Unions:

    const $ = scope({
        a: "'abc'",
        b: { "c?": "a" }
    })
    const types = $.compile()
    // This fails if you don't use scoped type for now, fixing in next release
    const t = $.type([types.b, "|", { extraProp: "string" }])
    

    Intersections:

    const $ = scope({
        a: "'abc'",
        b: { "c?": "a" }
    })
    const types = $.compile()
    // This fails if you don't use scoped type for now, fixing in next release
    const t = $.type([types.b, "&", { extraProp: "string" }])