n4s 5.0.15 → 5.0.17
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/dist/cjs/date.development.js +1 -19
- package/dist/cjs/date.development.js.map +1 -1
- package/dist/cjs/date.production.js +1 -1
- package/dist/cjs/date.production.js.map +1 -1
- package/dist/cjs/email.development.js +15 -17
- package/dist/cjs/email.development.js.map +1 -1
- package/dist/cjs/email.production.js +1 -1
- package/dist/cjs/email.production.js.map +1 -1
- package/dist/es/date.development.js +1 -19
- package/dist/es/date.development.js.map +1 -1
- package/dist/es/date.production.js +1 -1
- package/dist/es/date.production.js.map +1 -1
- package/dist/es/email.development.js +15 -17
- package/dist/es/email.development.js.map +1 -1
- package/dist/es/email.production.js +1 -1
- package/dist/es/email.production.js.map +1 -1
- package/dist/umd/date.development.js +1 -19
- package/dist/umd/date.development.js.map +1 -1
- package/dist/umd/date.production.js +1 -1
- package/dist/umd/date.production.js.map +1 -1
- package/dist/umd/email.development.js +15 -17
- package/dist/umd/email.development.js.map +1 -1
- package/dist/umd/email.production.js +1 -1
- package/dist/umd/email.production.js.map +1 -1
- package/package.json +4 -4
|
@@ -126,25 +126,7 @@ function isDate(input, options) {
|
|
|
126
126
|
_iterator.f();
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (dateObj.y.length === 2) {
|
|
132
|
-
var parsedYear = parseInt(dateObj.y, 10);
|
|
133
|
-
|
|
134
|
-
if (isNaN(parsedYear)) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
var currentYearLastTwoDigits = new Date().getFullYear() % 100;
|
|
139
|
-
|
|
140
|
-
if (parsedYear < currentYearLastTwoDigits) {
|
|
141
|
-
fullYear = "20".concat(dateObj.y);
|
|
142
|
-
} else {
|
|
143
|
-
fullYear = "19".concat(dateObj.y);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return new Date("".concat(fullYear, "-").concat(dateObj.m, "-").concat(dateObj.d)).getDate() === +dateObj.d;
|
|
129
|
+
return new Date("".concat(dateObj.m, "/").concat(dateObj.d, "/").concat(dateObj.y)).getDate() === +dateObj.d;
|
|
148
130
|
}
|
|
149
131
|
|
|
150
132
|
if (!options.strictMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQAA,WAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("n4s");function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=r(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function e(t){return n(t),t=Date.parse(t),isNaN(t)?null:new Date(t)}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;for(var n in r)void 0===t[n]&&(t[n]=r[n]);return t}function i(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,r)||a(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,r){if(t){if("string"==typeof t)return u(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,r):void 0}}function u(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}var c={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};var f=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,
|
|
1
|
+
"use strict";var t=require("n4s");function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=r(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function e(t){return n(t),t=Date.parse(t),isNaN(t)?null:new Date(t)}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;for(var n in r)void 0===t[n]&&(t[n]=r[n]);return t}function i(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,r)||a(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,r){if(t){if("string"==typeof t)return u(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,r):void 0}}function u(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}var c={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};var f=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,d=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,l=function(t){var r=t.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(r){var n=Number(r[1]),e=Number(r[2]);return n%4==0&&n%100!=0||n%400==0?e<=366:e<=365}var o=t.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),i=o[1],a=o[2],u=o[3],c=a?"0".concat(a).slice(-2):a,f=u?"0".concat(u).slice(-2):u,d=new Date("".concat(i,"-").concat(c||"01","-").concat(f||"01"));return!a||!u||d.getUTCFullYear()===i&&d.getUTCMonth()+1===a&&d.getUTCDate()===u};t.enforce.extend({isAfter:function(t,r){var n=e((null==r?void 0:r.comparisonDate)||r||Date().toString()),o=e(t);return!!(o&&n&&o>n)},isBefore:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);n(t);var o=e(r),i=e(t);return!!(i&&o&&i<o)},isDate:function(t,r){if(r=o("string"==typeof r?{format:r}:r,c),"string"==typeof t&&(v=r.format,/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(v))){var n,e=r.delimiters.find((function(t){return-1!==r.format.indexOf(t)})),u=r.strictMode?e:r.delimiters.find((function(r){return-1!==t.indexOf(r)})),f=function(t,r){for(var n=[],e=Math.min(t.length,r.length),o=0;o<e;o++)n.push([t[o],r[o]]);return n}(t.split(u),r.format.toLowerCase().split(e)),d={},l=function(t,r){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw i}}}}(f);try{for(l.s();!(n=l.n()).done;){var s=i(n.value,2),y=s[0],m=s[1];if(y.length!==m.length)return!1;d[m.charAt(0)]=y}}catch(t){l.e(t)}finally{l.f()}return new Date("".concat(d.m,"/").concat(d.d,"/").concat(d.y)).getDate()===+d.d}var v;return!r.strictMode&&("[object Date]"===Object.prototype.toString.call(t)&&isFinite(t))},isISO8601:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(t);var e=r.strictSeparator?d.test(t):f.test(t);return e&&r.strict?l(t):e}});
|
|
2
2
|
//# sourceMappingURL=date.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"qqFAQAA,EAAAA,QAAQC,OAAO,CAAEC,mHAASC,+IAAUC,
|
|
1
|
+
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"qqFAQAA,EAAAA,QAAQC,OAAO,CAAEC,mHAASC,+IAAUC,m+CAAQC"}
|
|
@@ -15,6 +15,19 @@ function assertString(input) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function merge() {
|
|
19
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
+
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
21
|
+
|
|
22
|
+
for (var key in defaults) {
|
|
23
|
+
if (typeof obj[key] === 'undefined') {
|
|
24
|
+
obj[key] = defaults[key];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
19
32
|
/* eslint-disable prefer-rest-params */
|
|
20
33
|
|
|
@@ -36,19 +49,6 @@ function isByteLength(str, options) {
|
|
|
36
49
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
37
50
|
}
|
|
38
51
|
|
|
39
|
-
function merge() {
|
|
40
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
41
|
-
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
42
|
-
|
|
43
|
-
for (var key in defaults) {
|
|
44
|
-
if (typeof obj[key] === 'undefined') {
|
|
45
|
-
obj[key] = defaults[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
52
|
var default_fqdn_options = {
|
|
53
53
|
require_tld: true,
|
|
54
54
|
allow_underscores: false,
|
|
@@ -180,7 +180,6 @@ function isIP(str) {
|
|
|
180
180
|
|
|
181
181
|
var default_email_options = {
|
|
182
182
|
allow_display_name: false,
|
|
183
|
-
allow_underscores: false,
|
|
184
183
|
require_display_name: false,
|
|
185
184
|
allow_utf8_local_part: true,
|
|
186
185
|
require_tld: true,
|
|
@@ -197,7 +196,7 @@ var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i;
|
|
|
197
196
|
var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
|
|
198
197
|
var gmailUserPart = /^[a-z\d]+$/;
|
|
199
198
|
var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
|
|
200
|
-
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\
|
|
199
|
+
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
|
|
201
200
|
var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
|
|
202
201
|
var defaultMaxEmailLength = 254;
|
|
203
202
|
/* eslint-enable max-len */
|
|
@@ -321,8 +320,7 @@ function isEmail(str, options) {
|
|
|
321
320
|
|
|
322
321
|
if (!isFQDN(domain, {
|
|
323
322
|
require_tld: options.require_tld,
|
|
324
|
-
ignore_max_length: options.ignore_max_length
|
|
325
|
-
allow_underscores: options.allow_underscores
|
|
323
|
+
ignore_max_length: options.ignore_max_length
|
|
326
324
|
})) {
|
|
327
325
|
if (!options.allow_ip_domain) {
|
|
328
326
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,WAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("n4s");function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(t){return
|
|
1
|
+
"use strict";var t=require("n4s");function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r,i;n(t),"object"===o(e)?(r=e.min||0,i=e.max):(r=arguments[1],i=arguments[2]);var a=encodeURI(t).split(/%..|./).length-1;return a>=r&&(void 0===i||a<=i)}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};var c="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",l="(".concat(c,"[.]){3}").concat(c),u=new RegExp("^".concat(l,"$")),s="(?:[0-9a-fA-F]{1,4})",f=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(l,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(l,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(l,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(l,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(l,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(l,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(l,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n(t),(e=String(e))?"4"===e?u.test(t):"6"===e&&f.test(t):_(t,4)||_(t,6)}var x={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},d=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,g=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,m=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,F=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;t.enforce.extend({isEmail:function(t,e){if(n(t),(e=r(e,x)).require_display_name||e.allow_display_name){var o=t.match(d);if(o){var c=o[1];if(t=t.replace(c,"").replace(/(^<|>$)/g,""),c.endsWith(" ")&&(c=c.slice(0,-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(c))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var l=t.split("@"),u=l.pop(),s=u.toLowerCase();if(e.host_blacklist.includes(s))return!1;if(e.host_whitelist.length>0&&!e.host_whitelist.includes(s))return!1;var f=l.join("@");if(e.domain_specific_validation&&("gmail.com"===s||"googlemail.com"===s)){var y=(f=f.toLowerCase()).split("+")[0];if(!i(y.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=y.split("."),v=0;v<b.length;v++)if(!m.test(b[v]))return!1}if(!(!1!==e.ignore_max_length||i(f,{max:64})&&i(u,{max:254})))return!1;if(!function(t,e){n(t),(e=r(e,a)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var o=t.split("."),i=o[o.length-1];if(e.require_tld){if(o.length<2)return!1;if(!e.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1;if(/\s/.test(i))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(i))&&o.every((function(t){return!(t.length>63&&!e.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))}(u,{require_tld:e.require_tld,ignore_max_length:e.ignore_max_length})){if(!e.allow_ip_domain)return!1;if(!_(u)){if(!u.startsWith("[")||!u.endsWith("]"))return!1;var w=u.slice(1,-1);if(0===w.length||!_(w))return!1}}if('"'===f[0])return f=f.slice(1,f.length-1),e.allow_utf8_local_part?h.test(f):p.test(f);for(var $=e.allow_utf8_local_part?F:g,D=f.split("."),S=0;S<D.length;S++)if(!$.test(D[S]))return!1;return!e.blacklisted_chars||-1===f.search(new RegExp("[".concat(e.blacklisted_chars,"]+"),"g"))}});
|
|
2
2
|
//# sourceMappingURL=email.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"6qFAKAA,EAAAA,QAAQC,OAAO,CAAEC"}
|
|
@@ -124,25 +124,7 @@ function isDate(input, options) {
|
|
|
124
124
|
_iterator.f();
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (dateObj.y.length === 2) {
|
|
130
|
-
var parsedYear = parseInt(dateObj.y, 10);
|
|
131
|
-
|
|
132
|
-
if (isNaN(parsedYear)) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
var currentYearLastTwoDigits = new Date().getFullYear() % 100;
|
|
137
|
-
|
|
138
|
-
if (parsedYear < currentYearLastTwoDigits) {
|
|
139
|
-
fullYear = "20".concat(dateObj.y);
|
|
140
|
-
} else {
|
|
141
|
-
fullYear = "19".concat(dateObj.y);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return new Date("".concat(fullYear, "-").concat(dateObj.m, "-").concat(dateObj.d)).getDate() === +dateObj.d;
|
|
127
|
+
return new Date("".concat(dateObj.m, "/").concat(dateObj.d, "/").concat(dateObj.y)).getDate() === +dateObj.d;
|
|
146
128
|
}
|
|
147
129
|
|
|
148
130
|
if (!options.strictMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{enforce as t}from"n4s";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=r(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function e(t){return n(t),t=Date.parse(t),isNaN(t)?null:new Date(t)}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;for(var n in r)void 0===t[n]&&(t[n]=r[n]);return t}function i(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,r)||a(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,r){if(t){if("string"==typeof t)return u(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,r):void 0}}function u(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}var c={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};var f=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,
|
|
1
|
+
import{enforce as t}from"n4s";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=r(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function e(t){return n(t),t=Date.parse(t),isNaN(t)?null:new Date(t)}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;for(var n in r)void 0===t[n]&&(t[n]=r[n]);return t}function i(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,r)||a(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,r){if(t){if("string"==typeof t)return u(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,r):void 0}}function u(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}var c={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};var f=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,d=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,l=function(t){var r=t.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(r){var n=Number(r[1]),e=Number(r[2]);return n%4==0&&n%100!=0||n%400==0?e<=366:e<=365}var o=t.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),i=o[1],a=o[2],u=o[3],c=a?"0".concat(a).slice(-2):a,f=u?"0".concat(u).slice(-2):u,d=new Date("".concat(i,"-").concat(c||"01","-").concat(f||"01"));return!a||!u||d.getUTCFullYear()===i&&d.getUTCMonth()+1===a&&d.getUTCDate()===u};t.extend({isAfter:function(t,r){var n=e((null==r?void 0:r.comparisonDate)||r||Date().toString()),o=e(t);return!!(o&&n&&o>n)},isBefore:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);n(t);var o=e(r),i=e(t);return!!(i&&o&&i<o)},isDate:function(t,r){if(r=o("string"==typeof r?{format:r}:r,c),"string"==typeof t&&(v=r.format,/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(v))){var n,e=r.delimiters.find((function(t){return-1!==r.format.indexOf(t)})),u=r.strictMode?e:r.delimiters.find((function(r){return-1!==t.indexOf(r)})),f=function(t,r){for(var n=[],e=Math.min(t.length,r.length),o=0;o<e;o++)n.push([t[o],r[o]]);return n}(t.split(u),r.format.toLowerCase().split(e)),d={},l=function(t,r){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw i}}}}(f);try{for(l.s();!(n=l.n()).done;){var y=i(n.value,2),s=y[0],m=y[1];if(s.length!==m.length)return!1;d[m.charAt(0)]=s}}catch(t){l.e(t)}finally{l.f()}return new Date("".concat(d.m,"/").concat(d.d,"/").concat(d.y)).getDate()===+d.d}var v;return!r.strictMode&&("[object Date]"===Object.prototype.toString.call(t)&&isFinite(t))},isISO8601:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(t);var e=r.strictSeparator?d.test(t):f.test(t);return e&&r.strict?l(t):e}});
|
|
2
2
|
//# sourceMappingURL=date.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"iqFAQAA,EAAQC,OAAO,CAAEC,mHAASC,+IAAUC,
|
|
1
|
+
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"iqFAQAA,EAAQC,OAAO,CAAEC,mHAASC,+IAAUC,m+CAAQC"}
|
|
@@ -13,6 +13,19 @@ function assertString(input) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function merge() {
|
|
17
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
|
+
|
|
20
|
+
for (var key in defaults) {
|
|
21
|
+
if (typeof obj[key] === 'undefined') {
|
|
22
|
+
obj[key] = defaults[key];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
28
|
+
|
|
16
29
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
17
30
|
/* eslint-disable prefer-rest-params */
|
|
18
31
|
|
|
@@ -34,19 +47,6 @@ function isByteLength(str, options) {
|
|
|
34
47
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
35
48
|
}
|
|
36
49
|
|
|
37
|
-
function merge() {
|
|
38
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
39
|
-
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
40
|
-
|
|
41
|
-
for (var key in defaults) {
|
|
42
|
-
if (typeof obj[key] === 'undefined') {
|
|
43
|
-
obj[key] = defaults[key];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return obj;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
50
|
var default_fqdn_options = {
|
|
51
51
|
require_tld: true,
|
|
52
52
|
allow_underscores: false,
|
|
@@ -178,7 +178,6 @@ function isIP(str) {
|
|
|
178
178
|
|
|
179
179
|
var default_email_options = {
|
|
180
180
|
allow_display_name: false,
|
|
181
|
-
allow_underscores: false,
|
|
182
181
|
require_display_name: false,
|
|
183
182
|
allow_utf8_local_part: true,
|
|
184
183
|
require_tld: true,
|
|
@@ -195,7 +194,7 @@ var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i;
|
|
|
195
194
|
var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
|
|
196
195
|
var gmailUserPart = /^[a-z\d]+$/;
|
|
197
196
|
var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
|
|
198
|
-
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\
|
|
197
|
+
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
|
|
199
198
|
var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
|
|
200
199
|
var defaultMaxEmailLength = 254;
|
|
201
200
|
/* eslint-enable max-len */
|
|
@@ -319,8 +318,7 @@ function isEmail(str, options) {
|
|
|
319
318
|
|
|
320
319
|
if (!isFQDN(domain, {
|
|
321
320
|
require_tld: options.require_tld,
|
|
322
|
-
ignore_max_length: options.ignore_max_length
|
|
323
|
-
allow_underscores: options.allow_underscores
|
|
321
|
+
ignore_max_length: options.ignore_max_length
|
|
324
322
|
})) {
|
|
325
323
|
if (!options.allow_ip_domain) {
|
|
326
324
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{enforce as t}from"n4s";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(t){return
|
|
1
|
+
import{enforce as t}from"n4s";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r,i;n(t),"object"===o(e)?(r=e.min||0,i=e.max):(r=arguments[1],i=arguments[2]);var a=encodeURI(t).split(/%..|./).length-1;return a>=r&&(void 0===i||a<=i)}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};var c="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",l="(".concat(c,"[.]){3}").concat(c),u=new RegExp("^".concat(l,"$")),f="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(f,":){7}(?:").concat(f,"|:)|")+"(?:".concat(f,":){6}(?:").concat(l,"|:").concat(f,"|:)|")+"(?:".concat(f,":){5}(?::").concat(l,"|(:").concat(f,"){1,2}|:)|")+"(?:".concat(f,":){4}(?:(:").concat(f,"){0,1}:").concat(l,"|(:").concat(f,"){1,3}|:)|")+"(?:".concat(f,":){3}(?:(:").concat(f,"){0,2}:").concat(l,"|(:").concat(f,"){1,4}|:)|")+"(?:".concat(f,":){2}(?:(:").concat(f,"){0,3}:").concat(l,"|(:").concat(f,"){1,5}|:)|")+"(?:".concat(f,":){1}(?:(:").concat(f,"){0,4}:").concat(l,"|(:").concat(f,"){1,6}|:)|")+"(?::((?::".concat(f,"){0,5}:").concat(l,"|(?::").concat(f,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n(t),(e=String(e))?"4"===e?u.test(t):"6"===e&&s.test(t):_(t,4)||_(t,6)}var x={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},d=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,g=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,m=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,F=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;t.extend({isEmail:function(t,e){if(n(t),(e=r(e,x)).require_display_name||e.allow_display_name){var o=t.match(d);if(o){var c=o[1];if(t=t.replace(c,"").replace(/(^<|>$)/g,""),c.endsWith(" ")&&(c=c.slice(0,-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(c))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var l=t.split("@"),u=l.pop(),f=u.toLowerCase();if(e.host_blacklist.includes(f))return!1;if(e.host_whitelist.length>0&&!e.host_whitelist.includes(f))return!1;var s=l.join("@");if(e.domain_specific_validation&&("gmail.com"===f||"googlemail.com"===f)){var y=(s=s.toLowerCase()).split("+")[0];if(!i(y.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=y.split("."),v=0;v<b.length;v++)if(!m.test(b[v]))return!1}if(!(!1!==e.ignore_max_length||i(s,{max:64})&&i(u,{max:254})))return!1;if(!function(t,e){n(t),(e=r(e,a)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var o=t.split("."),i=o[o.length-1];if(e.require_tld){if(o.length<2)return!1;if(!e.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1;if(/\s/.test(i))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(i))&&o.every((function(t){return!(t.length>63&&!e.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))}(u,{require_tld:e.require_tld,ignore_max_length:e.ignore_max_length})){if(!e.allow_ip_domain)return!1;if(!_(u)){if(!u.startsWith("[")||!u.endsWith("]"))return!1;var w=u.slice(1,-1);if(0===w.length||!_(w))return!1}}if('"'===s[0])return s=s.slice(1,s.length-1),e.allow_utf8_local_part?h.test(s):p.test(s);for(var $=e.allow_utf8_local_part?F:g,D=s.split("."),S=0;S<D.length;S++)if(!$.test(D[S]))return!1;return!e.blacklisted_chars||-1===s.search(new RegExp("[".concat(e.blacklisted_chars,"]+"),"g"))}});
|
|
2
2
|
//# sourceMappingURL=email.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"yqFAKAA,EAAQC,OAAO,CAAEC"}
|
|
@@ -128,25 +128,7 @@
|
|
|
128
128
|
_iterator.f();
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (dateObj.y.length === 2) {
|
|
134
|
-
var parsedYear = parseInt(dateObj.y, 10);
|
|
135
|
-
|
|
136
|
-
if (isNaN(parsedYear)) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var currentYearLastTwoDigits = new Date().getFullYear() % 100;
|
|
141
|
-
|
|
142
|
-
if (parsedYear < currentYearLastTwoDigits) {
|
|
143
|
-
fullYear = "20".concat(dateObj.y);
|
|
144
|
-
} else {
|
|
145
|
-
fullYear = "19".concat(dateObj.y);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return new Date("".concat(fullYear, "-").concat(dateObj.m, "-").concat(dateObj.d)).getDate() === +dateObj.d;
|
|
131
|
+
return new Date("".concat(dateObj.m, "/").concat(dateObj.d, "/").concat(dateObj.y)).getDate() === +dateObj.d;
|
|
150
132
|
}
|
|
151
133
|
|
|
152
134
|
if (!options.strictMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.development.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQAA,aAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("n4s")):"function"==typeof define&&define.amd?define(["n4s"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).n4s)}(this,(function(t){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("n4s")):"function"==typeof define&&define.amd?define(["n4s"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).n4s)}(this,(function(t){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){if(!("string"==typeof t||t instanceof String)){var r=n(t);throw null===t?r="null":"object"===r&&(r=t.constructor.name),new TypeError("Expected a string but received a ".concat(r))}}function e(t){return r(t),t=Date.parse(t),isNaN(t)?null:new Date(t)}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],e=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(r.push(a.value),!n||r.length!==n);e=!0);}catch(t){o=!0,i=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,n)||a(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,n){if(t){if("string"==typeof t)return u(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,n):void 0}}function u(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}var f={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};var c=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,d=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,l=function(t){var n=t.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(n){var r=Number(n[1]),e=Number(n[2]);return r%4==0&&r%100!=0||r%400==0?e<=366:e<=365}var o=t.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),i=o[1],a=o[2],u=o[3],f=a?"0".concat(a).slice(-2):a,c=u?"0".concat(u).slice(-2):u,d=new Date("".concat(i,"-").concat(f||"01","-").concat(c||"01"));return!a||!u||d.getUTCFullYear()===i&&d.getUTCMonth()+1===a&&d.getUTCDate()===u};t.enforce.extend({isAfter:function(t,n){var r=e((null==n?void 0:n.comparisonDate)||n||Date().toString()),o=e(t);return!!(o&&r&&o>r)},isBefore:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);r(t);var o=e(n),i=e(t);return!!(i&&o&&i<o)},isDate:function(t,n){if(n=o("string"==typeof n?{format:n}:n,f),"string"==typeof t&&(v=n.format,/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(v))){var r,e=n.delimiters.find((function(t){return-1!==n.format.indexOf(t)})),u=n.strictMode?e:n.delimiters.find((function(n){return-1!==t.indexOf(n)})),c=function(t,n){for(var r=[],e=Math.min(t.length,n.length),o=0;o<e;o++)r.push([t[o],n[o]]);return r}(t.split(u),n.format.toLowerCase().split(e)),d={},l=function(t,n){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=a(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,f=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){f=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(f)throw i}}}}(c);try{for(l.s();!(r=l.n()).done;){var s=i(r.value,2),y=s[0],m=s[1];if(y.length!==m.length)return!1;d[m.charAt(0)]=y}}catch(t){l.e(t)}finally{l.f()}return new Date("".concat(d.m,"/").concat(d.d,"/").concat(d.y)).getDate()===+d.d}var v;return!n.strictMode&&("[object Date]"===Object.prototype.toString.call(t)&&isFinite(t))},isISO8601:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(t);var e=n.strictSeparator?d.test(t):c.test(t);return e&&n.strict?l(t):e}})}));
|
|
2
2
|
//# sourceMappingURL=date.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"82FAQAA,EAAAA,QAAQC,OAAO,CAAEC,mHAASC,+IAAUC,
|
|
1
|
+
{"version":3,"file":"date.production.js","sources":["../../src/exports/date.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isAfter from 'validator/es/lib/isAfter';\nimport isBefore from 'validator/es/lib/isBefore';\nimport isDate from 'validator/es/lib/isDate';\nimport isISO8601 from 'validator/es/lib/isISO8601';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isAfter, isBefore, isDate, isISO8601 });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isAfter: EnforceCustomMatcher<typeof isAfter, R>;\n isBefore: EnforceCustomMatcher<typeof isBefore, R>;\n isDate: EnforceCustomMatcher<typeof isDate, R>;\n isISO8601: EnforceCustomMatcher<typeof isISO8601, R>;\n }\n }\n}\n"],"names":["enforce","extend","isAfter","isBefore","isDate","isISO8601"],"mappings":"82FAQAA,EAAAA,QAAQC,OAAO,CAAEC,mHAASC,+IAAUC,m+CAAQC"}
|
|
@@ -17,6 +17,19 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function merge() {
|
|
21
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
|
+
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
23
|
+
|
|
24
|
+
for (var key in defaults) {
|
|
25
|
+
if (typeof obj[key] === 'undefined') {
|
|
26
|
+
obj[key] = defaults[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
21
34
|
/* eslint-disable prefer-rest-params */
|
|
22
35
|
|
|
@@ -38,19 +51,6 @@
|
|
|
38
51
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
39
52
|
}
|
|
40
53
|
|
|
41
|
-
function merge() {
|
|
42
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
43
|
-
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
44
|
-
|
|
45
|
-
for (var key in defaults) {
|
|
46
|
-
if (typeof obj[key] === 'undefined') {
|
|
47
|
-
obj[key] = defaults[key];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return obj;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
54
|
var default_fqdn_options = {
|
|
55
55
|
require_tld: true,
|
|
56
56
|
allow_underscores: false,
|
|
@@ -182,7 +182,6 @@
|
|
|
182
182
|
|
|
183
183
|
var default_email_options = {
|
|
184
184
|
allow_display_name: false,
|
|
185
|
-
allow_underscores: false,
|
|
186
185
|
require_display_name: false,
|
|
187
186
|
allow_utf8_local_part: true,
|
|
188
187
|
require_tld: true,
|
|
@@ -199,7 +198,7 @@
|
|
|
199
198
|
var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
|
|
200
199
|
var gmailUserPart = /^[a-z\d]+$/;
|
|
201
200
|
var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
|
|
202
|
-
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\
|
|
201
|
+
var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
|
|
203
202
|
var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
|
|
204
203
|
var defaultMaxEmailLength = 254;
|
|
205
204
|
/* eslint-enable max-len */
|
|
@@ -323,8 +322,7 @@
|
|
|
323
322
|
|
|
324
323
|
if (!isFQDN(domain, {
|
|
325
324
|
require_tld: options.require_tld,
|
|
326
|
-
ignore_max_length: options.ignore_max_length
|
|
327
|
-
allow_underscores: options.allow_underscores
|
|
325
|
+
ignore_max_length: options.ignore_max_length
|
|
328
326
|
})) {
|
|
329
327
|
if (!options.allow_ip_domain) {
|
|
330
328
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.development.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,aAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("n4s")):"function"==typeof define&&define.amd?define(["n4s"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).n4s)}(this,(function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(t){return
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("n4s")):"function"==typeof define&&define.amd?define(["n4s"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).n4s)}(this,(function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r,i;n(t),"object"===o(e)?(r=e.min||0,i=e.max):(r=arguments[1],i=arguments[2]);var a=encodeURI(t).split(/%..|./).length-1;return a>=r&&(void 0===i||a<=i)}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};var c="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",l="(".concat(c,"[.]){3}").concat(c),u=new RegExp("^".concat(l,"$")),f="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(f,":){7}(?:").concat(f,"|:)|")+"(?:".concat(f,":){6}(?:").concat(l,"|:").concat(f,"|:)|")+"(?:".concat(f,":){5}(?::").concat(l,"|(:").concat(f,"){1,2}|:)|")+"(?:".concat(f,":){4}(?:(:").concat(f,"){0,1}:").concat(l,"|(:").concat(f,"){1,3}|:)|")+"(?:".concat(f,":){3}(?:(:").concat(f,"){0,2}:").concat(l,"|(:").concat(f,"){1,4}|:)|")+"(?:".concat(f,":){2}(?:(:").concat(f,"){0,3}:").concat(l,"|(:").concat(f,"){1,5}|:)|")+"(?:".concat(f,":){1}(?:(:").concat(f,"){0,4}:").concat(l,"|(:").concat(f,"){1,6}|:)|")+"(?::((?::".concat(f,"){0,5}:").concat(l,"|(?::").concat(f,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n(t),(e=String(e))?"4"===e?u.test(t):"6"===e&&s.test(t):_(t,4)||_(t,6)}var x={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},d=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,g=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,p=/^[a-z\d]+$/,m=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,h=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,F=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;t.enforce.extend({isEmail:function(t,e){if(n(t),(e=r(e,x)).require_display_name||e.allow_display_name){var o=t.match(d);if(o){var c=o[1];if(t=t.replace(c,"").replace(/(^<|>$)/g,""),c.endsWith(" ")&&(c=c.slice(0,-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(c))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var l=t.split("@"),u=l.pop(),f=u.toLowerCase();if(e.host_blacklist.includes(f))return!1;if(e.host_whitelist.length>0&&!e.host_whitelist.includes(f))return!1;var s=l.join("@");if(e.domain_specific_validation&&("gmail.com"===f||"googlemail.com"===f)){var y=(s=s.toLowerCase()).split("+")[0];if(!i(y.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=y.split("."),v=0;v<b.length;v++)if(!p.test(b[v]))return!1}if(!(!1!==e.ignore_max_length||i(s,{max:64})&&i(u,{max:254})))return!1;if(!function(t,e){n(t),(e=r(e,a)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var o=t.split("."),i=o[o.length-1];if(e.require_tld){if(o.length<2)return!1;if(!e.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1;if(/\s/.test(i))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(i))&&o.every((function(t){return!(t.length>63&&!e.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))}(u,{require_tld:e.require_tld,ignore_max_length:e.ignore_max_length})){if(!e.allow_ip_domain)return!1;if(!_(u)){if(!u.startsWith("[")||!u.endsWith("]"))return!1;var w=u.slice(1,-1);if(0===w.length||!_(w))return!1}}if('"'===s[0])return s=s.slice(1,s.length-1),e.allow_utf8_local_part?F.test(s):m.test(s);for(var $=e.allow_utf8_local_part?h:g,D=s.split("."),S=0;S<D.length;S++)if(!$.test(D[S]))return!1;return!e.blacklisted_chars||-1===s.search(new RegExp("[".concat(e.blacklisted_chars,"]+"),"g"))}})}));
|
|
2
2
|
//# sourceMappingURL=email.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.production.js","sources":["../../src/exports/email.ts"],"sourcesContent":["import { enforce } from 'n4s';\nimport isEmail from 'validator/es/lib/isEmail';\n\nimport { EnforceCustomMatcher } from 'enforceUtilityTypes';\n\nenforce.extend({ isEmail });\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare global {\n namespace n4s {\n interface EnforceCustomMatchers<R> {\n isEmail: EnforceCustomMatcher<typeof isEmail, R>;\n }\n }\n}\n"],"names":["enforce","extend","isEmail"],"mappings":"s3FAKAA,EAAAA,QAAQC,OAAO,CAAEC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.0.
|
|
2
|
+
"version": "5.0.17",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "./dist/cjs/n4s.js",
|
|
5
5
|
"types": "./types/n4s.d.ts",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"release": "vx release"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"context": "^3.0.
|
|
25
|
-
"vest-utils": "^1.2.
|
|
24
|
+
"context": "^3.0.23",
|
|
25
|
+
"vest-utils": "^1.2.7"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/validator": "^13.11.7",
|
|
29
|
-
"validator": "13.
|
|
29
|
+
"validator": "13.9.0"
|
|
30
30
|
},
|
|
31
31
|
"vxAllowResolve": [
|
|
32
32
|
"validator"
|