valgen 5.7.0 → 5.8.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/esm/constants.js +2 -5
  3. package/esm/core/constants.js +2 -5
  4. package/esm/core/context.js +5 -9
  5. package/esm/core/index.js +6 -9
  6. package/esm/core/types.js +1 -2
  7. package/esm/core/utilities.js +6 -10
  8. package/esm/core/validation-error.js +1 -5
  9. package/esm/core/validator.js +14 -18
  10. package/esm/factories.js +1 -4
  11. package/esm/helpers/object.utils.js +2 -6
  12. package/esm/helpers/omit-undefined.js +1 -4
  13. package/esm/helpers/string.utils.js +1 -4
  14. package/esm/index.js +4 -67
  15. package/esm/rules/format-rules/is-alpha.js +6 -11
  16. package/esm/rules/format-rules/is-ascii.js +4 -8
  17. package/esm/rules/format-rules/is-base64.js +4 -8
  18. package/esm/rules/format-rules/is-btc-address.js +4 -8
  19. package/esm/rules/format-rules/is-credit-card.js +4 -8
  20. package/esm/rules/format-rules/is-decimal.js +4 -8
  21. package/esm/rules/format-rules/is-ean.js +4 -8
  22. package/esm/rules/format-rules/is-email.js +4 -8
  23. package/esm/rules/format-rules/is-eth-address.js +4 -8
  24. package/esm/rules/format-rules/is-fqdn.js +4 -8
  25. package/esm/rules/format-rules/is-hash.js +4 -8
  26. package/esm/rules/format-rules/is-hex-color.js +4 -8
  27. package/esm/rules/format-rules/is-hex.js +4 -8
  28. package/esm/rules/format-rules/is-iban.js +6 -11
  29. package/esm/rules/format-rules/is-ip.js +6 -11
  30. package/esm/rules/format-rules/is-issn.js +4 -8
  31. package/esm/rules/format-rules/is-jwt.js +4 -8
  32. package/esm/rules/format-rules/is-lowercase.js +6 -11
  33. package/esm/rules/format-rules/is-mac-address.js +4 -8
  34. package/esm/rules/format-rules/is-mobile-phone.js +4 -8
  35. package/esm/rules/format-rules/is-object-id.js +5 -9
  36. package/esm/rules/format-rules/is-passport-number.js +4 -8
  37. package/esm/rules/format-rules/is-port.js +4 -8
  38. package/esm/rules/format-rules/is-url.js +4 -8
  39. package/esm/rules/format-rules/is-uuid.js +4 -8
  40. package/esm/rules/format-rules/is-vat-number.js +4 -8
  41. package/esm/rules/format-rules/matches.js +3 -6
  42. package/esm/rules/index.js +50 -53
  43. package/esm/rules/logical-rules/is-defined.js +3 -6
  44. package/esm/rules/logical-rules/is-empty.js +5 -9
  45. package/esm/rules/logical-rules/range.js +19 -29
  46. package/esm/rules/type-rules/is-any.js +2 -6
  47. package/esm/rules/type-rules/is-array.js +3 -6
  48. package/esm/rules/type-rules/is-bigint.js +3 -6
  49. package/esm/rules/type-rules/is-boolean.js +3 -6
  50. package/esm/rules/type-rules/is-date.js +10 -14
  51. package/esm/rules/type-rules/is-enum.js +3 -6
  52. package/esm/rules/type-rules/is-integer.js +3 -6
  53. package/esm/rules/type-rules/is-null.js +9 -15
  54. package/esm/rules/type-rules/is-number.js +3 -6
  55. package/esm/rules/type-rules/is-object.js +11 -14
  56. package/esm/rules/type-rules/is-record.js +3 -6
  57. package/esm/rules/type-rules/is-string.js +13 -22
  58. package/esm/rules/type-rules/is-tuple.js +3 -6
  59. package/esm/rules/type-rules/is-undefined.js +3 -6
  60. package/esm/rules/utility-rules/exists.js +3 -6
  61. package/esm/rules/utility-rules/get-length.js +3 -6
  62. package/esm/rules/utility-rules/optional.js +3 -6
  63. package/esm/rules/utility-rules/pipe.js +5 -9
  64. package/esm/rules/utility-rules/required.js +3 -6
  65. package/esm/rules/utility-rules/union.js +3 -6
  66. package/package.json +1 -2
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isHexColor = isHexColor;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is a Hex Color
9
5
  * @validator isHexColor
