Compare commits
4 Commits
9cae8b31e7
...
740c597f3c
Author | SHA1 | Date | |
---|---|---|---|
740c597f3c | |||
fdfaac9aa0 | |||
476a17be17 | |||
50371dd1bd |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@dzeio/schema",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@dzeio/schema",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"dependencies": {
|
||||
"@dzeio/object-util": "^1.8.3",
|
||||
"@standard-schema/spec": "^1.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@dzeio/schema",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"dependencies": {
|
||||
"@dzeio/object-util": "^1.8.3"
|
||||
},
|
||||
|
@ -15,6 +15,14 @@ export default class SchemaArray<Type extends SchemaItem> extends SchemaItem<Arr
|
||||
return this
|
||||
}
|
||||
|
||||
/**
|
||||
* split a string into an array
|
||||
* @param [separator] default:`,` the separator to use
|
||||
*/
|
||||
public split(separator = ',') {
|
||||
this.addPreProcess((it) => typeof it === 'string' ? it.split(separator) : it)
|
||||
}
|
||||
|
||||
public parse(input: unknown, options?: { fast?: boolean }): ValidationResult<Array<SchemaInfer<Type>>> {
|
||||
|
||||
// check errors from itself
|
||||
|
@ -25,6 +25,8 @@ export default class SchemaDate extends SchemaItem<Date> {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
public override isOfType(input: unknown): input is Date {
|
||||
|
Loading…
x
Reference in New Issue
Block a user