-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
NumericStringSchema.ts
36 lines (36 loc) · 1.8 KB
/
NumericStringSchema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as converter from "../appliers/converter.ts";
import * as ifEmptyString from "../appliers/ifEmptyString.ts";
import * as ifNull from "../appliers/ifNull.ts";
import * as ifUndefined from "../appliers/ifUndefined.ts";
import * as only from "../appliers/only.ts";
import * as checksum from "../appliers/numericString/checksum.ts";
import * as fullWidthToHalf from "../appliers/numericString/fullWidthToHalf.ts";
import * as joinsArray from "../appliers/numericString/joinsArray.ts";
import * as pattern from "../appliers/numericString/pattern.ts";
import * as separatedBy from "../appliers/numericString/separatedBy.ts";
import * as maxLength from "../appliers/string/maxLength.ts";
import * as minLength from "../appliers/string/minLength.ts";
import * as type from "../appliers/string/type.ts";
import { BaseSchema } from "../schemaClasses/BaseSchema.ts";
export const NUMERIC_STRING = {
CHECKSUM_ALGORITHM: checksum.CHECKSUM_ALGORITHM
};
export type OptionsForNumericString = converter.Options<string> | ifEmptyString.Options<string> | ifNull.Options<string> | ifUndefined.Options<string> | only.Options<string> | checksum.Options | fullWidthToHalf.Options | joinsArray.Options | pattern.Options | separatedBy.Options | type.Options | minLength.Options | maxLength.Options;
export class NumericStringSchema<Tx = never> extends BaseSchema<string | Tx> {
constructor(options: OptionsForNumericString) {
super(options, [
ifUndefined.applyTo,
ifNull.applyTo,
ifEmptyString.applyTo,
fullWidthToHalf.applyTo,
joinsArray.applyTo,
type.applyTo,
separatedBy.applyTo,
pattern.applyTo,
minLength.applyTo,
maxLength.applyTo,
checksum.applyTo,
converter.applyTo,
]);
}
}