10
6
  */
11
- function isHexColor(options) {
12
- return (0, index_js_1.validator)('isHexColor', (input, context, _this) => {
7
+ export function isHexColor(options) {
8
+ return validator('isHexColor', (input, context, _this) => {
13
9
  if (typeof input === 'string' && validatorJS.isHexColor(input)) {
14
10
  return input;
15
11
  }
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isHex = isHex;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Check if the string is a hexadecimal number.
9
5
  * @validator isHex
10
6
  */
11
- function isHex(options) {
12
- return (0, index_js_1.validator)('isHex', (input, context, _this) => {
7
+ export function isHex(options) {
8
+ return validator('isHex', (input, context, _this) => {
13
9
  if (typeof input === 'string' && validatorJS.isHexadecimal(input)) {
14
10
  return input;
15
11
  }
@@ -1,16 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isIBAN = isIBAN;
4
- exports.isSWIFT = isSWIFT;
5
- const tslib_1 = require("tslib");
6
- const validatorJS = tslib_1.__importStar(require("validator"));
7
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
8
3
  /**
9
4
  * Validates if value is an IBAN (International Bank Account Number)
10
5
  * @validator isIBAN
11
6
  */
12
- function isIBAN(options) {
13
- return (0, index_js_1.validator)('isIBAN', (input, context, _this) => {
7
+ export function isIBAN(options) {
8
+ return validator('isIBAN', (input, context, _this) => {
14
9
  if (typeof input === 'string' && validatorJS.isIBAN(input))
15
10
  return input;
16
11
  context.fail(_this, `{{label}} is not a valid IBAN (International Bank Account Number)`, input);
@@ -20,8 +15,8 @@ function isIBAN(options) {
20
15
  * Validates if value is a BIC (Bank Identification Code) or SWIFT code
21
16
  * @validator isSWIFT
22
17
  */
23
- function isSWIFT(options) {
24
- return (0, index_js_1.validator)('isSWIFT', (input, context, _this) => {
18
+ export function isSWIFT(options) {
19
+ return validator('isSWIFT', (input, context, _this) => {
25
20
  if (typeof input === 'string' && validatorJS.isBIC(input))
26
21
  return input;
27
22
  context.fail(_this, `{{label}}is not a valid a BIC (Bank Identification Code) or SWIFT code`, input);
@@ -1,16 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isIP = isIP;
4
- exports.isIPRange = isIPRange;
5
- const tslib_1 = require("tslib");
6
- const validatorJS = tslib_1.__importStar(require("validator"));
7
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
8
3
  /**
9
4
  * Validates if value is an IP
10
5
  * @validator isIP
11
6
  */
12
- function isIP(version, options) {
13
- return (0, index_js_1.validator)('isIP', (input, context, _this) => {
7
+ export function isIP(version, options) {
8
+ return validator('isIP', (input, context, _this) => {
14
9
  if (input != null &&
15
10
  typeof input === 'string' &&
16
11
  validatorJS.isIP(input, version)) {
@@ -23,8 +18,8 @@ function isIP(version, options) {
23
18
  * Validates if value is an IP
24
19
  * @validator isIPRange
25
20
  */
26
- function isIPRange(version, options) {
27
- return (0, index_js_1.validator)('isIPRange', (input, context, _this) => {
21
+ export function isIPRange(version, options) {
22
+ return validator('isIPRange', (input, context, _this) => {
28
23
  if (input != null &&
29
24
  typeof input === 'string' &&
30
25
  validatorJS.isIPRange(input, version)) {
@@ -1,19 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isISSN = isISSN;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an ISSN
9
5
  * @validator isISSN
10
6
  */
11
- function isISSN(options) {
7
+ export function isISSN(options) {
12
8
  const opts = {
13
9
  // eslint-disable-next-line camelcase
14
10
  case_sensitive: options?.caseSensitive,
15
11
  };
16
- return (0, index_js_1.validator)('isISSN', (input, context, _this) => {
12
+ return validator('isISSN', (input, context, _this) => {
17
13
  if (typeof input === 'string' && validatorJS.isISSN(input, opts)) {
18
14
  return input;
19
15
  }
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isJWT = isJWT;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value a valid JWT token
9
5
  * @validator isJWT
10
6
  */
11
- function isJWT(options) {
12
- return (0, index_js_1.validator)('isJWT', (input, context, _this) => {
7
+ export function isJWT(options) {
8
+ return validator('isJWT', (input, context, _this) => {
13
9
  if (typeof input === 'string' && validatorJS.isJWT(input))
14
10
  return input;
15
11
  context.fail(_this, `Value is not a valid JWT token`, input);
@@ -1,16 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLowercase = isLowercase;
4
- exports.isUppercase = isUppercase;
5
- const tslib_1 = require("tslib");
6
- const validatorJS = tslib_1.__importStar(require("validator"));
7
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
8
3
  /**
9
4
  * Validates if value a Lowercase string
10
5
  * @validator isLowercase
11
6
  */
12
- function isLowercase(options) {
13
- return (0, index_js_1.validator)('isLowercase', (input, context, _this) => {
7
+ export function isLowercase(options) {
8
+ return validator('isLowercase', (input, context, _this) => {
14
9
  if (typeof input === 'string' && validatorJS.isLowercase(input)) {
15
10
  return input;
16
11
  }
@@ -21,8 +16,8 @@ function isLowercase(options) {
21
16
  * Validates if value a Uppercase string
22
17
  * @validator isUppercase
23
18
  */
24
- function isUppercase(options) {
25
- return (0, index_js_1.validator)('isUppercase', (input, context, _this) => {
19
+ export function isUppercase(options) {
20
+ return validator('isUppercase', (input, context, _this) => {
26
21
  if (typeof input === 'string' && validatorJS.isUppercase(input)) {
27
22
  return input;
28
23
  }
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMACAddress = isMACAddress;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an MACAddress
9
5
  * @validator isMACAddress
10
6
  */
11
- function isMACAddress(options) {
7
+ export function isMACAddress(options) {
12
8
  const opts = {
13
9
  // eslint-disable-next-line camelcase
14
10
  no_separators: options?.noSeparators,
15
11
  eui: options?.eui,
16
12
  };
17
- return (0, index_js_1.validator)('isMACAddress', (input, context, _this) => {
13
+ return validator('isMACAddress', (input, context, _this) => {
18
14
  if (input != null &&
19
15
  typeof input === 'string' &&
20
16
  validatorJS.isMACAddress(input, opts)) {
@@ -1,18 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMobilePhone = isMobilePhone;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is a valid Email
9
5
  * @validator isMobilePhone
10
6
  */
11
- function isMobilePhone(options) {
7
+ export function isMobilePhone(options) {
12
8
  const opts = {
13
9
  strictMode: options?.strictMode,
14
10
  };
15
- return (0, index_js_1.validator)('isMobilePhone', (input, context, _this) => {
11
+ return validator('isMobilePhone', (input, context, _this) => {
16
12
  if (typeof input === 'string' &&
17
13
  validatorJS.isMobilePhone(input, options?.locale, opts)) {
18
14
  return input;
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isObjectId = isObjectId;
4
- const tslib_1 = require("tslib");
5
- const validator_1 = tslib_1.__importDefault(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import validatorJS from 'validator';
2
+ import { validator, } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an "ObjectId".
9
5
  * @validator isObjectId
10
6
  */
11
- function isObjectId(options) {
12
- return (0, index_js_1.validator)('isObjectId', (input, context, _this) => {
7
+ export function isObjectId(options) {
8
+ return validator('isObjectId', (input, context, _this) => {
13
9
  if (input != null &&
14
10
  (_isObjectIdValue(input) ||
15
11
  (typeof input === 'object' &&
@@ -24,5 +20,5 @@ function _isObjectIdValue(input) {
24
20
  return ((input instanceof Uint8Array && input.length === 12) ||
25
21
  (typeof input === 'string' &&
26
22
  input.length === 24 &&
27
- validator_1.default.isHexadecimal(input)));
23
+ validatorJS.isHexadecimal(input)));
28
24
  }
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPassportNumber = isPassportNumber;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is a passport number
9
5
  * @validator isPassportNumber
10
6
  */
11
- function isPassportNumber(countryCode, options) {
12
- return (0, index_js_1.validator)('isPassportNumber', (input, context, _this) => {
7
+ export function isPassportNumber(countryCode, options) {
8
+ return validator('isPassportNumber', (input, context, _this) => {
13
9
  if (typeof input === 'string' &&
14
10
  validatorJS.isPassportNumber(input, countryCode)) {
15
11
  return input;
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPort = isPort;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is a port number
9
5
  * @validator isPort
10
6
  */
11
- function isPort(options) {
12
- return (0, index_js_1.validator)('isPort', (input, context, _this) => {
7
+ export function isPort(options) {
8
+ return validator('isPort', (input, context, _this) => {
13
9
  if (input != null &&
14
10
  typeof input === 'string' &&
15
11
  validatorJS.isPort(input)) {
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isURL = isURL;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an URL
9
5
  * @validator isURL
10
6
  */
11
- function isURL(options) {
12
- return (0, index_js_1.validator)('isURL', (input, context, _this) => {
7
+ export function isURL(options) {
8
+ return validator('isURL', (input, context, _this) => {
13
9
  if (input != null &&
14
10
  typeof input === 'string' &&
15
11
  validatorJS.isURL(input, options)) {
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isUUID = isUUID;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an "UUID".
9
5
  * @validator isUUID
10
6
  */
11
- function isUUID(version, options) {
12
- return (0, index_js_1.validator)('isUUID', (input, context, _this) => {
7
+ export function isUUID(version, options) {
8
+ return validator('isUUID', (input, context, _this) => {
13
9
  if (input != null &&
14
10
  typeof input === 'string' &&
15
11
  validatorJS.isUUID(input, version)) {
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isVATNumber = isVATNumber;
4
- const tslib_1 = require("tslib");
5
- const validatorJS = tslib_1.__importStar(require("validator"));
6
- const index_js_1 = require("../../core/index.js");
1
+ import * as validatorJS from 'validator';
2
+ import { validator } from '../../core/index.js';
7
3
  /**
8
4
  * Validates if value is an VAT number
9
5
  * @validator isVAT
10
6
  */
11
- function isVATNumber(countryCode, options) {
12
- return (0, index_js_1.validator)('isVATNumber', (input, context, _this) => {
7
+ export function isVATNumber(countryCode, options) {
8
+ return validator('isVATNumber', (input, context, _this) => {
13
9
  if (typeof input === 'string' && validatorJS.isVAT(input, countryCode)) {
14
10
  return input;
15
11
  }
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.matches = matches;
4
- const index_js_1 = require("../../core/index.js");
1
+ import { validator, } from '../../core/index.js';
5
2
  /**
6
3
  * Coerces given value to "UUID" format or returns undefined if nullish
7
4
  * @validator uuid
8
5
  */
9
- function matches(format, options) {
6
+ export function matches(format, options) {
10
7
  const regExp = format instanceof RegExp ? format : new RegExp(format);
11
8
  const formatName = options?.formatName;
12
- return (0, index_js_1.validator)('matches', (input, context, _this) => {
9
+ return validator('matches', (input, context, _this) => {
13
10
  if (input == null)
14
11
  return;
15
12
  if (typeof input === 'string' && regExp.test(input))
@@ -1,53 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./format-rules/is-alpha.js"), exports);
5
- tslib_1.__exportStar(require("./format-rules/is-ascii.js"), exports);
6
- tslib_1.__exportStar(require("./format-rules/is-base64.js"), exports);
7
- tslib_1.__exportStar(require("./format-rules/is-btc-address.js"), exports);
8
- tslib_1.__exportStar(require("./format-rules/is-credit-card.js"), exports);
9
- tslib_1.__exportStar(require("./format-rules/is-decimal.js"), exports);
10
- tslib_1.__exportStar(require("./format-rules/is-ean.js"), exports);
11
- tslib_1.__exportStar(require("./format-rules/is-email.js"), exports);
12
- tslib_1.__exportStar(require("./format-rules/is-eth-address.js"), exports);
13
- tslib_1.__exportStar(require("./format-rules/is-fqdn.js"), exports);
14
- tslib_1.__exportStar(require("./format-rules/is-hash.js"), exports);
15
- tslib_1.__exportStar(require("./format-rules/is-hex.js"), exports);
16
- tslib_1.__exportStar(require("./format-rules/is-hex-color.js"), exports);
17
- tslib_1.__exportStar(require("./format-rules/is-iban.js"), exports);
18
- tslib_1.__exportStar(require("./format-rules/is-ip.js"), exports);
19
- tslib_1.__exportStar(require("./format-rules/is-issn.js"), exports);
20
- tslib_1.__exportStar(require("./format-rules/is-jwt.js"), exports);
21
- tslib_1.__exportStar(require("./format-rules/is-lowercase.js"), exports);
22
- tslib_1.__exportStar(require("./format-rules/is-mac-address.js"), exports);
23
- tslib_1.__exportStar(require("./format-rules/is-mobile-phone.js"), exports);
24
- tslib_1.__exportStar(require("./format-rules/is-object-id.js"), exports);
25
- tslib_1.__exportStar(require("./format-rules/is-passport-number.js"), exports);
26
- tslib_1.__exportStar(require("./format-rules/is-port.js"), exports);
27
- tslib_1.__exportStar(require("./format-rules/is-url.js"), exports);
28
- tslib_1.__exportStar(require("./format-rules/is-uuid.js"), exports);
29
- tslib_1.__exportStar(require("./format-rules/is-vat-number.js"), exports);
30
- tslib_1.__exportStar(require("./format-rules/matches.js"), exports);
31
- tslib_1.__exportStar(require("./logical-rules/is-defined.js"), exports);
32
- tslib_1.__exportStar(require("./logical-rules/is-empty.js"), exports);
33
- tslib_1.__exportStar(require("./logical-rules/range.js"), exports);
34
- tslib_1.__exportStar(require("./type-rules/is-any.js"), exports);
35
- tslib_1.__exportStar(require("./type-rules/is-array.js"), exports);
36
- tslib_1.__exportStar(require("./type-rules/is-bigint.js"), exports);
37
- tslib_1.__exportStar(require("./type-rules/is-boolean.js"), exports);
38
- tslib_1.__exportStar(require("./type-rules/is-date.js"), exports);
39
- tslib_1.__exportStar(require("./type-rules/is-enum.js"), exports);
40
- tslib_1.__exportStar(require("./type-rules/is-integer.js"), exports);
41
- tslib_1.__exportStar(require("./type-rules/is-null.js"), exports);
42
- tslib_1.__exportStar(require("./type-rules/is-number.js"), exports);
43
- tslib_1.__exportStar(require("./type-rules/is-object.js"), exports);
44
- tslib_1.__exportStar(require("./type-rules/is-record.js"), exports);
45
- tslib_1.__exportStar(require("./type-rules/is-string.js"), exports);
46
- tslib_1.__exportStar(require("./type-rules/is-tuple.js"), exports);
47
- tslib_1.__exportStar(require("./type-rules/is-undefined.js"), exports);
48
- tslib_1.__exportStar(require("./utility-rules/exists.js"), exports);
49
- tslib_1.__exportStar(require("./utility-rules/get-length.js"), exports);
50
- tslib_1.__exportStar(require("./utility-rules/optional.js"), exports);
51
- tslib_1.__exportStar(require("./utility-rules/pipe.js"), exports);
52
- tslib_1.__exportStar(require("./utility-rules/required.js"), exports);
53
- tslib_1.__exportStar(require("./utility-rules/union.js"), exports);
1
+ export * from './format-rules/is-alpha.js';
2
+ export * from './format-rules/is-ascii.js';
3
+ export * from './format-rules/is-base64.js';
4
+ export * from './format-rules/is-btc-address.js';
5
+ export * from './format-rules/is-credit-card.js';
6
+ export * from './format-rules/is-decimal.js';
7
+ export * from './format-rules/is-ean.js';
8
+ export * from './format-rules/is-email.js';
9
+ export * from './format-rules/is-eth-address.js';
10
+ export * from './format-rules/is-fqdn.js';
11
+ export * from './format-rules/is-hash.js';
12
+ export * from './format-rules/is-hex.js';
13
+ export * from './format-rules/is-hex-color.js';
14
+ export * from './format-rules/is-iban.js';
15
+ export * from './format-rules/is-ip.js';
16
+ export * from './format-rules/is-issn.js';
17
+ export * from './format-rules/is-jwt.js';
18
+ export * from './format-rules/is-lowercase.js';
19
+ export * from './format-rules/is-mac-address.js';
20
+ export * from './format-rules/is-mobile-phone.js';
21
+ export * from './format-rules/is-object-id.js';
22
+ export * from './format-rules/is-passport-number.js';
23
+ export * from './format-rules/is-port.js';
24
+ export * from './format-rules/is-url.js';
25
+ export * from './format-rules/is-uuid.js';
26
+ export * from './format-rules/is-vat-number.js';
27
+ export * from './format-rules/matches.js';
28
+ export * from './logical-rules/is-defined.js';
29
+ export * from './logical-rules/is-empty.js';
30
+ export * from './logical-rules/range.js';
31
+ export * from './type-rules/is-any.js';
32
+ export * from './type-rules/is-array.js';
33
+ export * from './type-rules/is-bigint.js';
34
+ export * from './type-rules/is-boolean.js';
35
+ export * from './type-rules/is-date.js';
36
+ export * from './type-rules/is-enum.js';
37
+ export * from './type-rules/is-integer.js';
38
+ export * from './type-rules/is-null.js';
39
+ export * from './type-rules/is-number.js';
40
+ export * from './type-rules/is-object.js';
41
+ export * from './type-rules/is-record.js';
42
+ export * from './type-rules/is-string.js';
43
+ export * from './type-rules/is-tuple.js';
44
+ export * from './type-rules/is-undefined.js';
45
+ export * from './utility-rules/exists.js';
46
+ export * from './utility-rules/get-length.js';
47
+ export * from './utility-rules/optional.js';
48
+ export * from './utility-rules/pipe.js';
49
+ export * from './utility-rules/required.js';
50
+ export * from './utility-rules/union.js';
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDefined = isDefined;
4
- const index_js_1 = require("../../core/index.js");
1
+ import { validator } from '../../core/index.js';
5
2
  /**
6
3
  * Validates if value is not "undefined" nor "null"
7
4
  * @validator isDefined
8
5
  */
9
- function isDefined(options) {
10
- return (0, index_js_1.validator)('is-defined', (input, context, _this) => {
6
+ export function isDefined(options) {
7
+ return validator('is-defined', (input, context, _this) => {
11
8
  if (input !== undefined)
12
9
  return input;
13
10
  context.fail(_this, `Is not defined`, input);
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmpty = isEmpty;
4
- exports.isNotEmpty = isNotEmpty;
5
- const index_js_1 = require("../../core/index.js");
1
+ import { validator } from '../../core/index.js';
6
2
  /**
7
3
  * Checks if value is an empty. Value should be string, array, set, map or object
8
4
  * @validator isEmpty
9
5
  */
10
- function isEmpty(options) {
11
- return (0, index_js_1.validator)('isEmpty', (input, context, _this) => {
6
+ export function isEmpty(options) {
7
+ return validator('isEmpty', (input, context, _this) => {
12
8
  if (input == null)
13
9
  return input;
14
10
  if (typeof input === 'string') {
@@ -43,8 +39,8 @@ function isEmpty(options) {
43
39
  * Checks if value is a not empty. Value should be string, array, set, map or object
44
40
  * @validator isNotEmpty
45
41
  */
46
- function isNotEmpty(options) {
47
- return (0, index_js_1.validator)('isNotEmpty', (input, context, _this) => {
42
+ export function isNotEmpty(options) {
43
+ return validator('isNotEmpty', (input, context, _this) => {
48
44
  if (input != null) {
49
45
  if (typeof input === 'string') {
50
46
  if (input)