toolbox-x 2.4.2 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/{basics-CiT7tnu_.cjs → basics-CUzK7wFN.cjs} +1 -1
- package/dist/{basics-9MqP9Ecm.mjs → basics-KYRpMQNe.mjs} +1 -1
- package/dist/{constants-ByLTHWQm.mjs → constants-B6yqsqJ5.mjs} +2 -2
- package/dist/{constants-DIBRCBIP.cjs → constants-BUJG8exj.cjs} +2 -2
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/converter/index.cjs +1 -1
- package/dist/converter/index.mjs +1 -1
- package/dist/date/index.cjs +4 -5
- package/dist/date/index.mjs +4 -5
- package/dist/dom/index.cjs +3 -3
- package/dist/dom/index.mjs +3 -3
- package/dist/guards/index.cjs +3 -3
- package/dist/guards/index.mjs +3 -3
- package/dist/{guards-DBunDnng.mjs → guards-CyOZsZ1r.mjs} +1 -1
- package/dist/{guards-BD2Fkugj.cjs → guards-DalSfIxV.cjs} +1 -1
- package/dist/hash/index.cjs +2 -2
- package/dist/hash/index.mjs +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/paginator.cjs +1 -1
- package/dist/paginator.mjs +1 -1
- package/dist/{parse-CILDG7TG.mjs → parse-CsTFudDu.mjs} +3 -3
- package/dist/{parse-CffWYCuy.cjs → parse-Dz186-PH.cjs} +3 -3
- package/dist/{query-Cp1dq-qU.mjs → query-B8VPCIKA.mjs} +2 -2
- package/dist/{query-lGVoAJl3.cjs → query-iJflCkq1.cjs} +2 -2
- package/dist/{utils-C4yOIzOJ.cjs → utils-BxZGABHS.cjs} +11 -10
- package/dist/{utils-C0NzTJMR.mjs → utils-DcRr0A7B.mjs} +11 -10
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to **toolbox-x** will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
> Auto-generated from git history using [changelog-maker](https://github.com/nodejs/changelog-maker).
|
|
6
6
|
|
|
7
|
+
## [v2.4.4](https://github.com/nazmul-nhb/toolbox-x/releases/tag/v2.4.4) — 2026-06-28
|
|
8
|
+
|
|
9
|
+
[Compare changes](https://github.com/nazmul-nhb/toolbox-x/compare/v2.4.2...v2.4.4)
|
|
10
|
+
|
|
11
|
+
* \[[`5565185e11`](https://github.com/nazmul-nhb/toolbox-x/commit/5565185e11)] - 🧼 refactor(date): all conversion into `Date` object is now immutable (Nazmul Hassan)
|
|
12
|
+
* \[[`592d976acc`](https://github.com/nazmul-nhb/toolbox-x/commit/592d976acc)] - 🛠️ chore: updated editor config and deps (Nazmul Hassan)
|
|
13
|
+
* \[[`a3b28009a8`](https://github.com/nazmul-nhb/toolbox-x/commit/a3b28009a8)] - 🔧 update(docs): updated docs for `addDate` (Nazmul Hassan)
|
|
14
|
+
* \[[`0f6476e6b0`](https://github.com/nazmul-nhb/toolbox-x/commit/0f6476e6b0)] - 🔧 update(package.json): added more keywords (Nazmul Hassan)
|
|
15
|
+
* \[[`d1c6ff4282`](https://github.com/nazmul-nhb/toolbox-x/commit/d1c6ff4282)] - 🔧 update(docs): updated docs for natural sort utility (Nazmul Hassan)
|
|
16
|
+
* \[[`56a8e690d5`](https://github.com/nazmul-nhb/toolbox-x/commit/56a8e690d5)] - 📚 docs: updated CHANGELOG.md for v2.4.2 (github-actions\[bot])
|
|
17
|
+
|
|
7
18
|
## [v2.4.2](https://github.com/nazmul-nhb/toolbox-x/releases/tag/v2.4.2) — 2026-06-17
|
|
8
19
|
|
|
9
20
|
[Compare changes](https://github.com/nazmul-nhb/toolbox-x/compare/v2.4.1...v2.4.2)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
18
|
-
const require_utils = require('./utils-
|
|
18
|
+
const require_utils = require('./utils-BxZGABHS.cjs');
|
|
19
19
|
const require_specials = require('./specials-DU8u108m.cjs');
|
|
20
20
|
const require_utilities = require('./utilities-_COSGq1U.cjs');
|
|
21
21
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { d as isString, m as isUndefined } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import { $ as trimString, m as stableStringify } from "./utils-
|
|
18
|
+
import { $ as trimString, m as stableStringify } from "./utils-DcRr0A7B.mjs";
|
|
19
19
|
import { b as isFunction, w as isNotEmptyObject } from "./specials-krf7zsqI.mjs";
|
|
20
20
|
import { a as normalizeNumber } from "./utilities-CmPwOkdy.mjs";
|
|
21
21
|
|
|
@@ -123,12 +123,12 @@ const IRREGULAR_PLURALS = /* @__PURE__ */ Object.freeze({
|
|
|
123
123
|
millennium: "millennia",
|
|
124
124
|
century: "centuries"
|
|
125
125
|
});
|
|
126
|
-
const INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(new Set([
|
|
126
|
+
const INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ new Set([
|
|
127
127
|
"celsius",
|
|
128
128
|
"fahrenheit",
|
|
129
129
|
"kelvin"
|
|
130
130
|
]));
|
|
131
|
-
const Y_TO_IES = /* @__PURE__ */ Object.freeze(new Set(["century"]));
|
|
131
|
+
const Y_TO_IES = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ new Set(["century"]));
|
|
132
132
|
|
|
133
133
|
//#endregion
|
|
134
134
|
export { Y_TO_IES as i, IRREGULAR_PLURALS as n, UNITS as r, INVARIANT_UNITS as t };
|
|
@@ -124,12 +124,12 @@ const IRREGULAR_PLURALS = /* @__PURE__ */ Object.freeze({
|
|
|
124
124
|
millennium: "millennia",
|
|
125
125
|
century: "centuries"
|
|
126
126
|
});
|
|
127
|
-
const INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(new Set([
|
|
127
|
+
const INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ new Set([
|
|
128
128
|
"celsius",
|
|
129
129
|
"fahrenheit",
|
|
130
130
|
"kelvin"
|
|
131
131
|
]));
|
|
132
|
-
const Y_TO_IES = /* @__PURE__ */ Object.freeze(new Set(["century"]));
|
|
132
|
+
const Y_TO_IES = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ new Set(["century"]));
|
|
133
133
|
|
|
134
134
|
//#endregion
|
|
135
135
|
Object.defineProperty(exports, 'INVARIANT_UNITS', {
|
package/dist/constants.cjs
CHANGED
|
@@ -21,7 +21,7 @@ const require_timezone = require('./timezone-CSz7R0L6.cjs');
|
|
|
21
21
|
const require_constants$2 = require('./constants-BOs8tjzp.cjs');
|
|
22
22
|
const require_css_colors = require('./css-colors-DC7oZ46Y.cjs');
|
|
23
23
|
const require_constants$3 = require('./constants-B3nc8psr.cjs');
|
|
24
|
-
const require_constants$4 = require('./constants-
|
|
24
|
+
const require_constants$4 = require('./constants-BUJG8exj.cjs');
|
|
25
25
|
const require_countries = require('./countries-C0x58zVg.cjs');
|
|
26
26
|
const require_constants$5 = require('./constants-ZnFGKd7G.cjs');
|
|
27
27
|
|
package/dist/constants.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { a as TIME_ZONE_IDS, i as TIME_ZONES_NATIVE, n as NATIVE_TZ_IDS, o as TI
|
|
|
20
20
|
import { n as NUMBER_COLOR_PALETTE, t as ALPHABET_COLOR_PALETTE } from "./constants-DCZL77t-.mjs";
|
|
21
21
|
import { t as CSS_COLORS } from "./css-colors-B-y4TmeC.mjs";
|
|
22
22
|
import { a as LOCALE_CODES, i as FRANKFURTER_CURRENCIES, n as CURRENCY_CODES, p as UNITS$1, r as CURRENCY_LOCALES } from "./constants-ZyfpysiQ.mjs";
|
|
23
|
-
import { r as UNITS } from "./constants-
|
|
23
|
+
import { r as UNITS } from "./constants-B6yqsqJ5.mjs";
|
|
24
24
|
import { t as COUNTRIES } from "./countries-CMxHxKiK.mjs";
|
|
25
25
|
import { t as HTTP_STATUS_CODES } from "./constants-BLAcLxOu.mjs";
|
|
26
26
|
|
package/dist/converter/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
|
-
const require_constants = require('../constants-
|
|
18
|
+
const require_constants = require('../constants-BUJG8exj.cjs');
|
|
19
19
|
|
|
20
20
|
//#region src/converter/base.ts
|
|
21
21
|
/**
|
package/dist/converter/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { i as Y_TO_IES, n as IRREGULAR_PLURALS, r as UNITS, t as INVARIANT_UNITS } from "../constants-
|
|
17
|
+
import { i as Y_TO_IES, n as IRREGULAR_PLURALS, r as UNITS, t as INVARIANT_UNITS } from "../constants-B6yqsqJ5.mjs";
|
|
18
18
|
|
|
19
19
|
//#region src/converter/base.ts
|
|
20
20
|
/**
|
package/dist/date/index.cjs
CHANGED
|
@@ -20,8 +20,8 @@ const require_constants = require('../constants-CgFaV72Z.cjs');
|
|
|
20
20
|
const require_timezone = require('../timezone-CSz7R0L6.cjs');
|
|
21
21
|
const require_specials = require('../specials-DU8u108m.cjs');
|
|
22
22
|
const require_utilities = require('../utilities-_COSGq1U.cjs');
|
|
23
|
-
const require_guards = require('../guards-
|
|
24
|
-
const require_parse = require('../parse-
|
|
23
|
+
const require_guards = require('../guards-DalSfIxV.cjs');
|
|
24
|
+
const require_parse = require('../parse-Dz186-PH.cjs');
|
|
25
25
|
|
|
26
26
|
//#region src/date/calculation.ts
|
|
27
27
|
/**
|
|
@@ -47,9 +47,8 @@ const require_parse = require('../parse-CffWYCuy.cjs');
|
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
function addDate(date, units) {
|
|
50
|
-
const
|
|
51
|
-
if (Number.isNaN(
|
|
52
|
-
const expected = new Date($date);
|
|
50
|
+
const expected = require_parse._dateArgsToDate(date);
|
|
51
|
+
if (Number.isNaN(expected.getTime())) throw new TypeError("Provided date is invalid!");
|
|
53
52
|
for (const [unit, value] of Object.entries(units)) {
|
|
54
53
|
const val = require_utilities.normalizeNumber(value);
|
|
55
54
|
if (!require_specials.isObjectWithKeys(require_constants.DATE_UNIT_SETTERS, [unit]) || !require_primitives.isNumber(val)) throw new TypeError(`Provided unit or value is invalid!`);
|
package/dist/date/index.mjs
CHANGED
|
@@ -19,8 +19,8 @@ import { a as RELATIVE_TIME_DIVISIONS, t as DATE_UNIT_SETTERS } from "../constan
|
|
|
19
19
|
import { n as NATIVE_TZ_IDS } from "../timezone-avZ4TvDx.mjs";
|
|
20
20
|
import { E as isObjectWithKeys, T as isObject } from "../specials-krf7zsqI.mjs";
|
|
21
21
|
import { a as normalizeNumber } from "../utilities-CmPwOkdy.mjs";
|
|
22
|
-
import { a as isValidTime, s as isValidUTCOffset } from "../guards-
|
|
23
|
-
import { a as _normalizeOffset, i as _gmtToUtcOffset, n as _dateArgsToDate, o as _resolveNativeTzName, r as _formatDate, t as parseMSec } from "../parse-
|
|
22
|
+
import { a as isValidTime, s as isValidUTCOffset } from "../guards-CyOZsZ1r.mjs";
|
|
23
|
+
import { a as _normalizeOffset, i as _gmtToUtcOffset, n as _dateArgsToDate, o as _resolveNativeTzName, r as _formatDate, t as parseMSec } from "../parse-CsTFudDu.mjs";
|
|
24
24
|
|
|
25
25
|
//#region src/date/calculation.ts
|
|
26
26
|
/**
|
|
@@ -46,9 +46,8 @@ import { a as _normalizeOffset, i as _gmtToUtcOffset, n as _dateArgsToDate, o as
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
function addDate(date, units) {
|
|
49
|
-
const
|
|
50
|
-
if (Number.isNaN(
|
|
51
|
-
const expected = new Date($date);
|
|
49
|
+
const expected = _dateArgsToDate(date);
|
|
50
|
+
if (Number.isNaN(expected.getTime())) throw new TypeError("Provided date is invalid!");
|
|
52
51
|
for (const [unit, value] of Object.entries(units)) {
|
|
53
52
|
const val = normalizeNumber(value);
|
|
54
53
|
if (!isObjectWithKeys(DATE_UNIT_SETTERS, [unit]) || !isNumber(val)) throw new TypeError(`Provided unit or value is invalid!`);
|
package/dist/dom/index.cjs
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_primitives = require('../primitives-CBGICrDR.cjs');
|
|
19
|
-
const require_utils = require('../utils-
|
|
19
|
+
const require_utils = require('../utils-BxZGABHS.cjs');
|
|
20
20
|
const require_specials = require('../specials-DU8u108m.cjs');
|
|
21
|
-
const require_guards = require('../guards-
|
|
22
|
-
const require_query = require('../query-
|
|
21
|
+
const require_guards = require('../guards-DalSfIxV.cjs');
|
|
22
|
+
const require_query = require('../query-iJflCkq1.cjs');
|
|
23
23
|
|
|
24
24
|
//#region src/dom/storage.ts
|
|
25
25
|
/**
|
package/dist/dom/index.mjs
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString, d as isString } from "../primitives-Djsevc69.mjs";
|
|
18
|
-
import { $ as trimString } from "../utils-
|
|
18
|
+
import { $ as trimString } from "../utils-DcRr0A7B.mjs";
|
|
19
19
|
import { j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "../specials-krf7zsqI.mjs";
|
|
20
|
-
import { t as isDateLike } from "../guards-
|
|
21
|
-
import { C as isValidFormData, S as isOriginFileObj, _ as isCustomFileArray, a as updateQueryParam, b as isFileOrBlob, g as isCustomFile, i as parseQueryStringLiteral, m as parseObjectValues, n as getQueryParams, r as parseQueryString, t as generateQueryParams, v as isFileArray, x as isFileUpload, y as isFileList } from "../query-
|
|
20
|
+
import { t as isDateLike } from "../guards-CyOZsZ1r.mjs";
|
|
21
|
+
import { C as isValidFormData, S as isOriginFileObj, _ as isCustomFileArray, a as updateQueryParam, b as isFileOrBlob, g as isCustomFile, i as parseQueryStringLiteral, m as parseObjectValues, n as getQueryParams, r as parseQueryString, t as generateQueryParams, v as isFileArray, x as isFileUpload, y as isFileList } from "../query-B8VPCIKA.mjs";
|
|
22
22
|
|
|
23
23
|
//#region src/dom/storage.ts
|
|
24
24
|
/**
|
package/dist/guards/index.cjs
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_primitives = require('../primitives-CBGICrDR.cjs');
|
|
19
|
-
const require_utils = require('../utils-
|
|
19
|
+
const require_utils = require('../utils-BxZGABHS.cjs');
|
|
20
20
|
const require_specials = require('../specials-DU8u108m.cjs');
|
|
21
|
-
const require_basics = require('../basics-
|
|
21
|
+
const require_basics = require('../basics-CUzK7wFN.cjs');
|
|
22
22
|
const require_guards = require('../guards-CrfVwk0-.cjs');
|
|
23
|
-
const require_guards$1 = require('../guards-
|
|
23
|
+
const require_guards$1 = require('../guards-DalSfIxV.cjs');
|
|
24
24
|
|
|
25
25
|
exports.areInvalidNumbers = require_basics.areInvalidNumbers;
|
|
26
26
|
exports.areNumbersInvalid = require_basics.areInvalidNumbers;
|
package/dist/guards/index.mjs
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString, c as isNumber, d as isString, f as isSymbol, i as isInteger, l as isPositiveInteger, m as isUndefined, n as isBoolean, o as isNormalPrimitive, p as isTruthy, r as isFalsy, s as isNull, t as isBigInt, u as isPrimitive } from "../primitives-Djsevc69.mjs";
|
|
18
|
-
import { C as isUUIDv2, D as isUUIDv6, E as isUUIDv5, O as isUUIDv7, S as isUUIDv1, T as isUUIDv4, f as isDeepEqual, k as isUUIDv8, w as isUUIDv3 } from "../utils-
|
|
18
|
+
import { C as isUUIDv2, D as isUUIDv6, E as isUUIDv5, O as isUUIDv7, S as isUUIDv1, T as isUUIDv4, f as isDeepEqual, k as isUUIDv8, w as isUUIDv3 } from "../utils-DcRr0A7B.mjs";
|
|
19
19
|
import { A as isSet, C as isMethodDescriptor, D as isPromise, E as isObjectWithKeys, O as isRegExp, S as isMap, T as isObject, _ as isDate, a as isEmail, b as isFunction, c as isHexString, d as isNumericString, f as isPhoneNumber, g as isArrayOfType, h as isArray, i as isDateString, j as isValidArray, k as isReturningPromise, l as isIPAddress, m as isUUID, n as isBinaryString, o as isEmailArray, p as isURL, r as isBrowser, s as isEnvironment, t as isBase64, u as isNode, v as isEmptyObject, w as isNotEmptyObject, x as isJSON, y as isError } from "../specials-krf7zsqI.mjs";
|
|
20
|
-
import { C as isOdd, S as isMultiple, b as isEven, d as isCamelCase, f as isEmojiOnly, g as isSnakeCase, h as isPascalCase, i as isInvalidOrEmptyArray, m as isPalindrome, p as isKebabCase, v as isPrime, w as isPerfectSquare, x as isFibonacci, y as areInvalidNumbers } from "../basics-
|
|
20
|
+
import { C as isOdd, S as isMultiple, b as isEven, d as isCamelCase, f as isEmojiOnly, g as isSnakeCase, h as isPascalCase, i as isInvalidOrEmptyArray, m as isPalindrome, p as isKebabCase, v as isPrime, w as isPerfectSquare, x as isFibonacci, y as areInvalidNumbers } from "../basics-KYRpMQNe.mjs";
|
|
21
21
|
import { a as isHex8, i as isHex6, n as isHSL, o as isRGB, r as isHSLA, s as isRGBA, t as isCSSColor } from "../guards-CNG9gnvL.mjs";
|
|
22
|
-
import { a as isValidTime, i as isTimeWithUnit, n as isLeapYear, o as isValidTimeZoneId, r as isNativeTimeZoneId, s as isValidUTCOffset, t as isDateLike } from "../guards-
|
|
22
|
+
import { a as isValidTime, i as isTimeWithUnit, n as isLeapYear, o as isValidTimeZoneId, r as isNativeTimeZoneId, s as isValidUTCOffset, t as isDateLike } from "../guards-CyOZsZ1r.mjs";
|
|
23
23
|
|
|
24
24
|
export { areInvalidNumbers, areInvalidNumbers as areNumbersInvalid, areInvalidNumbers as isInvalidNumber, areInvalidNumbers as isNumberInvalid, isReturningPromise as doesReturnPromise, isReturningPromise, isArray, isArrayOfType, isValidArray as isArrayWithLength, isValidArray, isBase64, isBigInt, isBinaryString, isBoolean, isBrowser, isCSSColor, isCamelCase, isDate, isDateLike, isDateString, isDeepEqual, isEmail, isEmail as isValidEmail, isEmailArray, isEmojiOnly, isEmptyObject, isEmptyObject as isObjectEmpty, isEnvironment, isEnvironment as isExpectedNodeENV, isEnvironment as isNodeENV, isEnvironment as isNodeEnvironment, isError, isEven, isEven as isEvenNumber, isFalsy, isFibonacci, isFibonacci as isPartOfFibonacci, isFibonacci as isPartOfFibonacciSeries, isFunction, isHSL, isHSLA, isHex6, isHex8, isHexString, isIPAddress, isInteger, isInvalidOrEmptyArray, isJSON, isJSON as isValidJSON, isKebabCase, isLeapYear, isMap, isMethodDescriptor as isMethod, isMethodDescriptor, isMultiple, isMultiple as isMultipleOf, isNativeTimeZoneId, isNode, isNonEmptyString, isNormalPrimitive, isNotEmptyObject, isNotEmptyObject as isValidObject, isNull, isNumber, isNumericString, isObject, isObjectWithKeys, isOdd, isOdd as isOddNumber, isPalindrome, isPascalCase, isPerfectSquare, isPhoneNumber, isPositiveInteger, isPrime, isPrime as isPrimeNumber, isPrimitive, isPromise, isRGB, isRGBA, isRegExp, isRegExp as isRegularExpression, isSet, isSnakeCase, isString, isSymbol, isTimeWithUnit, isTruthy, isURL, isURL as isValidURL, isUUID, isUUIDv1, isUUIDv2, isUUIDv3, isUUIDv4, isUUIDv5, isUUIDv6, isUUIDv7, isUUIDv8, isUndefined, isValidTime, isValidTime as isValidTimeString, isValidTimeZoneId, isValidUTCOffset as isValidUTC, isValidUTCOffset };
|
|
@@ -54,7 +54,7 @@ function isValidUTCOffset(value) {
|
|
|
54
54
|
* @returns `true` if the value is a valid IANA time zone identifier, otherwise `false`.
|
|
55
55
|
*/
|
|
56
56
|
function isValidTimeZoneId(value) {
|
|
57
|
-
return isNonEmptyString(value) ? new Set([...IANA_TZ_IDS]).has(value) : false;
|
|
57
|
+
return isNonEmptyString(value) ? (/* @__PURE__ */ new Set([...IANA_TZ_IDS])).has(value) : false;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* * Validates whether the provided value is a supported time zone identifier using the native JavaScript API (`Intl.supportedValuesOf('timeZone')`).
|
|
@@ -54,7 +54,7 @@ function isValidUTCOffset(value) {
|
|
|
54
54
|
* @returns `true` if the value is a valid IANA time zone identifier, otherwise `false`.
|
|
55
55
|
*/
|
|
56
56
|
function isValidTimeZoneId(value) {
|
|
57
|
-
return require_primitives.isNonEmptyString(value) ? new Set([...require_timezone.IANA_TZ_IDS]).has(value) : false;
|
|
57
|
+
return require_primitives.isNonEmptyString(value) ? (/* @__PURE__ */ new Set([...require_timezone.IANA_TZ_IDS])).has(value) : false;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* * Validates whether the provided value is a supported time zone identifier using the native JavaScript API (`Intl.supportedValuesOf('timeZone')`).
|
package/dist/hash/index.cjs
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
18
18
|
const require_primitives = require('../primitives-CBGICrDR.cjs');
|
|
19
|
-
const require_utils = require('../utils-
|
|
19
|
+
const require_utils = require('../utils-BxZGABHS.cjs');
|
|
20
20
|
const require_specials = require('../specials-DU8u108m.cjs');
|
|
21
|
-
const require_parse = require('../parse-
|
|
21
|
+
const require_parse = require('../parse-Dz186-PH.cjs');
|
|
22
22
|
|
|
23
23
|
//#region src/hash/Cipher.ts
|
|
24
24
|
/**
|
package/dist/hash/index.mjs
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { a as isNonEmptyString } from "../primitives-Djsevc69.mjs";
|
|
18
|
-
import { A as uuid, B as bytesToUtf8, C as isUUIDv2, D as isUUIDv6, E as isUUIDv5, F as _padStartWith0, G as randomAlphaNumeric, H as hexToBytes, I as _splitByCharLength, J as randomNumeric, K as randomBytes, L as base64ToBytes, M as sha1, N as sha256, O as isUUIDv7, P as _constantTimeEquals, Q as generateRandomID, R as bytesToBase64, S as isUUIDv1, T as isUUIDv4, U as hmacSha256, V as concatBytes, W as intTo4BytesBE, X as uint8To32ArrayBE, Y as sha256Bytes, Z as utf8ToBytes, h as stripJsonEdgeGarbage, j as md5, k as isUUIDv8, m as stableStringify, q as randomHex, w as isUUIDv3, x as decodeUUID, z as bytesToHex } from "../utils-
|
|
18
|
+
import { A as uuid, B as bytesToUtf8, C as isUUIDv2, D as isUUIDv6, E as isUUIDv5, F as _padStartWith0, G as randomAlphaNumeric, H as hexToBytes, I as _splitByCharLength, J as randomNumeric, K as randomBytes, L as base64ToBytes, M as sha1, N as sha256, O as isUUIDv7, P as _constantTimeEquals, Q as generateRandomID, R as bytesToBase64, S as isUUIDv1, T as isUUIDv4, U as hmacSha256, V as concatBytes, W as intTo4BytesBE, X as uint8To32ArrayBE, Y as sha256Bytes, Z as utf8ToBytes, h as stripJsonEdgeGarbage, j as md5, k as isUUIDv8, m as stableStringify, q as randomHex, w as isUUIDv3, x as decodeUUID, z as bytesToHex } from "../utils-DcRr0A7B.mjs";
|
|
19
19
|
import { c as isHexString, m as isUUID, n as isBinaryString, t as isBase64, w as isNotEmptyObject } from "../specials-krf7zsqI.mjs";
|
|
20
|
-
import { c as _toSeconds, s as _secToDate, t as parseMSec } from "../parse-
|
|
20
|
+
import { c as _toSeconds, s as _secToDate, t as parseMSec } from "../parse-CsTFudDu.mjs";
|
|
21
21
|
|
|
22
22
|
//#region src/hash/Cipher.ts
|
|
23
23
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -19,11 +19,11 @@ const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
|
19
19
|
const require_case = require('./case-Bd7QLHYw.cjs');
|
|
20
20
|
const require_constants = require('./constants-B3nc8psr.cjs');
|
|
21
21
|
const require_countries = require('./countries-C0x58zVg.cjs');
|
|
22
|
-
const require_utils = require('./utils-
|
|
22
|
+
const require_utils = require('./utils-BxZGABHS.cjs');
|
|
23
23
|
const require_specials = require('./specials-DU8u108m.cjs');
|
|
24
|
-
const require_basics = require('./basics-
|
|
24
|
+
const require_basics = require('./basics-CUzK7wFN.cjs');
|
|
25
25
|
const require_utilities = require('./utilities-_COSGq1U.cjs');
|
|
26
|
-
const require_query = require('./query-
|
|
26
|
+
const require_query = require('./query-iJflCkq1.cjs');
|
|
27
27
|
|
|
28
28
|
//#region src/string/anagram.ts
|
|
29
29
|
/** `WeakMap` to cache user provided dictionary array */
|
|
@@ -529,7 +529,7 @@ function getFactors(int) {
|
|
|
529
529
|
const num = require_utilities.normalizeNumber(int);
|
|
530
530
|
if (!require_primitives.isNumber(num) || num <= 0 || !Number.isInteger(num)) return [];
|
|
531
531
|
if (num === 1) return [1];
|
|
532
|
-
const factors = new Set([1, num]);
|
|
532
|
+
const factors = /* @__PURE__ */ new Set([1, num]);
|
|
533
533
|
const sqrt = Math.floor(Math.sqrt(num));
|
|
534
534
|
for (let i = 2; i <= sqrt; i++) if (num % i === 0) {
|
|
535
535
|
factors.add(i);
|
|
@@ -1255,7 +1255,7 @@ function getFibonacciSeriesMemo(limit) {
|
|
|
1255
1255
|
const cLimit = Number(limit);
|
|
1256
1256
|
if (!Number.isFinite(cLimit) || cLimit <= 0) return [];
|
|
1257
1257
|
if (cLimit === 1) return [0];
|
|
1258
|
-
const memo = new Map([[0, 0], [1, 1]]);
|
|
1258
|
+
const memo = /* @__PURE__ */ new Map([[0, 0], [1, 1]]);
|
|
1259
1259
|
const fib = (n) => {
|
|
1260
1260
|
if (memo.has(n)) return memo.get(n);
|
|
1261
1261
|
const val = fib(n - 1) + fib(n - 2);
|
package/dist/index.mjs
CHANGED
|
@@ -18,11 +18,11 @@ import { a as isNonEmptyString, c as isNumber, d as isString, i as isInteger, m
|
|
|
18
18
|
import { n as convertStringCase, t as capitalizeString } from "./case-DBC4Rj0h.mjs";
|
|
19
19
|
import { c as ORDINAL_UNDER_TEEN, d as TENS, f as THOUSANDS, l as PREFIX_MULTIPLIERS, o as ONES, s as ORDINAL_TO_CARDINAL, t as BN_DIGITS, u as TEENS } from "./constants-ZyfpysiQ.mjs";
|
|
20
20
|
import { t as COUNTRIES } from "./countries-CMxHxKiK.mjs";
|
|
21
|
-
import { $ as trimString, Q as generateRandomID, _ as naturalSort, a as deepParsePrimitives, b as _resolveNestedKey, c as getInstanceGetterNames, d as getStaticMethodNames, et as truncateString, f as isDeepEqual, g as throttleAction, h as stripJsonEdgeGarbage, i as debounceAction, l as getInstanceMethodNames, m as stableStringify, n as countInstanceMethods, o as definePrototypeMethod, p as parseJSON, r as countStaticMethods, s as getClassDetails, t as convertArrayToString, u as getStaticGetterNames, v as sortAnArray, y as _getNumericProp } from "./utils-
|
|
21
|
+
import { $ as trimString, Q as generateRandomID, _ as naturalSort, a as deepParsePrimitives, b as _resolveNestedKey, c as getInstanceGetterNames, d as getStaticMethodNames, et as truncateString, f as isDeepEqual, g as throttleAction, h as stripJsonEdgeGarbage, i as debounceAction, l as getInstanceMethodNames, m as stableStringify, n as countInstanceMethods, o as definePrototypeMethod, p as parseJSON, r as countStaticMethods, s as getClassDetails, t as convertArrayToString, u as getStaticGetterNames, v as sortAnArray, y as _getNumericProp } from "./utils-DcRr0A7B.mjs";
|
|
22
22
|
import { T as isObject, b as isFunction, d as isNumericString, j as isValidArray } from "./specials-krf7zsqI.mjs";
|
|
23
|
-
import { A as replaceAllInString, C as isOdd, D as formatUnitWithPlural, E as extractURLs, M as slugifyString, O as maskString, T as extractEmails, _ as findPrimeNumbers, a as shuffleArray, b as isEven, c as extractObjectEntries, i as isInvalidOrEmptyArray, j as reverseString, k as normalizeString, l as extractObjectKeys, n as flattenArray, o as cloneObject, r as getLastArrayElement, s as countObjectFields, t as filterArrayOfObjects, u as extractObjectKeysDeep, v as isPrime, y as areInvalidNumbers } from "./basics-
|
|
23
|
+
import { A as replaceAllInString, C as isOdd, D as formatUnitWithPlural, E as extractURLs, M as slugifyString, O as maskString, T as extractEmails, _ as findPrimeNumbers, a as shuffleArray, b as isEven, c as extractObjectEntries, i as isInvalidOrEmptyArray, j as reverseString, k as normalizeString, l as extractObjectKeys, n as flattenArray, o as cloneObject, r as getLastArrayElement, s as countObjectFields, t as filterArrayOfObjects, u as extractObjectKeysDeep, v as isPrime, y as areInvalidNumbers } from "./basics-KYRpMQNe.mjs";
|
|
24
24
|
import { a as normalizeNumber, i as getRandomFloat, n as formatCurrency, o as roundToNearest, r as getOrdinal, t as clampNumber } from "./utilities-CmPwOkdy.mjs";
|
|
25
|
-
import { c as extractUpdatedFields, d as mergeAndFlattenObjects, f as mergeObjects, h as sanitizeData, i as parseQueryStringLiteral, l as flattenObjectDotNotation, m as parseObjectValues, o as extractNewFields, p as parseJsonToObject, r as parseQueryString, s as extractUpdatedAndNewFields, t as generateQueryParams, u as flattenObjectKeyValue } from "./query-
|
|
25
|
+
import { c as extractUpdatedFields, d as mergeAndFlattenObjects, f as mergeObjects, h as sanitizeData, i as parseQueryStringLiteral, l as flattenObjectDotNotation, m as parseObjectValues, o as extractNewFields, p as parseJsonToObject, r as parseQueryString, s as extractUpdatedAndNewFields, t as generateQueryParams, u as flattenObjectKeyValue } from "./query-B8VPCIKA.mjs";
|
|
26
26
|
|
|
27
27
|
//#region src/string/anagram.ts
|
|
28
28
|
/** `WeakMap` to cache user provided dictionary array */
|
|
@@ -528,7 +528,7 @@ function getFactors(int) {
|
|
|
528
528
|
const num = normalizeNumber(int);
|
|
529
529
|
if (!isNumber(num) || num <= 0 || !Number.isInteger(num)) return [];
|
|
530
530
|
if (num === 1) return [1];
|
|
531
|
-
const factors = new Set([1, num]);
|
|
531
|
+
const factors = /* @__PURE__ */ new Set([1, num]);
|
|
532
532
|
const sqrt = Math.floor(Math.sqrt(num));
|
|
533
533
|
for (let i = 2; i <= sqrt; i++) if (num % i === 0) {
|
|
534
534
|
factors.add(i);
|
|
@@ -1254,7 +1254,7 @@ function getFibonacciSeriesMemo(limit) {
|
|
|
1254
1254
|
const cLimit = Number(limit);
|
|
1255
1255
|
if (!Number.isFinite(cLimit) || cLimit <= 0) return [];
|
|
1256
1256
|
if (cLimit === 1) return [0];
|
|
1257
|
-
const memo = new Map([[0, 0], [1, 1]]);
|
|
1257
|
+
const memo = /* @__PURE__ */ new Map([[0, 0], [1, 1]]);
|
|
1258
1258
|
const fib = (n) => {
|
|
1259
1259
|
if (memo.has(n)) return memo.get(n);
|
|
1260
1260
|
const val = fib(n - 1) + fib(n - 2);
|
package/dist/paginator.cjs
CHANGED
|
@@ -197,7 +197,7 @@ var Paginator = class Paginator {
|
|
|
197
197
|
const startPages = _getRange(1, edgeCount);
|
|
198
198
|
const middlePages = _getRange(start, end);
|
|
199
199
|
const endPages = _getRange(total - edgeCount + 1, total);
|
|
200
|
-
const pages = new Set([
|
|
200
|
+
const pages = /* @__PURE__ */ new Set([
|
|
201
201
|
...startPages,
|
|
202
202
|
...middlePages,
|
|
203
203
|
...endPages
|
package/dist/paginator.mjs
CHANGED
|
@@ -195,7 +195,7 @@ var Paginator = class Paginator {
|
|
|
195
195
|
const startPages = _getRange(1, edgeCount);
|
|
196
196
|
const middlePages = _getRange(start, end);
|
|
197
197
|
const endPages = _getRange(total - edgeCount + 1, total);
|
|
198
|
-
const pages = new Set([
|
|
198
|
+
const pages = /* @__PURE__ */ new Set([
|
|
199
199
|
...startPages,
|
|
200
200
|
...middlePages,
|
|
201
201
|
...endPages
|
|
@@ -18,7 +18,7 @@ import { a as isNonEmptyString, c as isNumber, d as isString } from "./primitive
|
|
|
18
18
|
import { i as MS_MAP, n as DAYS, o as SORTED_TIME_FORMATS, r as MONTHS } from "./constants-GZL_CT1W.mjs";
|
|
19
19
|
import { d as isNumericString } from "./specials-krf7zsqI.mjs";
|
|
20
20
|
import { r as getOrdinal } from "./utilities-CmPwOkdy.mjs";
|
|
21
|
-
import { i as isTimeWithUnit } from "./guards-
|
|
21
|
+
import { i as isTimeWithUnit } from "./guards-CyOZsZ1r.mjs";
|
|
22
22
|
|
|
23
23
|
//#region src/date/helpers.ts
|
|
24
24
|
/** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
|
|
@@ -113,7 +113,7 @@ function _padZero(value, length = 2) {
|
|
|
113
113
|
return String(value).padStart(length, "0");
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* Convert a string, number, or `Date` object to a `Date` object.
|
|
116
|
+
* Convert a string, number, or `Date` object to a new `Date` object.
|
|
117
117
|
* - If the input is already a `Date`, it is returned as is.
|
|
118
118
|
* - If it's a string, it is parsed into a `Date`.
|
|
119
119
|
* - If it's a number, it is treated as a timestamp and converted to a `Date`.
|
|
@@ -121,7 +121,7 @@ function _padZero(value, length = 2) {
|
|
|
121
121
|
* @returns A `Date` object representing the input date.
|
|
122
122
|
*/
|
|
123
123
|
function _dateArgsToDate(value) {
|
|
124
|
-
return value instanceof Date ? value :
|
|
124
|
+
return new Date(value instanceof Date ? value : isString(value) ? value.replace(/['"]/g, "") : value ?? Date.now());
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
//#endregion
|
|
@@ -18,7 +18,7 @@ const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
|
18
18
|
const require_constants = require('./constants-CgFaV72Z.cjs');
|
|
19
19
|
const require_specials = require('./specials-DU8u108m.cjs');
|
|
20
20
|
const require_utilities = require('./utilities-_COSGq1U.cjs');
|
|
21
|
-
const require_guards = require('./guards-
|
|
21
|
+
const require_guards = require('./guards-DalSfIxV.cjs');
|
|
22
22
|
|
|
23
23
|
//#region src/date/helpers.ts
|
|
24
24
|
/** Core formatting logic shared by `formatDate` and `Chronos`, `BanglaCalendar` classes */
|
|
@@ -113,7 +113,7 @@ function _padZero(value, length = 2) {
|
|
|
113
113
|
return String(value).padStart(length, "0");
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* Convert a string, number, or `Date` object to a `Date` object.
|
|
116
|
+
* Convert a string, number, or `Date` object to a new `Date` object.
|
|
117
117
|
* - If the input is already a `Date`, it is returned as is.
|
|
118
118
|
* - If it's a string, it is parsed into a `Date`.
|
|
119
119
|
* - If it's a number, it is treated as a timestamp and converted to a `Date`.
|
|
@@ -121,7 +121,7 @@ function _padZero(value, length = 2) {
|
|
|
121
121
|
* @returns A `Date` object representing the input date.
|
|
122
122
|
*/
|
|
123
123
|
function _dateArgsToDate(value) {
|
|
124
|
-
return value instanceof Date ? value :
|
|
124
|
+
return new Date(value instanceof Date ? value : require_primitives.isString(value) ? value.replace(/['"]/g, "") : value ?? Date.now());
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
//#endregion
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { d as isString } from "./primitives-Djsevc69.mjs";
|
|
18
|
-
import { $ as trimString, a as deepParsePrimitives, f as isDeepEqual } from "./utils-
|
|
18
|
+
import { $ as trimString, a as deepParsePrimitives, f as isDeepEqual } from "./utils-DcRr0A7B.mjs";
|
|
19
19
|
import { E as isObjectWithKeys, T as isObject, g as isArrayOfType, j as isValidArray, v as isEmptyObject, w as isNotEmptyObject } from "./specials-krf7zsqI.mjs";
|
|
20
|
-
import { t as isDateLike } from "./guards-
|
|
20
|
+
import { t as isDateLike } from "./guards-CyOZsZ1r.mjs";
|
|
21
21
|
|
|
22
22
|
//#region src/form/guards.ts
|
|
23
23
|
/**
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
18
|
-
const require_utils = require('./utils-
|
|
18
|
+
const require_utils = require('./utils-BxZGABHS.cjs');
|
|
19
19
|
const require_specials = require('./specials-DU8u108m.cjs');
|
|
20
|
-
const require_guards = require('./guards-
|
|
20
|
+
const require_guards = require('./guards-DalSfIxV.cjs');
|
|
21
21
|
|
|
22
22
|
//#region src/form/guards.ts
|
|
23
23
|
/**
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
const require_primitives = require('./primitives-CBGICrDR.cjs');
|
|
18
18
|
const require_specials = require('./specials-DU8u108m.cjs');
|
|
19
19
|
const require_utilities = require('./utilities-_COSGq1U.cjs');
|
|
20
|
-
const require_guards = require('./guards-
|
|
20
|
+
const require_guards = require('./guards-DalSfIxV.cjs');
|
|
21
21
|
|
|
22
22
|
//#region src/string/basics.ts
|
|
23
23
|
/**
|
|
@@ -145,7 +145,7 @@ function trimString(input) {
|
|
|
145
145
|
* - If `size` is 0 or negative, an empty `Uint8Array` is returned.
|
|
146
146
|
*/
|
|
147
147
|
function randomBytes(size = 8) {
|
|
148
|
-
if (size <= 0) return new Uint8Array(0);
|
|
148
|
+
if (size <= 0) return /* @__PURE__ */ new Uint8Array(0);
|
|
149
149
|
return _fillWithRandomValues(new Uint8Array(size));
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
@@ -578,7 +578,7 @@ function sha256Bytes(message) {
|
|
|
578
578
|
const lenView = new DataView(padding.buffer);
|
|
579
579
|
lenView.setUint32(padding.length - 8, Math.floor(ml / 4294967296), false);
|
|
580
580
|
lenView.setUint32(padding.length - 4, ml & 4294967295, false);
|
|
581
|
-
const w = new Uint32Array(64);
|
|
581
|
+
const w = /* @__PURE__ */ new Uint32Array(64);
|
|
582
582
|
const chunkView = new DataView(padding.buffer);
|
|
583
583
|
for (let offset = 0; offset < padding.length; offset += 64) {
|
|
584
584
|
for (let t = 0; t < 16; t++) w[t] = chunkView.getUint32(offset + t * 4, false);
|
|
@@ -618,7 +618,7 @@ function sha256Bytes(message) {
|
|
|
618
618
|
H[6] = H[6] + g >>> 0;
|
|
619
619
|
H[7] = H[7] + h >>> 0;
|
|
620
620
|
}
|
|
621
|
-
const out = new Uint8Array(32);
|
|
621
|
+
const out = /* @__PURE__ */ new Uint8Array(32);
|
|
622
622
|
const outView = new DataView(out.buffer);
|
|
623
623
|
for (let i = 0; i < 8; i++) outView.setUint32(i * 4, H[i], false);
|
|
624
624
|
return out;
|
|
@@ -757,7 +757,7 @@ function uint8To32ArrayBE(bytes) {
|
|
|
757
757
|
* @see {@link uint8To32ArrayBE} for bytes to 32-bit integers conversion
|
|
758
758
|
*/
|
|
759
759
|
function intTo4BytesBE(n) {
|
|
760
|
-
const b = new Uint8Array(4);
|
|
760
|
+
const b = /* @__PURE__ */ new Uint8Array(4);
|
|
761
761
|
b[0] = n >>> 24 & 255;
|
|
762
762
|
b[1] = n >>> 16 & 255;
|
|
763
763
|
b[2] = n >>> 8 & 255;
|
|
@@ -847,7 +847,7 @@ function bytesToHex(bytes) {
|
|
|
847
847
|
* @see {@link bytesToHex} for the reverse process
|
|
848
848
|
*/
|
|
849
849
|
function hexToBytes(hex) {
|
|
850
|
-
if (!require_specials.isHexString(hex)) return new Uint8Array();
|
|
850
|
+
if (!require_specials.isHexString(hex)) return /* @__PURE__ */ new Uint8Array();
|
|
851
851
|
const bytes = _splitByCharLength(hex, 2).map((h) => parseInt(h, 16));
|
|
852
852
|
return new Uint8Array(bytes);
|
|
853
853
|
}
|
|
@@ -1163,7 +1163,7 @@ function sha1(msg) {
|
|
|
1163
1163
|
271733878,
|
|
1164
1164
|
3285377520
|
|
1165
1165
|
];
|
|
1166
|
-
const W = new Uint32Array(80);
|
|
1166
|
+
const W = /* @__PURE__ */ new Uint32Array(80);
|
|
1167
1167
|
for (let i = 0; i < words.length; i += 16) {
|
|
1168
1168
|
for (let j = 0; j < 16; j++) W[j] = words[i + j] | 0;
|
|
1169
1169
|
for (let j = 16; j < 80; j++) W[j] = rotl(W[j - 3] ^ W[j - 8] ^ W[j - 14] ^ W[j - 16], 1);
|
|
@@ -1292,7 +1292,7 @@ function uuid(options) {
|
|
|
1292
1292
|
case "v3":
|
|
1293
1293
|
if (_isOptionV3V5(options)) return _formatUUID(md5(options.namespace + options.name), 3, uppercase);
|
|
1294
1294
|
throw new Error("v3 requires valid namespace (uuid) and name!");
|
|
1295
|
-
case "v4": return _formatUUID(_bytesToRandomHex(new Uint8Array(16)), 4, uppercase);
|
|
1295
|
+
case "v4": return _formatUUID(_bytesToRandomHex(/* @__PURE__ */ new Uint8Array(16)), 4, uppercase);
|
|
1296
1296
|
case "v5":
|
|
1297
1297
|
if (_isOptionV3V5(options)) return _formatUUID(sha1(options.namespace + options.name).slice(0, 32), 5, uppercase);
|
|
1298
1298
|
throw new Error("v5 requires valid namespace (uuid) and name!");
|
|
@@ -1306,7 +1306,7 @@ function uuid(options) {
|
|
|
1306
1306
|
case "v7": return _formatUUID(Date.now().toString(16).padStart(12, "0") + randomHex(20), 7, uppercase);
|
|
1307
1307
|
case "v8": {
|
|
1308
1308
|
const ts = BigInt(Date.now());
|
|
1309
|
-
const bytes = new Uint8Array(16);
|
|
1309
|
+
const bytes = /* @__PURE__ */ new Uint8Array(16);
|
|
1310
1310
|
let temp = ts;
|
|
1311
1311
|
for (let i = 5; i >= 0; i--) {
|
|
1312
1312
|
bytes[i] = Number(temp & 255n);
|
|
@@ -1671,7 +1671,8 @@ function getInstanceGetterNames(cls) {
|
|
|
1671
1671
|
* @returns A sorted array of static getter names.
|
|
1672
1672
|
*/
|
|
1673
1673
|
function getStaticGetterNames(cls) {
|
|
1674
|
-
|
|
1674
|
+
const descriptors = Object.getOwnPropertyDescriptors(cls);
|
|
1675
|
+
return sortAnArray(Object.entries(descriptors).filter(([key, desc]) => typeof desc.get === "function" && key !== "prototype").map(([key]) => key));
|
|
1675
1676
|
}
|
|
1676
1677
|
/**
|
|
1677
1678
|
* * Gathers detailed information about the instance and static methods of a class.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { a as isNonEmptyString, c as isNumber, d as isString, m as isUndefined, n as isBoolean, u as isPrimitive } from "./primitives-Djsevc69.mjs";
|
|
18
18
|
import { C as isMethodDescriptor, E as isObjectWithKeys, T as isObject, b as isFunction, c as isHexString, d as isNumericString, g as isArrayOfType, h as isArray, j as isValidArray, m as isUUID, w as isNotEmptyObject } from "./specials-krf7zsqI.mjs";
|
|
19
19
|
import { a as normalizeNumber } from "./utilities-CmPwOkdy.mjs";
|
|
20
|
-
import { t as isDateLike } from "./guards-
|
|
20
|
+
import { t as isDateLike } from "./guards-CyOZsZ1r.mjs";
|
|
21
21
|
|
|
22
22
|
//#region src/string/basics.ts
|
|
23
23
|
/**
|
|
@@ -145,7 +145,7 @@ function trimString(input) {
|
|
|
145
145
|
* - If `size` is 0 or negative, an empty `Uint8Array` is returned.
|
|
146
146
|
*/
|
|
147
147
|
function randomBytes(size = 8) {
|
|
148
|
-
if (size <= 0) return new Uint8Array(0);
|
|
148
|
+
if (size <= 0) return /* @__PURE__ */ new Uint8Array(0);
|
|
149
149
|
return _fillWithRandomValues(new Uint8Array(size));
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
@@ -578,7 +578,7 @@ function sha256Bytes(message) {
|
|
|
578
578
|
const lenView = new DataView(padding.buffer);
|
|
579
579
|
lenView.setUint32(padding.length - 8, Math.floor(ml / 4294967296), false);
|
|
580
580
|
lenView.setUint32(padding.length - 4, ml & 4294967295, false);
|
|
581
|
-
const w = new Uint32Array(64);
|
|
581
|
+
const w = /* @__PURE__ */ new Uint32Array(64);
|
|
582
582
|
const chunkView = new DataView(padding.buffer);
|
|
583
583
|
for (let offset = 0; offset < padding.length; offset += 64) {
|
|
584
584
|
for (let t = 0; t < 16; t++) w[t] = chunkView.getUint32(offset + t * 4, false);
|
|
@@ -618,7 +618,7 @@ function sha256Bytes(message) {
|
|
|
618
618
|
H[6] = H[6] + g >>> 0;
|
|
619
619
|
H[7] = H[7] + h >>> 0;
|
|
620
620
|
}
|
|
621
|
-
const out = new Uint8Array(32);
|
|
621
|
+
const out = /* @__PURE__ */ new Uint8Array(32);
|
|
622
622
|
const outView = new DataView(out.buffer);
|
|
623
623
|
for (let i = 0; i < 8; i++) outView.setUint32(i * 4, H[i], false);
|
|
624
624
|
return out;
|
|
@@ -757,7 +757,7 @@ function uint8To32ArrayBE(bytes) {
|
|
|
757
757
|
* @see {@link uint8To32ArrayBE} for bytes to 32-bit integers conversion
|
|
758
758
|
*/
|
|
759
759
|
function intTo4BytesBE(n) {
|
|
760
|
-
const b = new Uint8Array(4);
|
|
760
|
+
const b = /* @__PURE__ */ new Uint8Array(4);
|
|
761
761
|
b[0] = n >>> 24 & 255;
|
|
762
762
|
b[1] = n >>> 16 & 255;
|
|
763
763
|
b[2] = n >>> 8 & 255;
|
|
@@ -847,7 +847,7 @@ function bytesToHex(bytes) {
|
|
|
847
847
|
* @see {@link bytesToHex} for the reverse process
|
|
848
848
|
*/
|
|
849
849
|
function hexToBytes(hex) {
|
|
850
|
-
if (!isHexString(hex)) return new Uint8Array();
|
|
850
|
+
if (!isHexString(hex)) return /* @__PURE__ */ new Uint8Array();
|
|
851
851
|
const bytes = _splitByCharLength(hex, 2).map((h) => parseInt(h, 16));
|
|
852
852
|
return new Uint8Array(bytes);
|
|
853
853
|
}
|
|
@@ -1163,7 +1163,7 @@ function sha1(msg) {
|
|
|
1163
1163
|
271733878,
|
|
1164
1164
|
3285377520
|
|
1165
1165
|
];
|
|
1166
|
-
const W = new Uint32Array(80);
|
|
1166
|
+
const W = /* @__PURE__ */ new Uint32Array(80);
|
|
1167
1167
|
for (let i = 0; i < words.length; i += 16) {
|
|
1168
1168
|
for (let j = 0; j < 16; j++) W[j] = words[i + j] | 0;
|
|
1169
1169
|
for (let j = 16; j < 80; j++) W[j] = rotl(W[j - 3] ^ W[j - 8] ^ W[j - 14] ^ W[j - 16], 1);
|
|
@@ -1292,7 +1292,7 @@ function uuid(options) {
|
|
|
1292
1292
|
case "v3":
|
|
1293
1293
|
if (_isOptionV3V5(options)) return _formatUUID(md5(options.namespace + options.name), 3, uppercase);
|
|
1294
1294
|
throw new Error("v3 requires valid namespace (uuid) and name!");
|
|
1295
|
-
case "v4": return _formatUUID(_bytesToRandomHex(new Uint8Array(16)), 4, uppercase);
|
|
1295
|
+
case "v4": return _formatUUID(_bytesToRandomHex(/* @__PURE__ */ new Uint8Array(16)), 4, uppercase);
|
|
1296
1296
|
case "v5":
|
|
1297
1297
|
if (_isOptionV3V5(options)) return _formatUUID(sha1(options.namespace + options.name).slice(0, 32), 5, uppercase);
|
|
1298
1298
|
throw new Error("v5 requires valid namespace (uuid) and name!");
|
|
@@ -1306,7 +1306,7 @@ function uuid(options) {
|
|
|
1306
1306
|
case "v7": return _formatUUID(Date.now().toString(16).padStart(12, "0") + randomHex(20), 7, uppercase);
|
|
1307
1307
|
case "v8": {
|
|
1308
1308
|
const ts = BigInt(Date.now());
|
|
1309
|
-
const bytes = new Uint8Array(16);
|
|
1309
|
+
const bytes = /* @__PURE__ */ new Uint8Array(16);
|
|
1310
1310
|
let temp = ts;
|
|
1311
1311
|
for (let i = 5; i >= 0; i--) {
|
|
1312
1312
|
bytes[i] = Number(temp & 255n);
|
|
@@ -1671,7 +1671,8 @@ function getInstanceGetterNames(cls) {
|
|
|
1671
1671
|
* @returns A sorted array of static getter names.
|
|
1672
1672
|
*/
|
|
1673
1673
|
function getStaticGetterNames(cls) {
|
|
1674
|
-
|
|
1674
|
+
const descriptors = Object.getOwnPropertyDescriptors(cls);
|
|
1675
|
+
return sortAnArray(Object.entries(descriptors).filter(([key, desc]) => typeof desc.get === "function" && key !== "prototype").map(([key]) => key));
|
|
1675
1676
|
}
|
|
1676
1677
|
/**
|
|
1677
1678
|
* * Gathers detailed information about the instance and static methods of a class.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolbox-x",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"utility",
|
|
12
12
|
"functions",
|
|
13
13
|
"class",
|
|
14
|
+
"guard",
|
|
15
|
+
"predicate",
|
|
14
16
|
"form",
|
|
15
17
|
"random-id",
|
|
16
18
|
"id",
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
"verbalize",
|
|
38
40
|
"verbalizer",
|
|
39
41
|
"date",
|
|
42
|
+
"date-time",
|
|
40
43
|
"chalk",
|
|
41
44
|
"console",
|
|
42
45
|
"style",
|
|
@@ -96,12 +99,12 @@
|
|
|
96
99
|
},
|
|
97
100
|
"license": "Apache-2.0",
|
|
98
101
|
"devDependencies": {
|
|
99
|
-
"@biomejs/biome": "^2.5.
|
|
100
|
-
"@types/node": "^
|
|
102
|
+
"@biomejs/biome": "^2.5.1",
|
|
103
|
+
"@types/node": "^26.0.1",
|
|
101
104
|
"husky": "^9.1.7",
|
|
102
|
-
"lint-staged": "^17.0.
|
|
105
|
+
"lint-staged": "^17.0.8",
|
|
103
106
|
"nhb-scripts": "^1.9.2",
|
|
104
|
-
"tsdown": "^0.22.
|
|
107
|
+
"tsdown": "^0.22.3",
|
|
105
108
|
"typescript": "^6.0.3"
|
|
106
109
|
},
|
|
107
110
|
"lint-staged": {
|