Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ark/attest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/attest",
"version": "0.56.4",
"version": "0.56.5",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/fast-check/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/fast-check",
"version": "0.0.15",
"version": "0.0.16",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/fs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/fs",
"version": "0.56.3",
"version": "0.56.4",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/json-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/json-schema",
"version": "0.0.8",
"version": "0.0.9",
"license": "MIT",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion ark/regex/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arkregex",
"description": "A drop-in replacement for new RegExp() with types",
"version": "0.0.9",
"version": "0.0.10",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/schema",
"version": "0.56.3",
"version": "0.56.4",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
41 changes: 41 additions & 0 deletions ark/type/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# arktype

## 2.2.5

### Preserve escaped backslashes in regex literals

Within a regex literal, `\\` is now kept verbatim as an escaped backslash rather than collapsed to a single `\`, which silently changed the meaning of the pattern:

```ts
// previously parsed as /\d/, matching a digit
// now matches a literal backslash followed by "d"
const T = type("/\\\\d/")
```

String literals are unaffected. If a definition relied on the old behavior, write the intended escape directly (e.g. `"/\\d/"` for a digit). Thanks to @spokodev.

### Fix recursive discriminated unions referenced from a `Record`

A cyclic alias referenced through `Record<string, ...>` could cause valid values to be rejected, e.g. an array branch failing with `must be an array (was object)`. Bootstrapping alias references no longer overwrites references that were already resolved. This was a regression introduced in 2.2.2. Thanks to @xianjianlf2.

### Prevent a crash validating unions of object arrays

Inside a union branch, array validation now stops at the first failing element instead of continuing to traverse elements whose basis has already failed, which could throw rather than return an error. Thanks to @xianjianlf2.

### Merge index-derived props with a declared key of the same name

Intersecting a structure with an index signature and one that rejects undeclared keys could produce a node with a duplicate key:

```ts
// previously { a: number, a: number, b: number, + (undeclared): reject }
type({ a: "number", "[string]": "number" }).and({
a: "number",
b: "number",
"+": "reject"
})
```

Props derived from the index signature are now intersected with any declared prop of the same key, and the result is the same in either operand order.

### Preserve parameter labels when a `type.fn` implementation annotates an optional parameter

Annotating an optional parameter, as in `type.fn("number?")((n?: number) => n)`, previously dropped every parameter label from the inferred signature. It now infers `(n?: number | undefined) => number | undefined`. Thanks to @aswinsvijay.

## 2.2.4

### Default a property to an empty array or object in string syntax
Expand Down
2 changes: 1 addition & 1 deletion ark/type/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arktype",
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
"version": "2.2.4",
"version": "2.2.5",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion ark/util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ark/util",
"version": "0.56.3",
"version": "0.56.4",
"license": "MIT",
"author": {
"name": "David Blass",
Expand Down
2 changes: 1 addition & 1 deletion ark/util/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FileConstructor, objectKindOf } from "./objectKinds.ts"
// recent node versions (https://nodejs.org/api/esm.html#json-modules).

// For now, we assert this matches the package.json version via a unit test.
export const arkUtilVersion = "0.56.3"
export const arkUtilVersion = "0.56.4"

export const initialRegistryContents = {
version: arkUtilVersion,
Expand Down
Loading