fix(deps): update dependency arktype to v2.1.17 #1794
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.0.0-dev.12-cjs
->2.1.17
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
arktypeio/arktype (arktype)
v2.1.17
Compare Source
Unsatisfiable types for index signature intersections will now result in a
ParseError
thanks to the work of @TizzySaurus on the upcoming@ark/json-schema
package 🎉v2.1.16
Compare Source
Fixed an issue causing non-serializable error config to lead to incorrect error messages in some JIT-mode cases:
Added a workaround for environments where global prototypes like
FormData
have degenerate resolutions like{}
(currently the case in@types/bun
, see https://github.com/oven-sh/bun/issues/18689)v2.1.15
Compare Source
.configure({}, selector)
fixesWith the much more powerful
.configure
+ selector API now available, the internal.withMeta
method was removed as it can be trivially achieved via a self-selector:v2.1.14
Compare Source
improve .expression for regex constraints
v2.1.13
Compare Source
Add standalone functions for n-ary operators
v2.1.12
Compare Source
exactOptionalPropertyTypes
By default, ArkType validates optional keys as if TypeScript's
exactOptionalPropertyTypes
is set totrue
.This approach allows the most granular control over optionality, as
| undefined
can be added to properties that should accept it.However, if you have not enabled TypeScript's
exactOptionalPropertyTypes
setting, you may globally configure ArkType'sexactOptionalPropertyTypes
tofalse
to match TypeScript's behavior. If you do this, we'd recommend making a plan to enableexactOptionalPropertyTypes
in the future.WARNING: exactOptionalPropertyTypes does not yet affect default values!
Support for this is tracked as part of this broader configurable defaultability issue.
v2.1.11
Compare Source
select
method directly onType
(previously was only available on.internal
)v2.1.10
Compare Source
Added a new
select
method for introspecting references of a node:NOTE:
@ark/schema
's API is not semver stable, so this API may change slightly over time (though we will try to ensure it doesn't).These selectors can also be used to select references for configuration:
ArkErrors
are now JSON stringifiable and have two new props:flatByPath
andflatProblemsByPath
.v2.1.9
Compare Source
The
|>
operator pipes output to another Type parsed from a definition.It is now string-embeddable:
v2.1.8
Compare Source
string.hex
(thanks @HoaX7 - #1351)v2.1.7
Compare Source
Address a rare crash on an invalid ctx reference in some jitless cases
Closes #1346
v2.1.6
Compare Source
Improve some type-level parse errors on expressions with invalid finalizers
v2.1.5
Compare Source
Fix JSDoc and go-to definition for unparsed keys
Addresses #1294
v2.1.4
Compare Source
Static hermes compatibility (#1027)
v2.1.3
Compare Source
Fix a jitless-mode bug causing default +
onUndeclaredKey
transformations to not apply (#1335)v2.1.2
Compare Source
Allow non-zero-prefixed decimals in string.numeric (#1333)
v2.1.1
Compare Source
Fixed an issue causing non-serializable error config to lead to incorrect error messages in some JIT-mode cases:
Added a workaround for environments where global prototypes like
FormData
have degenerate resolutions like{}
(currently the case in@types/bun
, see https://github.com/oven-sh/bun/issues/18689)v2.1.0
Compare Source
match
The
match
function provides a powerful way to handle different types of input and return corresponding outputs based on the input type, like a type-safeswitch
statement.Case Record API
The simplest way to define a matcher is with ArkType definition strings as keys with corresponding handlers as values:
In this example,
sizeOf
is a matcher that takes a string, array, number, or bigint as input. It returns the length of strings and arrays, and the value of numbers and bigints.default
accepts one of 4 values:"assert"
: acceptunknown
, throw if none of the cases match"never"
: accept an input based on inferred cases, throw if none match"reject"
: acceptunknown
, returnArkErrors
if none of the cases match(data: In) => unknown
: handle data not matching other cases directlyCases will be checked in the order they are specified, either as object literal keys or via chained methods.
Fluent API
The
match
function also provides a fluent API. This can be convenient for non-string-embeddable definitions:Narrowing input with
in
, property matching withat
Special thanks to @thetayloredman who did a mind-blowingly good job helping us iterate toward the current type-level pattern-matching implementation🙇
Builtin keywords can now be globally configured
This can be very helpful for customizing error messages without needing to create your own aliases or wrappers.
The options you can provide here are identical to those used to configure a Type directly, and can also be extended at a type-level to include custom metadata.
Tuple and args expressions for
.to
If a morph returns an
ArkErrors
instance, validation will fail with that result instead of it being treated as a value. This is especially useful for using other Types as morphs to validate output or chain transformations.To make this easier, there's a special
to
operator that can pipe to a parsed definition without having to wrap it intype
to make it a function.This was added before 2.0, but now it comes with a corresponding operator (
|>
) so that it can be expressed via a tuple or args like most other expressions:Error configurations now accept a string directly
Keep in mind, as mentioned in the docs, error configs like
message
can clobber more granular config options likeexpected
andactual
and cannot be included in composite errors e.g. for a union.Though generally, returning a string based on context is the best option, in situations where you always want the same static message, it's now easier to get that!
Type.toString() now wraps its syntactic representation in
Type<..>
Previously,
Type.toString()
just returnedType.expression
. However, in contexts where the source of a message isn't always aType
, it could be confusing:Hopefully if you interpolate a Type, you'll be less confused by the result from now on!
Improve how Type instances are inferred when wrapped in external generics
Previously, we used
NoInfer
in some Type method returns. After migrating those to inlined conditionals, we get the same benefit and external inference for cases like this is more reliable:Fix an issue causing some discriminated unions to incorrectly reject default cases
v2.0.4
Compare Source
Fix an issue causing global configs to be overwritten when the primary
"arktype"
entry point is imported:config.ts
main.ts
Previous versions of the docs mistakenly suggested this was possible in a single file. This is not the case in ESM due to hoisting. See the updated global configuration docs here.
Better
ParseError
when attempting to constraint a morphPreviously, attempting to directly constrain a transformed type was not a type error but gave a confusing error at runtime:
We've added a type error and improved the runtime error:
Fix an issue causing certain complex morph types to not infer output correctly, e.g.:
v2.0.3
Compare Source
Fix an issue causing some unions with
onUndeclaredKey: "reject"
to reject valid data (#1266)Fix an issue where Types containing arrays were incorrectly treated as including morphs, leading to some unnecessary validation overhead (#1268)
Fix an issue causing objects containing functions like
() => never
that are subtypes ofInferredMorph
to be incorrectly treated as morphs (#1264)Fail early with a
ParseError
ifinstanceOf
operand is not actually a function at runtime (#1262)v2.0.2
Compare Source
numberAllowsNan
,dateAllowsInvalid
andonUndeclaredKey
) could be specified at a scope-level, leading to unintuitive cache results (#1255)v2.0.1
Compare Source
@ark/util
version specifierv2.0.0
Compare Source
v2.0.0-rc.33
Compare Source
v2.0.0-rc.32
Compare Source
v2.0.0-rc.31
Compare Source
v2.0.0-rc.30
Compare Source
v2.0.0-rc.29
Compare Source
v2.0.0-rc.28
Compare Source
v2.0.0-rc.27
Compare Source
v2.0.0-rc.26
Compare Source
v2.0.0-rc.25
Compare Source
v2.0.0-rc.24
Compare Source
v2.0.0-rc.23
Compare Source
v2.0.0-rc.22
Compare Source
v2.0.0-rc.21
Compare Source
v2.0.0-rc.18
Compare Source
v2.0.0-rc.17
Compare Source
v2.0.0-rc.16
Compare Source
v2.0.0-rc.15
Compare Source
v2.0.0-rc.14
Compare Source
v2.0.0-rc.13
Compare Source
v2.0.0-rc.12
Compare Source
v2.0.0-rc.11
Compare Source
v2.0.0-rc.10
Compare Source
v2.0.0-rc.9
Compare Source
v2.0.0-rc.8
Compare Source
v2.0.0-rc.7
Compare Source
v2.0.0-rc.6
Compare Source
v2.0.0-rc.5
Compare Source
v2.0.0-rc.4
Compare Source
v2.0.0-rc.3
Compare Source
v2.0.0-rc.2
Compare Source
v2.0.0-rc.1
Compare Source
v2.0.0-rc.0
Compare Source
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.