@unicom-cloud/utils 0.1.33 → 0.1.35
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/assert/index.js +41 -0
- package/assert.js +9 -0
- package/case-name/index.js +1 -1
- package/caseName.js +1 -1
- package/class-name/index.js +1 -1
- package/className.js +1 -1
- package/clipboard-copy/index.js +7 -7
- package/clipboardCopy.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/emoji.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/isMobile.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/constant.js +1 -1
- package/content-disposition/index.js +1 -1
- package/contentDisposition.js +1 -1
- package/cookie/index.js +1 -1
- package/cookie/src/api.js +1 -1
- package/cookie/src/assign.js +1 -1
- package/cookie/src/converter.js +1 -1
- package/cookie.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/date.js +1 -1
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/decimal.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/domHelpers.js +1 -1
- package/emitter/index.js +1 -1
- package/emitter/src/index.js +1 -1
- package/emitter.js +1 -1
- package/escape/index.js +1 -1
- package/escape.js +1 -1
- package/file/fileRead.js +55 -0
- package/file/fileToDataURL.js +9 -0
- package/file/index.js +5 -3
- package/file/saveAs.js +34 -29
- package/file.js +5 -3
- package/function/index.js +51 -0
- package/function.js +49 -0
- package/idb/index.js +1 -1
- package/idb.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/invariant.js +1 -1
- package/is/index.js +201 -198
- package/is/lib/isAscii.js +6 -6
- package/is/lib/isBase64.js +5 -5
- package/is/lib/isChinese.js +1 -1
- package/is/lib/isDataURI.js +11 -11
- package/is/lib/isEmail.js +25 -25
- package/is/lib/isFQDN.js +13 -7
- package/is/lib/isFullWidth.js +5 -5
- package/is/lib/isHSL.js +5 -5
- package/is/lib/isHalfWidth.js +5 -5
- package/is/lib/isHash.js +5 -5
- package/is/lib/isHexColor.js +7 -7
- package/is/lib/isIMEI.js +9 -8
- package/is/lib/isIP.js +12 -12
- package/is/lib/isIPRange.js +8 -8
- package/is/lib/isIdentityCard.js +12 -12
- package/is/lib/isJWT.js +9 -9
- package/is/lib/isMACAddress.js +6 -6
- package/is/lib/isMD5.js +4 -4
- package/is/lib/isMimeType.js +4 -4
- package/is/lib/isMobilePhone.js +3 -3
- package/is/lib/isPort.js +1 -1
- package/is/lib/isRgbColor.js +8 -8
- package/is/lib/isSemVer.js +5 -5
- package/is/lib/isSlug.js +6 -6
- package/is/lib/isStrongPassword.js +8 -8
- package/is/lib/isURL.js +32 -32
- package/is/lib/isUUID.js +5 -5
- package/is/lib/isVariableWidth.js +7 -7
- package/is.js +78 -76
- package/lunar/index.js +1 -1
- package/lunar/lib/Holiday.js +1 -1
- package/lunar/lib/HolidayUtil.js +1 -1
- package/lunar/lib/I18n.js +1 -1
- package/lunar/lib/JieQi.js +1 -1
- package/lunar/lib/Lunar.js +1 -1
- package/lunar/lib/LunarMonth.js +1 -1
- package/lunar/lib/LunarTime.js +1 -1
- package/lunar/lib/LunarUtil.js +1 -1
- package/lunar/lib/LunarYear.js +1 -1
- package/lunar/lib/ShouXingUtil.js +1 -1
- package/lunar/lib/Solar.js +1 -1
- package/lunar/lib/SolarHalfYear.js +1 -1
- package/lunar/lib/SolarMonth.js +1 -1
- package/lunar/lib/SolarSeason.js +1 -1
- package/lunar/lib/SolarUtil.js +1 -1
- package/lunar/lib/SolarWeek.js +1 -1
- package/lunar/lib/SolarYear.js +1 -1
- package/lunar/lib/index.js +1 -1
- package/lunar.js +1 -1
- package/math/index.js +1 -1
- package/math.js +1 -1
- package/md5/index.js +1 -1
- package/md5.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/mock.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/normalizeWheel.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/numberToChinese.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/nzh.js +1 -1
- package/object/index.js +18 -0
- package/object.js +8 -0
- package/package.json +1 -1
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/src/core.js +1 -1
- package/pinyin/src/simplified.js +1 -1
- package/pinyin/src/simplified_dict.js +1 -1
- package/pinyin/src/traditional.js +1 -1
- package/pinyin/src/traditional_dict.js +1 -1
- package/pinyin/traditional.js +1 -1
- package/pinyin.js +1 -1
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/queryString.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/random.js +1 -1
- package/screenfull/index.js +1 -1
- package/screenfull.js +1 -1
- package/sleep/index.js +1 -1
- package/sleep.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +1 -1
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +1 -1
- package/snapdom/src/core/clone.js +1 -1
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +1 -1
- package/snapdom/src/exporters/download.js +1 -1
- package/snapdom/src/exporters/toBlob.js +1 -1
- package/snapdom/src/exporters/toCanvas.js +1 -1
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +1 -1
- package/snapdom/src/modules/iconFonts.js +1 -1
- package/snapdom/src/modules/images.js +1 -1
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pseudo.js +1 -1
- package/snapdom/src/modules/rasterize.js +1 -1
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +1 -1
- package/snapdom/src/modules/svgDefs.js +1 -1
- package/snapdom/src/utils/browser.js +1 -1
- package/snapdom/src/utils/capture.helpers.js +1 -1
- package/snapdom/src/utils/clone.helpers.js +1 -1
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +1 -1
- package/snapdom/src/utils/prepare.helpers.js +1 -1
- package/snapdom/src/utils/transforms.helpers.js +1 -1
- package/snapdom.js +1 -1
- package/string/index.js +1 -1
- package/string.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/src/conversion.js +1 -1
- package/tinycolor/src/css-color-names.js +1 -1
- package/tinycolor/src/format-input.js +1 -1
- package/tinycolor/src/from-ratio.js +1 -1
- package/tinycolor/src/index.js +1 -1
- package/tinycolor/src/random.js +1 -1
- package/tinycolor/src/readability.js +1 -1
- package/tinycolor/src/to-ms-filter.js +1 -1
- package/tinycolor/src/utils.js +1 -1
- package/tinycolor.js +1 -1
- package/tree/index.js +1 -1
- package/tree/search/index.js +1 -1
- package/tree.js +1 -1
- package/tween/index.js +1 -1
- package/tween/src/easing.js +1 -1
- package/tween/src/tween.js +1 -1
- package/tween.js +1 -1
- package/types/assert/index.d.ts +8 -0
- package/types/clipboard-copy/index.d.ts +1 -1
- package/types/file/fileRead.d.ts +11 -0
- package/types/file/fileToDataURL.d.ts +3 -0
- package/types/file/index.d.ts +3 -2
- package/types/file/saveAs.d.ts +2 -1
- package/types/function/index.d.ts +2 -0
- package/types/is/index.d.ts +18 -16
- package/types/is/lib/isIP.d.ts +3 -1
- package/types/is/lib/isURL.d.ts +1 -1
- package/types/lodash/isPromise.d.ts +1 -1
- package/types/object/index.d.ts +5 -0
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/uiColor.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/url-toolkit/src/url-toolkit.js +1 -1
- package/urlToolkit.js +1 -1
- package/validate/index.js +1 -1
- package/validate/src/index.js +5 -4
- package/validate/src/locale/en-US.js +1 -1
- package/validate/src/locale/index.js +1 -1
- package/validate/src/locale/zh-CN.js +1 -1
- package/validate/src/rules/array.js +1 -1
- package/validate/src/rules/base.js +1 -1
- package/validate/src/rules/boolean.js +1 -1
- package/validate/src/rules/custom.js +1 -1
- package/validate/src/rules/number.js +1 -1
- package/validate/src/rules/object.js +1 -1
- package/validate/src/rules/string.js +1 -1
- package/validate/src/rules/type.js +1 -1
- package/validate.js +1 -1
- package/version/index.js +1 -1
- package/version.js +1 -1
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +2 -2
- package/xlsx.js +1 -1
- package/file/fileToURL.js +0 -25
- package/is/lib/util/assertString.js +0 -12
- package/object-keys-sort/index.js +0 -8
- package/object-prototype-to-string-call/index.js +0 -9
- package/objectKeysSort.js +0 -5
- package/objectPrototypeToStringCall.js +0 -6
- package/types/file/fileToURL.d.ts +0 -2
- package/types/is/lib/util/assertString.d.ts +0 -1
- package/types/object-keys-sort/index.d.ts +0 -4
- package/types/object-prototype-to-string-call/index.d.ts +0 -2
package/is/lib/isHSL.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import r from "
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import r from "../../assert/index.js";
|
|
3
3
|
const t = /^hsla?\(((\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?)%){2}(,((\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?)%?))?\)$/i, a = /^hsla?\(((\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?)%){2}\s?(\/\s((\+|-)?([0-9]+(\.[0-9]+)?(e(\+|-)?[0-9]+)?|\.[0-9]+(e(\+|-)?[0-9]+)?)%?)\s?)?\)$/i;
|
|
4
|
-
function
|
|
5
|
-
r(s);
|
|
4
|
+
function l(s) {
|
|
5
|
+
r({ value: s }, "isHSL");
|
|
6
6
|
const e = s.replace(/\s+/g, " ").replace(/\s?(hsla?\(|\)|,)\s?/gi, "$1");
|
|
7
7
|
return e.includes(",") ? t.test(e) : a.test(e);
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
l as default
|
|
11
11
|
};
|
package/is/lib/isHalfWidth.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import u from "../../assert/index.js";
|
|
3
|
+
const t = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;
|
|
4
4
|
function i(F) {
|
|
5
|
-
return
|
|
5
|
+
return u({ value: F }, "isHalfWidth"), t.test(F);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
i as default,
|
|
9
|
-
|
|
9
|
+
t as halfWidth
|
|
10
10
|
};
|
package/is/lib/isHash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import a from "../../assert/index.js";
|
|
3
|
+
const t = {
|
|
4
4
|
md5: 32,
|
|
5
5
|
md4: 32,
|
|
6
6
|
sha1: 40,
|
|
@@ -15,8 +15,8 @@ const r = {
|
|
|
15
15
|
crc32: 8,
|
|
16
16
|
crc32b: 8
|
|
17
17
|
};
|
|
18
|
-
function i(s,
|
|
19
|
-
return
|
|
18
|
+
function i(s, e) {
|
|
19
|
+
return a({ value: s }, "isHash"), new RegExp(`^[a-fA-F0-9]{${t[e]}}$`).test(s);
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
22
|
i as default
|
package/is/lib/isHexColor.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
import t from "
|
|
4
|
-
const s = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i,
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import r from "lodash/defaults";
|
|
3
|
+
import t from "../../assert/index.js";
|
|
4
|
+
const s = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i, l = /^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i, a = {
|
|
5
5
|
require_hashtag: !1
|
|
6
6
|
};
|
|
7
|
-
function
|
|
8
|
-
return t(
|
|
7
|
+
function h(o, e) {
|
|
8
|
+
return t({ value: o }, "isHexColor"), e = r(e, a), (e.require_hashtag ? l : s).test(o);
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
h as default
|
|
12
12
|
};
|
package/is/lib/isIMEI.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import a from "
|
|
3
|
-
const c = /^[0-9]{15}$/,
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import a from "../../assert/index.js";
|
|
3
|
+
const c = /^[0-9]{15}$/, o = /^\d{2}-\d{6}-\d{6}-\d{1}$/;
|
|
4
4
|
function m(e, s) {
|
|
5
|
-
a(e), s = s || {};
|
|
6
|
-
let
|
|
7
|
-
if (s.allow_hyphens && (
|
|
5
|
+
a({ value: e }, "isIMEI"), s = s || {};
|
|
6
|
+
let u = c;
|
|
7
|
+
if (s.allow_hyphens && (u = o), !u.test(e))
|
|
8
8
|
return !1;
|
|
9
9
|
e = e.replace(/-/g, "");
|
|
10
|
-
let n = 0, t = 2
|
|
10
|
+
let n = 0, t = 2;
|
|
11
|
+
const l = 14;
|
|
11
12
|
for (let i = 0; i < l; i++) {
|
|
12
|
-
const
|
|
13
|
+
const f = e.substring(l - i - 1, l - i), r = parseInt(f, 10) * t;
|
|
13
14
|
r >= 10 ? n += r % 10 + 1 : n += r, t === 1 ? t += 1 : t -= 1;
|
|
14
15
|
}
|
|
15
16
|
return (10 - n % 10) % 10 === parseInt(e.substring(14, 15), 10);
|
package/is/lib/isIP.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
`^((?:${
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import i from "lodash/isObject";
|
|
3
|
+
import a from "../../assert/index.js";
|
|
4
|
+
const s = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])", $ = `(${s}[.]){3}${s}`, m = new RegExp(`^${$}$`), e = "(?:[0-9a-fA-F]{1,4})", v = new RegExp(
|
|
5
|
+
`^((?:${e}:){7}(?:${e}|:)|(?:${e}:){6}(?:${$}|:${e}|:)|(?:${e}:){5}(?::${$}|(:${e}){1,2}|:)|(?:${e}:){4}(?:(:${e}){0,1}:${$}|(:${e}){1,3}|:)|(?:${e}:){3}(?:(:${e}){0,2}:${$}|(:${e}){1,4}|:)|(?:${e}:){2}(?:(:${e}){0,3}:${$}|(:${e}){1,5}|:)|(?:${e}:){1}(?:(:${e}){0,4}:${$}|(:${e}){1,6}|:)|(?::((?::${e}){0,5}:${$}|(?::${e}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`
|
|
6
6
|
);
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const r = (
|
|
7
|
+
function o(t, n = {}) {
|
|
8
|
+
a({ value: t }, "isIP");
|
|
9
|
+
const r = (i(n) ? n.version : arguments[1]) || "";
|
|
10
10
|
if (r) {
|
|
11
11
|
if (r.toString() === "4")
|
|
12
|
-
return
|
|
12
|
+
return m.test(t);
|
|
13
13
|
if (r.toString() === "6")
|
|
14
|
-
return
|
|
14
|
+
return v.test(t);
|
|
15
15
|
} else
|
|
16
|
-
return
|
|
16
|
+
return o(t, { version: 4 }) || o(t, { version: 6 });
|
|
17
17
|
return !1;
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
o as default
|
|
21
21
|
};
|
package/is/lib/isIPRange.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import l from "../../assert/index.js";
|
|
3
|
+
import a from "./isIP.js";
|
|
4
|
+
const u = /^\d{1,3}$/, r = 32, i = 128;
|
|
5
5
|
function b(s, n = "") {
|
|
6
|
-
l(s);
|
|
6
|
+
l({ value: s }, "isIPRange");
|
|
7
7
|
const t = s.split("/");
|
|
8
|
-
if (t.length !== 2 || !
|
|
8
|
+
if (t.length !== 2 || !u.test(t[1]) || t[1].length > 1 && t[1].startsWith("0") || !a(t[0], n))
|
|
9
9
|
return !1;
|
|
10
10
|
let e = null;
|
|
11
11
|
switch (String(n)) {
|
|
12
12
|
case "4":
|
|
13
|
-
e =
|
|
13
|
+
e = r;
|
|
14
14
|
break;
|
|
15
15
|
case "6":
|
|
16
16
|
e = i;
|
|
17
17
|
break;
|
|
18
18
|
default:
|
|
19
|
-
e =
|
|
19
|
+
e = a(t[0], "6") ? i : r;
|
|
20
20
|
}
|
|
21
21
|
return t[1] <= e && t[1] >= 0;
|
|
22
22
|
}
|
package/is/lib/isIdentityCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import A from "
|
|
3
|
-
const
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import A from "../../assert/index.js";
|
|
3
|
+
const d = {
|
|
4
4
|
"zh-CN": (t) => {
|
|
5
5
|
const u = [
|
|
6
6
|
"11",
|
|
@@ -101,7 +101,7 @@ const h = {
|
|
|
101
101
|
i += parseInt(r.charAt(a), 10) * parseInt(o[a], 10);
|
|
102
102
|
const l = i % 11;
|
|
103
103
|
return s[l];
|
|
104
|
-
},
|
|
104
|
+
}, h = (e) => f(e) === e.charAt(17).toUpperCase(), p = (e) => {
|
|
105
105
|
let r = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(
|
|
106
106
|
e
|
|
107
107
|
);
|
|
@@ -110,7 +110,7 @@ const h = {
|
|
|
110
110
|
if (r = c(i), !r) return !1;
|
|
111
111
|
const l = `19${e.substring(6, 12)}`;
|
|
112
112
|
return r = n(l), !!r;
|
|
113
|
-
},
|
|
113
|
+
}, g = (e) => {
|
|
114
114
|
let r = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(
|
|
115
115
|
e
|
|
116
116
|
);
|
|
@@ -118,9 +118,9 @@ const h = {
|
|
|
118
118
|
const i = e.substring(0, 2);
|
|
119
119
|
if (r = c(i), !r) return !1;
|
|
120
120
|
const l = e.substring(6, 14);
|
|
121
|
-
return r = n(l), r ?
|
|
121
|
+
return r = n(l), r ? h(e) : !1;
|
|
122
122
|
};
|
|
123
|
-
return ((e) => /^\d{15}|(\d{17}(\d|x|X))$/.test(e) ? e.length === 15 ?
|
|
123
|
+
return ((e) => /^\d{15}|(\d{17}(\d|x|X))$/.test(e) ? e.length === 15 ? p(e) : g(e) : !1)(t);
|
|
124
124
|
},
|
|
125
125
|
"zh-HK": (t) => {
|
|
126
126
|
t = t.trim();
|
|
@@ -175,11 +175,11 @@ const h = {
|
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
177
|
function I(t, u) {
|
|
178
|
-
if (A(t), u in
|
|
179
|
-
return
|
|
180
|
-
for (const o in
|
|
181
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
182
|
-
const s =
|
|
178
|
+
if (A({ value: t }, "isIdentityCard"), u in d)
|
|
179
|
+
return d[u](t);
|
|
180
|
+
for (const o in d)
|
|
181
|
+
if (Object.prototype.hasOwnProperty.call(d, o)) {
|
|
182
|
+
const s = d[o];
|
|
183
183
|
if (s(t))
|
|
184
184
|
return !0;
|
|
185
185
|
}
|
package/is/lib/isJWT.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import i from "
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
(r,
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import i from "../../assert/index.js";
|
|
3
|
+
import l from "./isBase64.js";
|
|
4
|
+
function a(e) {
|
|
5
|
+
i({ value: e }, "isJWT");
|
|
6
|
+
const t = e.split(".");
|
|
7
|
+
return t.length !== 3 ? !1 : t.reduce(
|
|
8
|
+
(r, s) => r && l(s, { urlSafe: !0 }),
|
|
9
9
|
!0
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
a as default
|
|
14
14
|
};
|
package/is/lib/isMACAddress.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import f from "../../assert/index.js";
|
|
3
|
+
const r = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/, s = /^([0-9a-fA-F]){12}$/, u = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/, d = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/, t = /^([0-9a-fA-F]){16}$/, c = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;
|
|
4
|
+
function A(e, a) {
|
|
5
|
+
return f({ value: e }, "isMACAddress"), a?.eui && (a.eui = String(a.eui)), a?.no_colons || a?.no_separators ? a.eui === "48" ? s.test(e) : a.eui === "64" ? t.test(e) : s.test(e) || t.test(e) : a?.eui === "48" ? r.test(e) || u.test(e) : a?.eui === "64" ? d.test(e) || c.test(e) : A(e, { eui: "48" }) || A(e, { eui: "64" });
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
A as default
|
|
9
9
|
};
|
package/is/lib/isMD5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import e from "../../assert/index.js";
|
|
3
|
+
const s = /^[a-f0-9]{32}$/;
|
|
4
4
|
function o(t) {
|
|
5
|
-
return
|
|
5
|
+
return e({ value: t }, "isMD5"), s.test(t);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
o as default
|
package/is/lib/isMimeType.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import t from "../../assert/index.js";
|
|
3
3
|
const a = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9.\-+_]{1,100}$/i, i = /^text\/[a-zA-Z0-9.\-+]{1,100};\s?charset=("[a-zA-Z0-9.\-+\s]{0,70}"|[a-zA-Z0-9.\-+]{0,70})(\s?\([a-zA-Z0-9.\-+\s]{1,20}\))?$/i, s = /^multipart\/[a-zA-Z0-9.\-+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9.\-+\s]{0,70}"|[a-zA-Z0-9.\-+]{0,70})(\s?\([a-zA-Z0-9.\-+\s]{1,20}\))?){0,2}$/i;
|
|
4
|
-
function o(
|
|
5
|
-
return e
|
|
4
|
+
function o(e) {
|
|
5
|
+
return t({ value: e }, "isMimeType"), a.test(e) || i.test(e) || s.test(e);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
o as default
|
package/is/lib/isMobilePhone.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import t from "
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import t from "../../assert/index.js";
|
|
3
3
|
const d = {
|
|
4
4
|
"am-AM": /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,
|
|
5
5
|
"ar-AE": /^((\+?971)|0)?5[024568]\d{7}$/,
|
|
@@ -171,7 +171,7 @@ d["ga-IE"] = d["en-IE"];
|
|
|
171
171
|
d["fr-CH"] = d["de-CH"];
|
|
172
172
|
d["it-CH"] = d["fr-CH"];
|
|
173
173
|
function f(e, $, n) {
|
|
174
|
-
if (t(e), n && n.strictMode && !e.startsWith("+"))
|
|
174
|
+
if (t({ value: e }, "isMobilePhone"), n && n.strictMode && !e.startsWith("+"))
|
|
175
175
|
return !1;
|
|
176
176
|
if (Array.isArray($))
|
|
177
177
|
return $.some((s) => !!(Object.prototype.hasOwnProperty.call(d, s) && d[s].test(e)));
|
package/is/lib/isPort.js
CHANGED
package/is/lib/isRgbColor.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import c from "lodash/isObject";
|
|
3
3
|
import a from "lodash/isUndefined";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import n from "../../assert/index.js";
|
|
5
|
+
const o = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/, s = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/, g = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/, u = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/, i = /^rgba?/;
|
|
6
6
|
function m(e, t) {
|
|
7
|
-
|
|
7
|
+
n({ value: e }, "isRgbColor");
|
|
8
8
|
let l = !1, r = !0;
|
|
9
|
-
if (
|
|
10
|
-
if (!
|
|
9
|
+
if (c(t) ? (l = a(t.allowSpaces) ? l : t.allowSpaces, r = a(t.includePercentValues) ? r : t.includePercentValues) : arguments.length >= 2 && (r = arguments[1]), l) {
|
|
10
|
+
if (!i.test(e))
|
|
11
11
|
return !1;
|
|
12
12
|
e = e.replace(/\s/g, "");
|
|
13
13
|
}
|
|
14
|
-
return r ?
|
|
14
|
+
return r ? o.test(e) || s.test(e) || g.test(e) || u.test(e) : o.test(e) || s.test(e);
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
m as default
|
package/is/lib/isSemVer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import i from "
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import i from "../../assert/index.js";
|
|
3
3
|
const r = a(
|
|
4
4
|
[
|
|
5
5
|
"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)",
|
|
@@ -12,9 +12,9 @@ function a(e, n) {
|
|
|
12
12
|
const t = e.join("");
|
|
13
13
|
return new RegExp(t, n);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return i(e), r.test(e);
|
|
15
|
+
function o(e) {
|
|
16
|
+
return i({ value: e }, "isSemVer"), r.test(e);
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
o as default
|
|
20
20
|
};
|
package/is/lib/isSlug.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return s
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import e from "../../assert/index.js";
|
|
3
|
+
const t = /^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;
|
|
4
|
+
function r(s) {
|
|
5
|
+
return e({ value: s }, "isSlug"), t.test(s);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
r as default
|
|
9
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
2
|
import r from "lodash/defaults";
|
|
3
|
-
import u from "
|
|
4
|
-
const s = /^[A-Z]$/, i = /^[a-z]$/, m = /^[0-9]$/,
|
|
3
|
+
import u from "../../assert/index.js";
|
|
4
|
+
const s = /^[A-Z]$/, i = /^[a-z]$/, m = /^[0-9]$/, a = /^[-#!$@£%^&*()_+|~=`{}[\]:";'<>?,./\\ ]$/, l = {
|
|
5
5
|
minLength: 8,
|
|
6
6
|
minLowercase: 1,
|
|
7
7
|
minUppercase: 1,
|
|
@@ -15,14 +15,14 @@ const s = /^[A-Z]$/, i = /^[a-z]$/, m = /^[0-9]$/, l = /^[-#!$@£%^&*()_+|~=`{}[
|
|
|
15
15
|
pointsForContainingNumber: 10,
|
|
16
16
|
pointsForContainingSymbol: 10
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function C(t) {
|
|
19
19
|
const e = {};
|
|
20
20
|
return Array.from(t).forEach((n) => {
|
|
21
21
|
e[n] ? e[n] += 1 : e[n] = 1;
|
|
22
22
|
}), e;
|
|
23
23
|
}
|
|
24
24
|
function p(t) {
|
|
25
|
-
const e =
|
|
25
|
+
const e = C(t), n = {
|
|
26
26
|
length: t.length,
|
|
27
27
|
uniqueChars: Object.keys(e).length,
|
|
28
28
|
uppercaseCount: 0,
|
|
@@ -31,7 +31,7 @@ function p(t) {
|
|
|
31
31
|
symbolCount: 0
|
|
32
32
|
};
|
|
33
33
|
return Object.keys(e).forEach((o) => {
|
|
34
|
-
s.test(o) ? n.uppercaseCount += e[o] : i.test(o) ? n.lowercaseCount += e[o] : m.test(o) ? n.numberCount += e[o] :
|
|
34
|
+
s.test(o) ? n.uppercaseCount += e[o] : i.test(o) ? n.lowercaseCount += e[o] : m.test(o) ? n.numberCount += e[o] : a.test(o) && (n.symbolCount += e[o]);
|
|
35
35
|
}), n;
|
|
36
36
|
}
|
|
37
37
|
function c(t, e) {
|
|
@@ -39,9 +39,9 @@ function c(t, e) {
|
|
|
39
39
|
return n += t.uniqueChars * e.pointsPerUnique, n += (t.length - t.uniqueChars) * e.pointsPerRepeat, t.lowercaseCount > 0 && (n += e.pointsForContainingLower), t.uppercaseCount > 0 && (n += e.pointsForContainingUpper), t.numberCount > 0 && (n += e.pointsForContainingNumber), t.symbolCount > 0 && (n += e.pointsForContainingSymbol), n;
|
|
40
40
|
}
|
|
41
41
|
function g(t, e = null) {
|
|
42
|
-
u(t);
|
|
42
|
+
u({ value: t }, "isStrongPassword");
|
|
43
43
|
const n = p(t);
|
|
44
|
-
return e = r(e || {},
|
|
44
|
+
return e = r(e || {}, l), e.returnScore ? c(n, e) : n.length >= e.minLength && n.lowercaseCount >= e.minLowercase && n.uppercaseCount >= e.minUppercase && n.numberCount >= e.minNumbers && n.symbolCount >= e.minSymbols;
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
47
|
g as default
|
package/is/lib/isURL.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
2
|
import k from "lodash/defaults";
|
|
3
|
-
import z from "
|
|
3
|
+
import z from "../../assert/index.js";
|
|
4
|
+
import L from "./isFQDN.js";
|
|
4
5
|
import v from "./isIP.js";
|
|
5
|
-
|
|
6
|
-
const $ = {
|
|
6
|
+
const O = {
|
|
7
7
|
protocols: ["http", "https", "ftp"],
|
|
8
8
|
require_tld: !0,
|
|
9
9
|
require_protocol: !1,
|
|
@@ -17,62 +17,62 @@ const $ = {
|
|
|
17
17
|
allow_query_components: !0,
|
|
18
18
|
validate_length: !0,
|
|
19
19
|
max_allowed_length: 2084
|
|
20
|
-
},
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
20
|
+
}, U = /^\[([^\]]+)\](?::([0-9]+))?$/;
|
|
21
|
+
function P(e, l) {
|
|
22
|
+
if (z({ value: e }, "isURL"), !e || /[\s<>]/.test(e) || e.indexOf("mailto:") === 0 || (l = k(l, O), l.validate_length && e.length > l.max_allowed_length) || !l.allow_fragments && e.includes("#") || !l.allow_query_components && (e.includes("?") || e.includes("&")))
|
|
23
23
|
return !1;
|
|
24
|
-
let d, f, r,
|
|
25
|
-
|
|
26
|
-
const
|
|
24
|
+
let d, f, r, n, _, i, t, o;
|
|
25
|
+
t = e.split("#"), e = t.shift(), t = e.split("?"), e = t.shift();
|
|
26
|
+
const u = e.match(/^([a-z][a-z0-9+\-.]*):/i);
|
|
27
27
|
let g = !1;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
28
|
+
const c = (s) => (g = !0, d = s.toLowerCase(), l.require_valid_protocol && !l.protocols.includes(d) ? !1 : e.substring(u[0].length));
|
|
29
|
+
if (u) {
|
|
30
|
+
const s = u[1], a = e.substring(u[0].length);
|
|
31
31
|
if (a.slice(0, 2) === "//") {
|
|
32
|
-
if (e =
|
|
32
|
+
if (e = c(s), e === !1)
|
|
33
33
|
return !1;
|
|
34
34
|
} else {
|
|
35
35
|
const m = a.indexOf("/"), w = m === -1 ? a : a.substring(0, m), q = w.indexOf("@");
|
|
36
36
|
if (q !== -1) {
|
|
37
37
|
const p = w.substring(0, q), x = /^[a-zA-Z0-9\-_.%:]*$/.test(p), b = /%[0-9a-fA-F]{2}/.test(p);
|
|
38
38
|
if (x && !b) {
|
|
39
|
-
if (
|
|
39
|
+
if (l.require_protocol)
|
|
40
40
|
return !1;
|
|
41
|
-
} else if (e =
|
|
41
|
+
} else if (e = c(s), e === !1)
|
|
42
42
|
return !1;
|
|
43
43
|
} else if (/^[0-9]/.test(a)) {
|
|
44
|
-
if (
|
|
44
|
+
if (l.require_protocol)
|
|
45
45
|
return !1;
|
|
46
|
-
} else if (e =
|
|
46
|
+
} else if (e = c(s), e === !1)
|
|
47
47
|
return !1;
|
|
48
48
|
}
|
|
49
|
-
} else if (
|
|
49
|
+
} else if (l.require_protocol)
|
|
50
50
|
return !1;
|
|
51
51
|
if (e.slice(0, 2) === "//") {
|
|
52
|
-
if (!g && !
|
|
52
|
+
if (!g && !l.allow_protocol_relative_urls)
|
|
53
53
|
return !1;
|
|
54
54
|
e = e.slice(2);
|
|
55
55
|
}
|
|
56
56
|
if (e === "")
|
|
57
57
|
return !1;
|
|
58
|
-
if (
|
|
58
|
+
if (t = e.split("/"), e = t.shift(), e === "" && !l.require_host)
|
|
59
59
|
return !0;
|
|
60
|
-
if (
|
|
61
|
-
if (
|
|
60
|
+
if (t = e.split("@"), t.length > 1) {
|
|
61
|
+
if (l.disallow_auth || t[0] === "" || (f = t.shift(), f.includes(":") && f.split(":").length > 2))
|
|
62
62
|
return !1;
|
|
63
|
-
const [
|
|
64
|
-
if (
|
|
63
|
+
const [s, a] = f.split(":");
|
|
64
|
+
if (s === "" && a === "")
|
|
65
65
|
return !1;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
const h =
|
|
69
|
-
if (h ? (r = "", o = h[1],
|
|
70
|
-
if (
|
|
67
|
+
n = t.join("@"), i = null, o = null;
|
|
68
|
+
const h = n.match(U);
|
|
69
|
+
if (h ? (r = "", o = h[1], i = h[2] || null) : (t = n.split(":"), r = t.shift(), t.length && (i = t.join(":"))), i !== null && i.length > 0) {
|
|
70
|
+
if (_ = parseInt(i, 10), !/^[0-9]+$/.test(i) || _ <= 0 || _ > 65535)
|
|
71
71
|
return !1;
|
|
72
|
-
} else if (
|
|
72
|
+
} else if (l.require_port)
|
|
73
73
|
return !1;
|
|
74
|
-
return r === "" && !
|
|
74
|
+
return r === "" && !l.require_host ? !0 : !v(r) && !L(r, l) && (!o || !v(o, 6)) ? !1 : (r = r || o, !0);
|
|
75
75
|
}
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
P as default
|
|
78
78
|
};
|
package/is/lib/isUUID.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
2
|
import i from "lodash/isNil";
|
|
3
|
-
import a from "
|
|
3
|
+
import a from "../../assert/index.js";
|
|
4
4
|
const F = {
|
|
5
5
|
1: /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
6
6
|
2: /^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
@@ -16,9 +16,9 @@ const F = {
|
|
|
16
16
|
// From https://github.com/uuidjs/uuid/blob/main/src/regex.js
|
|
17
17
|
all: /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
return a(A), i(f) && (f = "all"), f in F ? F[f].test(A) : !1;
|
|
19
|
+
function t(A, f) {
|
|
20
|
+
return a({ value: A }, "isUUID"), i(f) && (f = "all"), f in F ? F[f].test(A) : !1;
|
|
21
21
|
}
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
t as default
|
|
24
24
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
return
|
|
1
|
+
/* 2025-12-22 09:15:24 */
|
|
2
|
+
import i from "../../assert/index.js";
|
|
3
|
+
import { fullWidth as r } from "./isFullWidth.js";
|
|
4
|
+
import { halfWidth as a } from "./isHalfWidth.js";
|
|
5
|
+
function l(t) {
|
|
6
|
+
return i({ value: t }, "isVariableWidth"), r.test(t) && a.test(t);
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
l as default
|
|
10
10
|
};
|