-
-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Report a bug
π Search Terms
default string.matching scope
π§© Context
- ArkType version: 2.1.22
- TypeScript version (5.1+): 5.6.2
- Other context you think may be relevant (JS flavor, OS, etc.):
π§βπ» Repro
import { scope, type } from "arktype"
const Scope = scope({
semverWithV: type.string
.matching(/^v\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/)
.describe('valid version format (expected vX.Y.Z)'),
payload: {
version: "semverWithV = 'v0.0.0'"
}
});
Weirdly, it works when the exact same type is defined outside the scope, and then added into the scope:
import { scope, type } from "arktype"
const semverWithV = type.string
.matching(/^v\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/)
.describe('valid version format (expected vX.Y.Z)');
const Scope = scope({
semverWithV,
payload: {
version: "semverWithV = 'v0.0.0'"
}
});
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
To do