valgen 5.9.0 → 5.12.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 +22 -0
- package/README.md +3 -3
- package/cjs/core/utilities.js +4 -4
- package/cjs/rules/format-rules/is-alpha.js +3 -3
- package/cjs/rules/format-rules/is-ascii.js +2 -2
- package/cjs/rules/format-rules/is-base64.js +2 -2
- package/cjs/rules/format-rules/is-btc-address.js +2 -2
- package/cjs/rules/format-rules/is-credit-card.js +2 -2
- package/cjs/rules/format-rules/is-decimal.js +2 -2
- package/cjs/rules/format-rules/is-ean.js +2 -2
- package/cjs/rules/format-rules/is-email.js +7 -7
- package/cjs/rules/format-rules/is-eth-address.js +2 -2
- package/cjs/rules/format-rules/is-fqdn.js +2 -2
- package/cjs/rules/format-rules/is-hash.js +2 -2
- package/cjs/rules/format-rules/is-hex-color.js +2 -2
- package/cjs/rules/format-rules/is-hex.js +2 -2
- package/cjs/rules/format-rules/is-iban.js +3 -3
- package/cjs/rules/format-rules/is-ip.js +3 -3
- package/cjs/rules/format-rules/is-issn.js +2 -2
- package/cjs/rules/format-rules/is-jwt.js +2 -2
- package/cjs/rules/format-rules/is-lowercase.js +3 -3
- package/cjs/rules/format-rules/is-mac-address.js +2 -2
- package/cjs/rules/format-rules/is-mobile-phone.js +2 -2
- package/cjs/rules/format-rules/is-object-id.js +1 -1
- package/cjs/rules/format-rules/is-passport-number.js +2 -2
- package/cjs/rules/format-rules/is-port.js +5 -3
- package/cjs/rules/format-rules/is-url.js +2 -2
- package/cjs/rules/format-rules/is-uuid.js +2 -2
- package/cjs/rules/format-rules/is-vat-number.js +2 -2
- package/cjs/tsconfig-build-cjs.tsbuildinfo +1 -0
- package/esm/core/utilities.js +1 -1
- package/esm/rules/format-rules/is-alpha.js +2 -2
- package/esm/rules/format-rules/is-ascii.js +2 -2
- package/esm/rules/format-rules/is-base64.js +2 -2
- package/esm/rules/format-rules/is-btc-address.js +2 -2
- package/esm/rules/format-rules/is-credit-card.js +2 -2
- package/esm/rules/format-rules/is-decimal.js +2 -2
- package/esm/rules/format-rules/is-ean.js +2 -2
- package/esm/rules/format-rules/is-email.js +2 -2
- package/esm/rules/format-rules/is-eth-address.js +2 -2
- package/esm/rules/format-rules/is-fqdn.js +2 -2
- package/esm/rules/format-rules/is-hash.js +2 -2
- package/esm/rules/format-rules/is-hex-color.js +2 -2
- package/esm/rules/format-rules/is-hex.js +2 -2
- package/esm/rules/format-rules/is-iban.js +2 -2
- package/esm/rules/format-rules/is-ip.js +2 -2
- package/esm/rules/format-rules/is-issn.js +2 -2
- package/esm/rules/format-rules/is-jwt.js +2 -2
- package/esm/rules/format-rules/is-lowercase.js +2 -2
- package/esm/rules/format-rules/is-mac-address.js +2 -2
- package/esm/rules/format-rules/is-mobile-phone.js +2 -2
- package/esm/rules/format-rules/is-object-id.js +1 -1
- package/esm/rules/format-rules/is-passport-number.js +2 -2
- package/esm/rules/format-rules/is-port.js +5 -3
- package/esm/rules/format-rules/is-url.js +2 -2
- package/esm/rules/format-rules/is-uuid.js +2 -2
- package/esm/rules/format-rules/is-vat-number.js +2 -2
- 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 +5 -5
- 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 +1 -1
- package/types/index.d.ts +1 -1
- 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 +2 -2
- package/types/rules/format-rules/is-btc-address.d.ts +1 -1
- package/types/rules/format-rules/is-credit-card.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/types/rules/format-rules/is-url.d.ts +2 -2
- 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
|
@@ -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.3"}
|
package/esm/core/utilities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Check if the string contains only letters (a-zA-Z).
|
|
5
5
|
* @validator isAlpha
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Check if the string contains ASCII chars only.
|
|
5
5
|
* @validator isAscii
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a "Base64" string.
|
|
5
5
|
* @validator isBase64
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a BTC address.
|
|
5
5
|
* @validator isBtcAddress
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a credit card number
|
|
5
5
|
* @validator isCreditCard
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Check if the string represents a decimal number,
|
|
5
5
|
* such as `0.1`, `.3`, `1.1`, `1.00003`, `4.0` etc.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is an EAN (European Article Number)
|
|
5
5
|
* @validator isEAN
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a ETH (Ethereum) address.
|
|
5
5
|
* @validator isETHAddress
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value a hash of type algorithm
|
|
5
5
|
* @validator isHash
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Check if the string is a hexadecimal number.
|
|
5
5
|
* @validator isHex
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is an IBAN (International Bank Account Number)
|
|
5
5
|
* @validator isIBAN
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value a Lowercase string
|
|
5
5
|
* @validator isLowercase
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a valid Email
|
|
5
5
|
* @validator isMobilePhone
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a passport number
|
|
5
5
|
* @validator isPassportNumber
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { validator } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates if value is a port number
|
|
5
5
|
* @validator isPort
|
|
6
6
|
*/
|
|
7
7
|
export function isPort(options) {
|
|
8
8
|
return validator('isPort', (input, context, _this) => {
|
|
9
|
+
if (typeof input === 'number')
|
|
10
|
+
input = String(input);
|
|
9
11
|
if (input != null &&
|
|
10
12
|
typeof input === 'string' &&
|
|
11
13
|
validatorJS.isPort(input)) {
|
|
12
|
-
return input;
|
|
14
|
+
return parseInt(input, 10);
|
|
13
15
|
}
|
|
14
16
|
context.fail(_this, `{{label}} is not a valid port number`, input);
|
|
15
17
|
}, options);
|
|
@@ -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.3"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.12.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"tslib": "^2.
|
|
8
|
+
"@browsery/validator": "^13.12.0-r1",
|
|
9
|
+
"date-fns": "^4.1.0",
|
|
10
|
+
"ts-gems": "^3.6.0",
|
|
11
|
+
"tslib": "^2.8.1"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": {
|
|
@@ -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;
|
package/types/index.d.cts
CHANGED
|
@@ -32,7 +32,7 @@ declare const isMobilePhone: import("./core/validator.js").Validator<string, str
|
|
|
32
32
|
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
33
|
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
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<
|
|
35
|
+
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
36
36
|
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
37
37
|
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
38
38
|
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
package/types/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const isMobilePhone: import("./core/validator.js").Validator<string, str
|
|
|
32
32
|
declare const isIP: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
33
33
|
declare const isIPRange: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
34
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<
|
|
35
|
+
declare const isPort: import("./core/validator.js").Validator<number, string | number, import("./core/types.js").ExecutionOptions>;
|
|
36
36
|
declare const isURL: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
37
37
|
declare const isBase64: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
38
38
|
declare const isSWIFT: import("./core/validator.js").Validator<string, string, import("./core/types.js").ExecutionOptions>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
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
|
-
import
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
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
|
-
import
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
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
|
-
import
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates if value is a port number
|
|
4
4
|
* @validator isPort
|
|
5
5
|
*/
|
|
6
|
-
export declare function isPort(options?: ValidationOptions): import("../../core/validator.js").Validator<
|
|
6
|
+
export declare function isPort(options?: ValidationOptions): import("../../core/validator.js").Validator<number, string | number, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ValidationOptions } from '../../core/index.js';
|
|
1
|
+
import validatorJS from '@browsery/validator';
|
|
2
|
+
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
export interface IsURLOptions extends ValidationOptions, validatorJS.IsURLOptions {
|
|
4
4
|
}
|
|
5
5
|
/**
|