valgen 5.8.2 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +3 -3
- package/cjs/core/utilities.js +4 -4
- package/cjs/tsconfig-build-cjs.tsbuildinfo +1 -0
- package/esm/core/utilities.js +1 -1
- package/esm/rules/format-rules/is-alpha.js +1 -1
- package/esm/rules/format-rules/is-ascii.js +1 -1
- package/esm/rules/format-rules/is-base64.js +1 -1
- package/esm/rules/format-rules/is-btc-address.js +1 -1
- package/esm/rules/format-rules/is-credit-card.js +1 -1
- package/esm/rules/format-rules/is-decimal.js +1 -1
- package/esm/rules/format-rules/is-ean.js +1 -1
- package/esm/rules/format-rules/is-email.js +1 -1
- package/esm/rules/format-rules/is-eth-address.js +1 -1
- package/esm/rules/format-rules/is-fqdn.js +1 -1
- package/esm/rules/format-rules/is-hash.js +1 -1
- package/esm/rules/format-rules/is-hex-color.js +1 -1
- package/esm/rules/format-rules/is-hex.js +1 -1
- package/esm/rules/format-rules/is-iban.js +1 -1
- package/esm/rules/format-rules/is-ip.js +1 -1
- package/esm/rules/format-rules/is-issn.js +1 -1
- package/esm/rules/format-rules/is-jwt.js +1 -1
- package/esm/rules/format-rules/is-lowercase.js +1 -1
- package/esm/rules/format-rules/is-mac-address.js +1 -1
- package/esm/rules/format-rules/is-mobile-phone.js +1 -1
- package/esm/rules/format-rules/is-passport-number.js +1 -1
- package/esm/rules/format-rules/is-port.js +1 -1
- package/esm/rules/format-rules/is-url.js +1 -1
- package/esm/rules/format-rules/is-uuid.js +1 -1
- package/esm/rules/format-rules/is-vat-number.js +1 -1
- package/esm/rules/logical-rules/is-defined.js +1 -1
- package/esm/rules/logical-rules/is-empty.js +1 -1
- package/esm/rules/type-rules/is-bigint.js +1 -1
- package/esm/rules/type-rules/is-date.js +1 -1
- package/esm/rules/type-rules/is-null.js +1 -1
- package/esm/rules/type-rules/is-number.js +1 -1
- package/esm/rules/utility-rules/exists.js +1 -1
- package/esm/rules/utility-rules/union.js +1 -1
- package/esm/tsconfig-build-esm.tsbuildinfo +1 -0
- package/package.json +3 -2
- package/types/core/utilities.d.ts +2 -1
- package/types/core/validation-error.d.ts +1 -1
- package/types/core/validator.d.ts +2 -2
- package/types/index.d.cts +63 -0
- package/types/rules/format-rules/is-alpha.d.ts +1 -1
- package/types/rules/format-rules/is-ascii.d.ts +1 -1
- package/types/rules/format-rules/is-base64.d.ts +1 -1
- package/types/rules/format-rules/is-btc-address.d.ts +1 -1
- package/types/rules/format-rules/is-credit-card.d.ts +1 -1
- package/types/rules/format-rules/is-decimal.d.ts +1 -1
- package/types/rules/format-rules/is-ean.d.ts +1 -1
- package/types/rules/format-rules/is-email.d.ts +1 -1
- package/types/rules/format-rules/is-eth-address.d.ts +1 -1
- package/types/rules/format-rules/is-fqdn.d.ts +1 -1
- package/types/rules/format-rules/is-hash.d.ts +1 -1
- package/types/rules/format-rules/is-hex-color.d.ts +1 -1
- package/types/rules/format-rules/is-hex.d.ts +1 -1
- package/types/rules/format-rules/is-iban.d.ts +1 -1
- package/types/rules/format-rules/is-ip.d.ts +1 -1
- package/types/rules/format-rules/is-issn.d.ts +1 -1
- package/types/rules/format-rules/is-jwt.d.ts +1 -1
- package/types/rules/format-rules/is-lowercase.d.ts +1 -1
- package/types/rules/format-rules/is-mac-address.d.ts +1 -1
- package/types/rules/format-rules/is-mobile-phone.d.ts +1 -1
- package/types/rules/format-rules/is-object-id.d.ts +1 -1
- package/types/rules/format-rules/is-passport-number.d.ts +1 -1
- package/types/rules/format-rules/is-port.d.ts +1 -1
- package/types/rules/format-rules/is-url.d.ts +1 -1
- package/types/rules/format-rules/is-uuid.d.ts +1 -1
- package/types/rules/format-rules/is-vat-number.d.ts +1 -1
- package/types/rules/format-rules/matches.d.ts +1 -1
- package/types/rules/logical-rules/is-defined.d.ts +1 -1
- package/types/rules/logical-rules/is-empty.d.ts +1 -1
- package/types/rules/logical-rules/range.d.ts +1 -1
- package/types/rules/type-rules/is-array.d.ts +1 -1
- package/types/rules/type-rules/is-bigint.d.ts +1 -1
- package/types/rules/type-rules/is-boolean.d.ts +1 -1
- package/types/rules/type-rules/is-date.d.ts +1 -1
- package/types/rules/type-rules/is-enum.d.ts +1 -1
- package/types/rules/type-rules/is-integer.d.ts +1 -1
- package/types/rules/type-rules/is-null.d.ts +1 -1
- package/types/rules/type-rules/is-number.d.ts +1 -1
- package/types/rules/type-rules/is-object.d.ts +1 -1
- package/types/rules/type-rules/is-record.d.ts +1 -1
- package/types/rules/type-rules/is-string.d.ts +1 -1
- package/types/rules/type-rules/is-tuple.d.ts +1 -1
- package/types/rules/type-rules/is-undefined.d.ts +1 -1
- package/types/rules/utility-rules/exists.d.ts +1 -1
- package/types/rules/utility-rules/optional.d.ts +2 -2
- package/types/rules/utility-rules/pipe.d.ts +1 -1
- package/types/rules/utility-rules/required.d.ts +2 -2
- package/types/rules/utility-rules/union.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# v5.10.0
|
|
2
|
+
[2024-09-14]
|
|
3
|
+
|
|
4
|
+
### Changes
|
|
5
|
+
|
|
6
|
+
* chore: Moved from circleci to github actions ([`179e630`](https://github.com/panates/valgen/commit/179e630a1b1327acf995decb88ed86b015a48c6a))
|
|
7
|
+
* fixed: Circular imports ([`f2a83b9`](https://github.com/panates/valgen/commit/f2a83b9f466f1bc5acaabef3ac78f6c567ed7b54))
|
|
8
|
+
|
|
9
|
+
# v5.9.0
|
|
10
|
+
[2024-08-20]
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
* Fixed compatibility for "Node16" and "NodeNext" moduleResolution options ([`9985ad6`](https://github.com/panates/valgen/commit/9985ad68ded7ddd62a630fbb54fd4f25a405cb62))
|
|
15
|
+
|
|
1
16
|
# v5.8.2
|
|
2
17
|
[2024-08-12]
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
-
[![
|
|
5
|
+
[![CI Tests][ci-test-image]][ci-test-url]
|
|
6
6
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
7
|
|
|
8
8
|
Fast runtime type validator, converter and io (encoding/decoding) library.
|
|
@@ -20,8 +20,8 @@ Fast runtime type validator, converter and io (encoding/decoding) library.
|
|
|
20
20
|
|
|
21
21
|
[npm-image]: https://img.shields.io/npm/v/valgen.svg
|
|
22
22
|
[npm-url]: https://npmjs.org/package/valgen
|
|
23
|
-
[
|
|
24
|
-
[
|
|
23
|
+
[ci-test-image]: https://github.com/panates/valgen/actions/workflows/test.yml/badge.svg
|
|
24
|
+
[ci-test-url]: https://github.com/panates/valgen/actions/workflows/test.yml
|
|
25
25
|
[coveralls-image]: https://img.shields.io/coveralls/panates/valgen/master.svg
|
|
26
26
|
[coveralls-url]: https://coveralls.io/r/panates/valgen
|
|
27
27
|
[downloads-image]: https://img.shields.io/npm/dm/valgen.svg
|
package/cjs/core/utilities.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.forwardRef = forwardRef;
|
|
4
4
|
exports.iif = iif;
|
|
5
|
-
const
|
|
5
|
+
const validator_js_1 = require("./validator.js");
|
|
6
6
|
/**
|
|
7
7
|
* Forwards codec process to a sub codec. Useful for circular checks
|
|
8
8
|
* @validator forwardRef
|
|
9
9
|
*/
|
|
10
10
|
function forwardRef(fn) {
|
|
11
|
-
return (0,
|
|
11
|
+
return (0, validator_js_1.validator)('forwardRef', (input, context) => {
|
|
12
12
|
const nested = fn(context);
|
|
13
13
|
return nested(input, context);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function iif(check, _then, _else) {
|
|
17
|
-
return (0,
|
|
17
|
+
return (0, validator_js_1.validator)('iif', (input, context) => {
|
|
18
18
|
let c = _else;
|
|
19
19
|
try {
|
|
20
20
|
if (check(input) !== undefined)
|
|
@@ -23,7 +23,7 @@ function iif(check, _then, _else) {
|
|
|
23
23
|
catch {
|
|
24
24
|
// ignored
|
|
25
25
|
}
|
|
26
|
-
if ((0,
|
|
26
|
+
if ((0, validator_js_1.isValidator)(c))
|
|
27
27
|
return c(input, context);
|
|
28
28
|
return c;
|
|
29
29
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.6.2"}
|
package/esm/core/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatISO, parseISO } from 'date-fns';
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/* eslint-disable-next-line max-len */ // noinspection RegExpUnnecessaryNonCapturingGroup
|
|
4
4
|
const DATE_PATTERN =
|
|
5
5
|
// eslint-disable-next-line max-len
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.6.2"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valgen",
|
|
3
3
|
"description": "Fast runtime type validator, converter and io (encoding/decoding) library",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.10.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"date-fns": "^3.6.0",
|
|
9
9
|
"ts-gems": "^3.5.0",
|
|
10
|
+
"tslib": "^2.7.0",
|
|
10
11
|
"validator": "^13.12.0"
|
|
11
12
|
},
|
|
12
13
|
"type": "module",
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"default": "./esm/index.js"
|
|
18
19
|
},
|
|
19
20
|
"require": {
|
|
20
|
-
"types": "./types/index.d.
|
|
21
|
+
"types": "./types/index.d.cts",
|
|
21
22
|
"default": "./cjs/index.js"
|
|
22
23
|
},
|
|
23
24
|
"default": "./esm/index.js"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Nullish } from 'ts-gems';
|
|
1
|
+
import type { Nullish } from 'ts-gems';
|
|
2
2
|
import { kValidatorFn } from './constants.js';
|
|
3
3
|
import { Context } from './context.js';
|
|
4
|
-
import { ErrorIssue, ExecutionOptions, ValidationOptions } from './types.js';
|
|
4
|
+
import type { ErrorIssue, ExecutionOptions, ValidationOptions } from './types.js';
|
|
5
5
|
export type ValidateFunction<T, I = T, R extends Validator<T, I> = Validator<T, I>> = (input: I, context: Context, _this: R) => Nullish<T>;
|
|
6
6
|
export interface Validator<T = any, I = any, O extends ExecutionOptions = ExecutionOptions> {
|
|
7
7
|
(input: I, options?: O, context?: Context): T;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as vg from './rules/index.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './core/index.js';
|
|
4
|
+
export { IsObject } from './rules/type-rules/is-object.js';
|
|
5
|
+
declare const isAny: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
6
|
+
declare const isArray: import("./core/validator.js").Validator<unknown[], unknown, import("./core/types.js").ExecutionOptions>;
|
|
7
|
+
declare const isBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
8
|
+
declare const isBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
9
|
+
declare const isDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
10
|
+
declare const isDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
11
|
+
declare const isEmpty: import("./core/validator.js").Validator<string | object | any[] | Set<any> | Map<any, any>, string | object | any[] | Set<any> | Map<any, any>, import("./core/types.js").ExecutionOptions>;
|
|
12
|
+
declare const isNotEmpty: import("./core/validator.js").Validator<string | object | any[] | Set<any> | Map<any, any>, string | object | any[] | Set<any> | Map<any, any>, import("./core/types.js").ExecutionOptions>;
|
|
13
|
+
declare const isInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
14
|
+
declare const isNull: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
15
|
+
declare const isNotNull: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
16
|
+
declare const isNullish: import("./core/validator.js").Validator<null, unknown, import("./core/types.js").ExecutionOptions>;
|
|
17
|
+
declare const isNotNullish: import("./core/validator.js").Validator<unknown, unknown, import("./core/types.js").ExecutionOptions>;
|
|
18
|
+
declare const isDefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
19
|
+
declare const isUndefined: import("./core/validator.js").Validator<any, unknown, import("./core/types.js").ExecutionOptions>;
|
|
20
|
+
declare const isNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
21
|
+
declare const isObject: vg.IsObject.Validator<object, string | object>;
|
|
22
|
+
declare const isObjectId: import("./core/validator.js").Validator<string | vg.ObjectIdLike | Uint8Array, unknown, import("./core/types.js").ExecutionOptions>;
|
|
23
|
+
declare const isString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
24
|
+
declare const isUUID: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
25
|
+
declare const isUUID1: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
26
|
+
declare const isUUID2: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
27
|
+
declare const isUUID3: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
28
|
+
declare const isUUID4: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
29
|
+
declare const isUUID5: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
30
|
+
declare const isEmail: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
31
|
+
declare const isMobilePhone: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
32
|
+
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
|
+
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
|
+
declare const isMACAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
35
|
+
declare const isPort: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
36
|
+
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
37
|
+
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
38
|
+
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
39
|
+
declare const isCreditCard: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
40
|
+
declare const isIBAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
41
|
+
declare const isEAN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
42
|
+
declare const isFQDN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
43
|
+
declare const isISSN: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
44
|
+
declare const isBtcAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
45
|
+
declare const isETHAddress: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
46
|
+
declare const isHexColor: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
47
|
+
declare const isJWT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
48
|
+
declare const isLowercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
49
|
+
declare const isUppercase: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
50
|
+
declare const isAlpha: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
51
|
+
declare const isAlphanumeric: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
52
|
+
declare const isAscii: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
53
|
+
declare const isDecimal: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
54
|
+
declare const isHex: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
55
|
+
declare const toArray: import("./core/validator.js").Validator<any[], any, import("./core/types.js").ExecutionOptions>;
|
|
56
|
+
declare const toBoolean: import("./core/validator.js").Validator<boolean | undefined, unknown, import("./core/types.js").ExecutionOptions>;
|
|
57
|
+
declare const toDate: import("./core/validator.js").Validator<Date, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
58
|
+
declare const toBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
|
59
|
+
declare const toDateString: import("./core/validator.js").Validator<string, string | number | Date, import("./core/types.js").ExecutionOptions>;
|
|
60
|
+
declare const toInteger: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
61
|
+
declare const toNumber: import("./core/validator.js").Validator<number, unknown, import("./core/types.js").ExecutionOptions>;
|
|
62
|
+
declare const toString: import("./core/validator.js").Validator<string, unknown, import("./core/types.js").ExecutionOptions>;
|
|
63
|
+
export { isAlpha, isAlphanumeric, isAny, isArray, isAscii, isBase64, isBigint, isBoolean, isBtcAddress, isCreditCard, isDate, isDateString, isDecimal, isDefined, isEAN, isEmail, isEmpty, isETHAddress, isFQDN, isHex, isHexColor, isIBAN, isInteger, isIP, isIPRange, isISSN, isJWT, isLowercase, isMACAddress, isMobilePhone, isNotEmpty, isNotNull, isNotNullish, isNull, isNullish, isNumber, isObject, isObjectId, isPort, isString, isSWIFT, isUndefined, isUppercase, isURL, isUUID, isUUID1, isUUID2, isUUID3, isUUID4, isUUID5, toArray, toBigint, toBoolean, toDate, toDateString, toInteger, toNumber, toString, vg, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as validatorJS from 'validator';
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
2
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
export interface Base64ValidatorOptions extends ValidationOptions, validatorJS.IsBase64Options {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as validatorJS from 'validator';
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
2
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
export interface CreditCardValidatorOptions extends ValidationOptions, validatorJS.IsCreditCardOptions {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
export interface IsEmailOptions extends ValidationOptions {
|
|
3
3
|
/**
|
|
4
4
|
* If set to `true`, the validator will also match `Display Name <email-address>`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
export interface IsFQDNOptions extends ValidationOptions {
|
|
3
3
|
/**
|
|
4
4
|
* If set to true, the validator will allow domain starting with `*.` (e.g. `*.example.com` or `*.shop.example.com`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as validatorJS from 'validator';
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
2
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
export type HashAlgorithm = validatorJS.HashAlgorithm;
|
|
4
4
|
/**
|
|
5
5
|
* Validates if value a hash of type algorithm
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
export interface IsMACAddressOptions extends ValidationOptions {
|
|
3
3
|
/**
|
|
4
4
|
* If set to `true`, the validator will allow MAC addresses without the colons.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as validatorJS from 'validator';
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
2
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
export interface IsMobilePhoneOptions extends ValidationOptions {
|
|
4
4
|
/**
|
|
5
5
|
* If this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
type IsEmptyInput = string | any[] | object | Set<any> | Map<any, any>;
|
|
3
3
|
/**
|
|
4
4
|
* Checks if value is an empty. Value should be string, array, set, map or object
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions, Validator } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates if value is "array" and applies validation for each item.
|
|
4
4
|
* Converts input value to array if coerce option is set to 'true'.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type, ValidationOptions, Validator as Validator_ } from '../../core/index.js';
|
|
1
|
+
import { type Type, type ValidationOptions, type Validator as Validator_ } from '../../core/index.js';
|
|
2
2
|
export declare namespace IsObject {
|
|
3
3
|
interface Validator<T extends object = object, I = object> extends Validator_<T, I> {
|
|
4
4
|
schema: Schema;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions, Validator } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates record object according to given "key" and "value" rules
|
|
4
4
|
* Converts properties according to rules if coerce option is set to 'true'.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationOptions, Validator } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates if value is "tuple" and applies validation for each item.
|
|
4
4
|
* Converts input value to tuple if coerce option is set to 'true'.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Nullish } from 'ts-gems';
|
|
2
|
-
import { ValidationOptions, Validator } from '../../core/index.js';
|
|
1
|
+
import type { Nullish } from 'ts-gems';
|
|
2
|
+
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Makes sub-rule optional
|
|
5
5
|
* @validator optional
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Nullish } from 'ts-gems';
|
|
2
|
-
import { ValidationOptions, Validator } from '../../core/index.js';
|
|
1
|
+
import type { Nullish } from 'ts-gems';
|
|
2
|
+
import { type ValidationOptions, type Validator } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Makes sub-rule required
|
|
5
5
|
* @validator required
|