nhb-toolbox 4.29.21 → 4.30.1
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 +13 -2
- package/README.md +1 -1
- package/dist/cjs/converter/constants.js +4 -8
- package/dist/cjs/dom/index.js +25 -0
- package/dist/cjs/hash/helpers.js +16 -0
- package/dist/cjs/hash/utils.js +5 -3
- package/dist/cjs/hash/uuid.js +2 -25
- package/dist/cjs/index.js +47 -47
- package/dist/cjs/stylog/Stylog.js +36 -3
- package/dist/cjs/stylog/console.log.js +6 -0
- package/dist/cjs/utils/xtras.js +11 -0
- package/dist/dts/converter/Converter.d.ts +2 -2
- package/dist/dts/converter/constants.d.ts +3 -3
- package/dist/dts/dom/index.d.ts +3 -0
- package/dist/dts/hash/helpers.d.ts +6 -0
- package/dist/dts/hash/utils.d.ts +7 -1
- package/dist/dts/index.d.ts +2 -3
- package/dist/dts/object/countries.d.ts +1 -1
- package/dist/dts/object/types.d.ts +2 -0
- package/dist/dts/stylog/Stylog.d.ts +1 -1
- package/dist/dts/stylog/console.log.d.ts +5 -0
- package/dist/dts/stylog/constants.d.ts +52 -5
- package/dist/dts/utils/xtras.d.ts +28 -0
- package/dist/esm/converter/constants.js +4 -8
- package/dist/esm/dom/index.js +3 -0
- package/dist/esm/hash/helpers.js +15 -0
- package/dist/esm/hash/utils.js +6 -4
- package/dist/esm/hash/uuid.js +3 -26
- package/dist/esm/index.js +2 -3
- package/dist/esm/stylog/Stylog.js +36 -3
- package/dist/esm/stylog/console.log.js +3 -0
- package/dist/esm/utils/xtras.js +8 -0
- package/package.json +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
All notable changes to the package will be documented here.
|
|
6
6
|
|
|
7
|
+
## [4.30.1] - 2026-04-27
|
|
8
|
+
|
|
9
|
+
- **Updated** *random hex generation* logic in `randomHex` and `uuid` utilities to use `crypto.getRandomValues` for better performance and security when available, with a fallback to `Math.random` for environments where `crypto` is not available.
|
|
10
|
+
|
|
11
|
+
## [4.30.0] - 2026-04-27
|
|
12
|
+
|
|
13
|
+
- **Added** new utility `getCountryByPhone` to get country details (country name, country code, ISO short code, and ISO code) by matching the country code in the given phone number.
|
|
14
|
+
- **Updated** `Stylog` to fix the issues with nested ANSI colors in the formatted output.
|
|
15
|
+
- **Added** *new subpath* export for all the dom utilities: `'nhb-toolbox/dom'`.
|
|
16
|
+
- **Exports** from *main path* (`'nhb-toolbox'`) are still available for backward compatibility.
|
|
17
|
+
|
|
7
18
|
## [4.29.21] - 2026-04-05
|
|
8
19
|
|
|
9
20
|
- **Updated** tsdoc for `getNumbersInRange` utility to clarify the return type based on the `getAsString` flag.
|
|
@@ -15,7 +26,7 @@ All notable changes to the package will be documented here.
|
|
|
15
26
|
|
|
16
27
|
## [4.29.10] - 2026-03-27
|
|
17
28
|
|
|
18
|
-
- **Added** new *color
|
|
29
|
+
- **Added** new *color utilities* `applyOpacityToHex` and `percentToHex` for working with *hex colors* and *opacity*.
|
|
19
30
|
- **Added** new *date utility* `formatDateRelative` to format a date as a relative time string (e.g., `"5m ago"`, `"2h from now"`, etc.) with an optional *custom format* for dates older than a week.
|
|
20
31
|
|
|
21
32
|
## [4.29.1] - 2026-03-27
|
|
@@ -417,7 +428,7 @@ All notable changes to the package will be documented here.
|
|
|
417
428
|
## [4.23.10] - 2025-10-24
|
|
418
429
|
|
|
419
430
|
- **Added** `metre` variants of units where needed in *converter classes*.
|
|
420
|
-
- **Updated & Optimized** subpath
|
|
431
|
+
- **Updated & Optimized** *subpath* export for *converter utilities*.
|
|
421
432
|
|
|
422
433
|
## [4.23.1] - 2025-10-24
|
|
423
434
|
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<img src="https://img.shields.io/npm/v/nhb-toolbox.svg?label=NPM&style=flat&color=teal&logo=npm" alt="Latest Version" />
|
|
12
12
|
</a>
|
|
13
13
|
<a href="https://bundlejs.com/?q=nhb-toolbox" aria-label="Bundle Size">
|
|
14
|
-
<img src="https://
|
|
14
|
+
<img src="https://img.shields.io/bundlejs/size/nhb-toolbox?label=Bundle%20Size&style=flat&color=blue&logo=npm" alt="Bundle Size" />
|
|
15
15
|
</a>
|
|
16
16
|
|
|
17
17
|
<!-- Project Metadata -->
|
|
@@ -100,13 +100,9 @@ exports.UNITS = /* @__PURE__ */ Object.freeze({
|
|
|
100
100
|
'long-ton',
|
|
101
101
|
],
|
|
102
102
|
});
|
|
103
|
-
exports.IRREGULAR_PLURALS = {
|
|
103
|
+
exports.IRREGULAR_PLURALS = /* @__PURE__ */ Object.freeze({
|
|
104
104
|
millennium: 'millennia',
|
|
105
105
|
century: 'centuries',
|
|
106
|
-
};
|
|
107
|
-
exports.INVARIANT_UNITS = new Set([
|
|
108
|
-
|
|
109
|
-
'fahrenheit',
|
|
110
|
-
'kelvin',
|
|
111
|
-
]);
|
|
112
|
-
exports.Y_TO_IES = new Set(['century']);
|
|
106
|
+
});
|
|
107
|
+
exports.INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(new Set(['celsius', 'fahrenheit', 'kelvin']));
|
|
108
|
+
exports.Y_TO_IES = /* @__PURE__ */ Object.freeze(new Set(['century']));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toggleFullScreen = exports.smoothScrollTo = exports.copyToClipboard = exports.saveToSessionStorage = exports.saveToLocalStorage = exports.removeFromSessionStorage = exports.removeFromLocalStorage = exports.getFromSessionStorage = exports.getFromLocalStorage = exports.updateQueryParam = exports.parseQueryStringLiteral = exports.literalQueryStringToObject = exports.queryStringToObject = exports.parseQueryString = exports.getQueryStringAsObject = exports.getQueryParams = exports.generateQueryParams = exports.formatQueryParams = exports.createQueryParams = void 0;
|
|
4
|
+
var query_1 = require("./query");
|
|
5
|
+
Object.defineProperty(exports, "createQueryParams", { enumerable: true, get: function () { return query_1.generateQueryParams; } });
|
|
6
|
+
Object.defineProperty(exports, "formatQueryParams", { enumerable: true, get: function () { return query_1.generateQueryParams; } });
|
|
7
|
+
Object.defineProperty(exports, "generateQueryParams", { enumerable: true, get: function () { return query_1.generateQueryParams; } });
|
|
8
|
+
Object.defineProperty(exports, "getQueryParams", { enumerable: true, get: function () { return query_1.getQueryParams; } });
|
|
9
|
+
Object.defineProperty(exports, "getQueryStringAsObject", { enumerable: true, get: function () { return query_1.parseQueryString; } });
|
|
10
|
+
Object.defineProperty(exports, "parseQueryString", { enumerable: true, get: function () { return query_1.parseQueryString; } });
|
|
11
|
+
Object.defineProperty(exports, "queryStringToObject", { enumerable: true, get: function () { return query_1.parseQueryString; } });
|
|
12
|
+
Object.defineProperty(exports, "literalQueryStringToObject", { enumerable: true, get: function () { return query_1.parseQueryStringLiteral; } });
|
|
13
|
+
Object.defineProperty(exports, "parseQueryStringLiteral", { enumerable: true, get: function () { return query_1.parseQueryStringLiteral; } });
|
|
14
|
+
Object.defineProperty(exports, "updateQueryParam", { enumerable: true, get: function () { return query_1.updateQueryParam; } });
|
|
15
|
+
var storage_1 = require("./storage");
|
|
16
|
+
Object.defineProperty(exports, "getFromLocalStorage", { enumerable: true, get: function () { return storage_1.getFromLocalStorage; } });
|
|
17
|
+
Object.defineProperty(exports, "getFromSessionStorage", { enumerable: true, get: function () { return storage_1.getFromSessionStorage; } });
|
|
18
|
+
Object.defineProperty(exports, "removeFromLocalStorage", { enumerable: true, get: function () { return storage_1.removeFromLocalStorage; } });
|
|
19
|
+
Object.defineProperty(exports, "removeFromSessionStorage", { enumerable: true, get: function () { return storage_1.removeFromSessionStorage; } });
|
|
20
|
+
Object.defineProperty(exports, "saveToLocalStorage", { enumerable: true, get: function () { return storage_1.saveToLocalStorage; } });
|
|
21
|
+
Object.defineProperty(exports, "saveToSessionStorage", { enumerable: true, get: function () { return storage_1.saveToSessionStorage; } });
|
|
22
|
+
var utils_1 = require("./utils");
|
|
23
|
+
Object.defineProperty(exports, "copyToClipboard", { enumerable: true, get: function () { return utils_1.copyToClipboard; } });
|
|
24
|
+
Object.defineProperty(exports, "smoothScrollTo", { enumerable: true, get: function () { return utils_1.smoothScrollTo; } });
|
|
25
|
+
Object.defineProperty(exports, "toggleFullScreen", { enumerable: true, get: function () { return utils_1.toggleFullScreen; } });
|
package/dist/cjs/hash/helpers.js
CHANGED
|
@@ -5,6 +5,7 @@ exports._stringToNumbers = _stringToNumbers;
|
|
|
5
5
|
exports._md5cycle = _md5cycle;
|
|
6
6
|
exports._uuidTimestamp = _uuidTimestamp;
|
|
7
7
|
exports._randomNode48 = _randomNode48;
|
|
8
|
+
exports._bytesToRandomHex = _bytesToRandomHex;
|
|
8
9
|
exports._clockSeq14 = _clockSeq14;
|
|
9
10
|
exports._formatUUID = _formatUUID;
|
|
10
11
|
exports._isOptionV3V5 = _isOptionV3V5;
|
|
@@ -135,6 +136,21 @@ function _randomNode48() {
|
|
|
135
136
|
const modified = (firstByte | 0b00000001).toString(16).padStart(2, '0');
|
|
136
137
|
return modified + node.slice(2).join('');
|
|
137
138
|
}
|
|
139
|
+
function _bytesToRandomHex(bytes) {
|
|
140
|
+
if (crypto?.getRandomValues) {
|
|
141
|
+
crypto.getRandomValues(bytes);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
145
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let hex = '';
|
|
149
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
150
|
+
hex += bytes[i].toString(16).padStart(2, '0');
|
|
151
|
+
}
|
|
152
|
+
return hex;
|
|
153
|
+
}
|
|
138
154
|
function _clockSeq14() {
|
|
139
155
|
const seq = parseInt((0, utils_1.randomHex)(4), 16) & 0x3fff;
|
|
140
156
|
return seq.toString(16).padStart(4, '0');
|
package/dist/cjs/hash/utils.js
CHANGED
|
@@ -15,9 +15,11 @@ exports.hexToBytes = hexToBytes;
|
|
|
15
15
|
const specials_1 = require("../guards/specials");
|
|
16
16
|
const helpers_1 = require("./helpers");
|
|
17
17
|
function randomHex(length, uppercase = false) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (length <= 0)
|
|
19
|
+
return '';
|
|
20
|
+
const bytes = new Uint8Array(Math.ceil(length / 2));
|
|
21
|
+
const expected = (0, helpers_1._bytesToRandomHex)(bytes).slice(0, length);
|
|
22
|
+
return uppercase ? expected.toUpperCase() : expected;
|
|
21
23
|
}
|
|
22
24
|
function utf8ToBytes(str) {
|
|
23
25
|
const out = [];
|
package/dist/cjs/hash/uuid.js
CHANGED
|
@@ -42,19 +42,7 @@ function uuid(options) {
|
|
|
42
42
|
throw new Error('v3 requires valid namespace (uuid) and name!');
|
|
43
43
|
}
|
|
44
44
|
case 'v4': {
|
|
45
|
-
const
|
|
46
|
-
if (crypto.getRandomValues) {
|
|
47
|
-
crypto.getRandomValues(bytes);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
for (let i = 0; i < 16; i++) {
|
|
51
|
-
bytes[i] = Math.floor(Math.random() * 256);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
let hex = '';
|
|
55
|
-
for (let i = 0; i < 16; i++) {
|
|
56
|
-
hex += bytes[i].toString(16).padStart(2, '0');
|
|
57
|
-
}
|
|
45
|
+
const hex = (0, helpers_1._bytesToRandomHex)(new Uint8Array(16));
|
|
58
46
|
return (0, helpers_1._formatUUID)(hex, 4, uppercase);
|
|
59
47
|
}
|
|
60
48
|
case 'v5': {
|
|
@@ -93,18 +81,7 @@ function uuid(options) {
|
|
|
93
81
|
bytes[i] = Number(temp & 0xffn);
|
|
94
82
|
temp >>= 8n;
|
|
95
83
|
}
|
|
96
|
-
|
|
97
|
-
crypto.getRandomValues(bytes);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
for (let i = 6; i < 16; i++) {
|
|
101
|
-
bytes[i] = Math.floor(Math.random() * 256);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
let hex = '';
|
|
105
|
-
for (let i = 0; i < 16; i++) {
|
|
106
|
-
hex += bytes[i].toString(16).padStart(2, '0');
|
|
107
|
-
}
|
|
84
|
+
const hex = (0, helpers_1._bytesToRandomHex)(bytes);
|
|
108
85
|
return (0, helpers_1._formatUUID)(hex, 8, uppercase);
|
|
109
86
|
}
|
|
110
87
|
default:
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,9 +6,9 @@ exports.convertHexToHsl = exports.convertHex8ToRgba = exports.convertHex8ToHsla
|
|
|
6
6
|
exports.convertMinutesToHourMinutes = exports.chronusts = exports.chronusjs = exports.chronus = exports.chronosts = exports.chronosjs = exports.chronos = exports.INTERNALS = exports.Chronus = exports.Chronos = exports.Bongabdo = exports.BnCalendar = exports.BanglaCalendar = exports.isValidUTCOffset = exports.isValidUTCOffSet = exports.isValidUTC = exports.isValidTimeZoneId = exports.isValidTimeString = exports.isValidTime = exports.isTimeWithUnit = exports.isNativeTimeZoneId = exports.isLeapYear = exports.isDateLike = exports.parseMSec = exports.parseMs = exports.greet = exports.getGreeting = exports.generateGreeting = exports.percentToHex = exports.extractSolidColorValues = exports.extractAlphaColorValues = exports.applyOpacityToHex = exports.Colour = exports.Color = exports.isRGBA = exports.isRGB = exports.isHSLA = exports.isHSL = exports.isHex8 = exports.isHex6 = exports.convertRgbToRgba = exports.convertRgbToHsl = exports.convertRgbToHex = exports.convertRgbaToHsla = exports.convertRgbaToHex8 = exports.convertHslToRgb = exports.convertHslToHex = exports.convertHslaToRgba = exports.convertHslaToHex8 = exports.convertHexToRgb = void 0;
|
|
7
7
|
exports.extractDuplicates = exports.createOptionsArray = exports.sortAnArray = exports.naturalSortForString = exports.naturalSort = exports.compareSorter = exports.compareNaturally = exports.Finder = exports.totalDeltaByField = exports.sumFieldDifference = exports.sumByField = exports.groupAndSumByField = exports.groupAndAvgByField = exports.groupAndAverageByField = exports.avgByField = exports.averageByField = exports.shuffleArray = exports.isValidEmptyArray = exports.isInvalidOrEmptyArray = exports.getLastArrayElement = exports.flattenArray = exports.filterArrayOfObjects = exports.minutesToUTCOffset = exports.getTotalMinutesFromUTC = exports.getTotalMinutesFromTime = exports.getTotalMinutes = exports.getTimeZoneIds = exports.getTimeZoneDetails = exports.getTimeStringFromUTC = exports.getTimeFromMinutes = exports.getNativeTimeZoneId = exports.getMinutesFromUTC = exports.getHourMinutesFromMinutes = exports.getTimestamp = exports.getCurrentTime = exports.getCurrentDateTime = exports.formatUTCOffset = exports.formatTimePart = exports.formatRelativeTime = exports.formatRelativeDate = exports.formatDateRelative = exports.formatDateTime = exports.formatDate = exports.extractTotalMinutesFromTime = exports.extractTimeStringFromUTC = exports.extractTimeFromUTC = exports.extractMinutesFromUTC = exports.extractHourMinute = exports.convertMinutesToUTCOffset = exports.convertMinutesToTime = void 0;
|
|
8
8
|
exports.pickFieldsByCondition = exports.pickFields = exports.omitObjectFields = exports.omitFields = exports.deleteObjectFields = exports.deleteFields = exports.convertObjectValues = exports.sanitizeData = exports.parseStringifiedObjectValues = exports.parseObjectValues = exports.parseJsonToObject = exports.mergeObjects = exports.mergeAndFlattenObjects = exports.flattenObjectKeyValue = exports.flattenObjectDotNotation = exports.extractUpdatedFields = exports.extractUpdatedAndNewFields = exports.extractNewFields = exports.extractObjectKeysDeep = exports.extractObjectKeys = exports.extractKeysDeep = exports.extractKeys = exports.countObjectFields = exports.cloneObject = exports.isValidFormData = exports.isOriginFileObj = exports.isFileUpload = exports.isFileOrBlob = exports.isFileList = exports.isFileArray = exports.isCustomFileArray = exports.isCustomFile = exports.serializeForm = exports.parseFormData = exports.createFormData = exports.createControlledFormData = exports.convertIntoFormData = exports.splitArrayByProperty = exports.splitArray = exports.rotateArray = exports.removeDuplicatesFromArray = exports.removeDuplicates = exports.moveArrayElement = exports.groupArrayByProperty = exports.getMissingElements = exports.getDuplicatesFromArray = exports.getDuplicates = exports.findMissingElements = exports.extractMissingElements = exports.extractDuplicatesFromArray = void 0;
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.isValidURL = exports.isValidEmail = exports.isUUID = exports.isURL = exports.isPhoneNumber = exports.isNumericString = exports.isNodeEnvironment = exports.isNodeENV = exports.isNode = exports.isIPAddress = void 0;
|
|
9
|
+
exports.isBoolean = exports.isBigInt = exports.getCountryByPhone = exports.Paginator = exports.throttleAction = exports.stripJsonEdgeGarbage = exports.stableStringify = exports.parsePrimitivesDeep = exports.parseJsonDeep = exports.parseJSON = exports.joinArrayElements = exports.isDeepEqual = exports.getStaticMethodsCount = exports.getStaticMethodNames = exports.getStaticGetterNames = exports.getInstanceMethodsCount = exports.getInstanceMethodNames = exports.getInstanceGetterNames = exports.getClassDetails = exports.definePrototypeMethod = exports.deepParsePrimitives = exports.debounceAction = exports.countStaticMethods = exports.countInstanceMethods = exports.convertArrayToString = exports.saveToSessionStorage = exports.saveToLocalStorage = exports.removeFromSessionStorage = exports.removeFromLocalStorage = exports.getFromSessionStorage = exports.getFromLocalStorage = exports.toggleFullScreen = exports.smoothScrollTo = exports.copyToClipboard = exports.updateQueryParam = exports.queryStringToObject = exports.parseQueryStringLiteral = exports.parseQueryString = exports.literalQueryStringToObject = exports.getQueryStringAsObject = exports.getQueryParams = exports.generateQueryParams = exports.formatQueryParams = exports.createQueryParams = exports.removeObjectFields = exports.removeFields = exports.remapObjectFields = exports.remapFields = exports.pickObjectFieldsByCondition = exports.pickObjectFields = void 0;
|
|
10
|
+
exports.isExpectedNodeENV = exports.isEnvironment = exports.isEmailArray = exports.isEmail = exports.isDateString = exports.isBrowser = exports.isBinaryString = exports.isBase64 = exports.httpStatus = exports.HttpStatus = exports.isValidSet = exports.isValidObject = exports.isValidMap = exports.isValidJSON = exports.isValidArray = exports.isSet = exports.isReturningPromise = exports.isRegularExpression = exports.isRegExp = exports.isPromise = exports.isObjectWithKeys = exports.isObjectEmpty = exports.isObject = exports.isNotEmptyObject = exports.isMethodDescriptor = exports.isMethod = exports.isMap = exports.isJSONObject = exports.isJSON = exports.isFunction = exports.isError = exports.isEmptyObjectGuard = exports.isEmptyObject = exports.isDate = exports.isArrayWithLength = exports.isArrayOfType = exports.isArray = exports.doesReturnPromise = exports.isUndefined = exports.isTruthy = exports.isSymbol = exports.isString = exports.isPrimitive = exports.isPositiveInteger = exports.isNumber = exports.isNull = exports.isNormalPrimitive = exports.isNonEmptyString = exports.isInteger = exports.isFalsy = void 0;
|
|
11
|
+
exports.isValidURL = exports.isValidEmail = exports.isUUID = exports.isURL = exports.isPhoneNumber = exports.isNumericString = exports.isNodeEnvironment = exports.isNodeENV = exports.isNode = exports.isIPAddress = exports.isHexString = void 0;
|
|
12
12
|
var basics_1 = require("./string/basics");
|
|
13
13
|
Object.defineProperty(exports, "generateRandomID", { enumerable: true, get: function () { return basics_1.generateRandomID; } });
|
|
14
14
|
Object.defineProperty(exports, "trimString", { enumerable: true, get: function () { return basics_1.trimString; } });
|
|
@@ -361,52 +361,52 @@ Object.defineProperty(exports, "remapFields", { enumerable: true, get: function
|
|
|
361
361
|
Object.defineProperty(exports, "remapObjectFields", { enumerable: true, get: function () { return convert_5.remapFields; } });
|
|
362
362
|
Object.defineProperty(exports, "removeFields", { enumerable: true, get: function () { return convert_5.deleteFields; } });
|
|
363
363
|
Object.defineProperty(exports, "removeObjectFields", { enumerable: true, get: function () { return convert_5.deleteFields; } });
|
|
364
|
-
var
|
|
365
|
-
Object.defineProperty(exports, "createQueryParams", { enumerable: true, get: function () { return
|
|
366
|
-
Object.defineProperty(exports, "formatQueryParams", { enumerable: true, get: function () { return
|
|
367
|
-
Object.defineProperty(exports, "generateQueryParams", { enumerable: true, get: function () { return
|
|
368
|
-
Object.defineProperty(exports, "getQueryParams", { enumerable: true, get: function () { return
|
|
369
|
-
Object.defineProperty(exports, "getQueryStringAsObject", { enumerable: true, get: function () { return
|
|
370
|
-
Object.defineProperty(exports, "literalQueryStringToObject", { enumerable: true, get: function () { return
|
|
371
|
-
Object.defineProperty(exports, "parseQueryString", { enumerable: true, get: function () { return
|
|
372
|
-
Object.defineProperty(exports, "parseQueryStringLiteral", { enumerable: true, get: function () { return
|
|
373
|
-
Object.defineProperty(exports, "queryStringToObject", { enumerable: true, get: function () { return
|
|
374
|
-
Object.defineProperty(exports, "updateQueryParam", { enumerable: true, get: function () { return
|
|
375
|
-
|
|
376
|
-
Object.defineProperty(exports, "
|
|
377
|
-
Object.defineProperty(exports, "
|
|
378
|
-
Object.defineProperty(exports, "
|
|
379
|
-
|
|
380
|
-
Object.defineProperty(exports, "
|
|
381
|
-
Object.defineProperty(exports, "
|
|
382
|
-
Object.defineProperty(exports, "
|
|
383
|
-
Object.defineProperty(exports, "
|
|
384
|
-
|
|
385
|
-
Object.defineProperty(exports, "
|
|
386
|
-
|
|
387
|
-
Object.defineProperty(exports, "
|
|
388
|
-
Object.defineProperty(exports, "
|
|
389
|
-
Object.defineProperty(exports, "
|
|
390
|
-
Object.defineProperty(exports, "
|
|
391
|
-
Object.defineProperty(exports, "
|
|
392
|
-
Object.defineProperty(exports, "
|
|
393
|
-
Object.defineProperty(exports, "
|
|
394
|
-
Object.defineProperty(exports, "
|
|
395
|
-
Object.defineProperty(exports, "
|
|
396
|
-
Object.defineProperty(exports, "
|
|
397
|
-
Object.defineProperty(exports, "
|
|
398
|
-
Object.defineProperty(exports, "
|
|
399
|
-
Object.defineProperty(exports, "
|
|
400
|
-
Object.defineProperty(exports, "
|
|
401
|
-
Object.defineProperty(exports, "
|
|
402
|
-
Object.defineProperty(exports, "
|
|
403
|
-
Object.defineProperty(exports, "
|
|
404
|
-
Object.defineProperty(exports, "
|
|
405
|
-
Object.defineProperty(exports, "
|
|
406
|
-
Object.defineProperty(exports, "stripJsonEdgeGarbage", { enumerable: true, get: function () { return index_1.stripJsonEdgeGarbage; } });
|
|
407
|
-
Object.defineProperty(exports, "throttleAction", { enumerable: true, get: function () { return index_1.throttleAction; } });
|
|
364
|
+
var index_1 = require("./dom/index");
|
|
365
|
+
Object.defineProperty(exports, "createQueryParams", { enumerable: true, get: function () { return index_1.createQueryParams; } });
|
|
366
|
+
Object.defineProperty(exports, "formatQueryParams", { enumerable: true, get: function () { return index_1.formatQueryParams; } });
|
|
367
|
+
Object.defineProperty(exports, "generateQueryParams", { enumerable: true, get: function () { return index_1.generateQueryParams; } });
|
|
368
|
+
Object.defineProperty(exports, "getQueryParams", { enumerable: true, get: function () { return index_1.getQueryParams; } });
|
|
369
|
+
Object.defineProperty(exports, "getQueryStringAsObject", { enumerable: true, get: function () { return index_1.getQueryStringAsObject; } });
|
|
370
|
+
Object.defineProperty(exports, "literalQueryStringToObject", { enumerable: true, get: function () { return index_1.literalQueryStringToObject; } });
|
|
371
|
+
Object.defineProperty(exports, "parseQueryString", { enumerable: true, get: function () { return index_1.parseQueryString; } });
|
|
372
|
+
Object.defineProperty(exports, "parseQueryStringLiteral", { enumerable: true, get: function () { return index_1.parseQueryStringLiteral; } });
|
|
373
|
+
Object.defineProperty(exports, "queryStringToObject", { enumerable: true, get: function () { return index_1.queryStringToObject; } });
|
|
374
|
+
Object.defineProperty(exports, "updateQueryParam", { enumerable: true, get: function () { return index_1.updateQueryParam; } });
|
|
375
|
+
Object.defineProperty(exports, "copyToClipboard", { enumerable: true, get: function () { return index_1.copyToClipboard; } });
|
|
376
|
+
Object.defineProperty(exports, "smoothScrollTo", { enumerable: true, get: function () { return index_1.smoothScrollTo; } });
|
|
377
|
+
Object.defineProperty(exports, "toggleFullScreen", { enumerable: true, get: function () { return index_1.toggleFullScreen; } });
|
|
378
|
+
Object.defineProperty(exports, "getFromLocalStorage", { enumerable: true, get: function () { return index_1.getFromLocalStorage; } });
|
|
379
|
+
Object.defineProperty(exports, "getFromSessionStorage", { enumerable: true, get: function () { return index_1.getFromSessionStorage; } });
|
|
380
|
+
Object.defineProperty(exports, "removeFromLocalStorage", { enumerable: true, get: function () { return index_1.removeFromLocalStorage; } });
|
|
381
|
+
Object.defineProperty(exports, "removeFromSessionStorage", { enumerable: true, get: function () { return index_1.removeFromSessionStorage; } });
|
|
382
|
+
Object.defineProperty(exports, "saveToLocalStorage", { enumerable: true, get: function () { return index_1.saveToLocalStorage; } });
|
|
383
|
+
Object.defineProperty(exports, "saveToSessionStorage", { enumerable: true, get: function () { return index_1.saveToSessionStorage; } });
|
|
384
|
+
var index_2 = require("./utils/index");
|
|
385
|
+
Object.defineProperty(exports, "convertArrayToString", { enumerable: true, get: function () { return index_2.convertArrayToString; } });
|
|
386
|
+
Object.defineProperty(exports, "countInstanceMethods", { enumerable: true, get: function () { return index_2.countInstanceMethods; } });
|
|
387
|
+
Object.defineProperty(exports, "countStaticMethods", { enumerable: true, get: function () { return index_2.countStaticMethods; } });
|
|
388
|
+
Object.defineProperty(exports, "debounceAction", { enumerable: true, get: function () { return index_2.debounceAction; } });
|
|
389
|
+
Object.defineProperty(exports, "deepParsePrimitives", { enumerable: true, get: function () { return index_2.deepParsePrimitives; } });
|
|
390
|
+
Object.defineProperty(exports, "definePrototypeMethod", { enumerable: true, get: function () { return index_2.definePrototypeMethod; } });
|
|
391
|
+
Object.defineProperty(exports, "getClassDetails", { enumerable: true, get: function () { return index_2.getClassDetails; } });
|
|
392
|
+
Object.defineProperty(exports, "getInstanceGetterNames", { enumerable: true, get: function () { return index_2.getInstanceGetterNames; } });
|
|
393
|
+
Object.defineProperty(exports, "getInstanceMethodNames", { enumerable: true, get: function () { return index_2.getInstanceMethodNames; } });
|
|
394
|
+
Object.defineProperty(exports, "getInstanceMethodsCount", { enumerable: true, get: function () { return index_2.countInstanceMethods; } });
|
|
395
|
+
Object.defineProperty(exports, "getStaticGetterNames", { enumerable: true, get: function () { return index_2.getStaticGetterNames; } });
|
|
396
|
+
Object.defineProperty(exports, "getStaticMethodNames", { enumerable: true, get: function () { return index_2.getStaticMethodNames; } });
|
|
397
|
+
Object.defineProperty(exports, "getStaticMethodsCount", { enumerable: true, get: function () { return index_2.countStaticMethods; } });
|
|
398
|
+
Object.defineProperty(exports, "isDeepEqual", { enumerable: true, get: function () { return index_2.isDeepEqual; } });
|
|
399
|
+
Object.defineProperty(exports, "joinArrayElements", { enumerable: true, get: function () { return index_2.convertArrayToString; } });
|
|
400
|
+
Object.defineProperty(exports, "parseJSON", { enumerable: true, get: function () { return index_2.parseJSON; } });
|
|
401
|
+
Object.defineProperty(exports, "parseJsonDeep", { enumerable: true, get: function () { return index_2.parseJSON; } });
|
|
402
|
+
Object.defineProperty(exports, "parsePrimitivesDeep", { enumerable: true, get: function () { return index_2.deepParsePrimitives; } });
|
|
403
|
+
Object.defineProperty(exports, "stableStringify", { enumerable: true, get: function () { return index_2.stableStringify; } });
|
|
404
|
+
Object.defineProperty(exports, "stripJsonEdgeGarbage", { enumerable: true, get: function () { return index_2.stripJsonEdgeGarbage; } });
|
|
405
|
+
Object.defineProperty(exports, "throttleAction", { enumerable: true, get: function () { return index_2.throttleAction; } });
|
|
408
406
|
var Paginator_1 = require("./utils/Paginator");
|
|
409
407
|
Object.defineProperty(exports, "Paginator", { enumerable: true, get: function () { return Paginator_1.Paginator; } });
|
|
408
|
+
var xtras_1 = require("./utils/xtras");
|
|
409
|
+
Object.defineProperty(exports, "getCountryByPhone", { enumerable: true, get: function () { return xtras_1.getCountryByPhone; } });
|
|
410
410
|
var primitives_1 = require("./guards/primitives");
|
|
411
411
|
Object.defineProperty(exports, "isBigInt", { enumerable: true, get: function () { return primitives_1.isBigInt; } });
|
|
412
412
|
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return primitives_1.isBoolean; } });
|
|
@@ -14,6 +14,7 @@ const guards_1 = require("../colors/guards");
|
|
|
14
14
|
const helpers_1 = require("../colors/helpers");
|
|
15
15
|
const primitives_1 = require("../guards/primitives");
|
|
16
16
|
const specials_1 = require("../guards/specials");
|
|
17
|
+
const console_log_1 = require("./console.log");
|
|
17
18
|
const constants_1 = require("./constants");
|
|
18
19
|
const helpers_2 = require("./helpers");
|
|
19
20
|
function detectColorSupport() {
|
|
@@ -102,50 +103,82 @@ class LogStyler {
|
|
|
102
103
|
toANSI(input, stringify = false) {
|
|
103
104
|
const stringified = stringify === true ? JSON.stringify(input) : `${input}`;
|
|
104
105
|
let openSeq = '', closeSeq = '';
|
|
106
|
+
let fgOpenSeq = '', bgOpenSeq = '';
|
|
107
|
+
const reopenSequences = new Map();
|
|
105
108
|
for (const style of this.#styles) {
|
|
106
109
|
if ((0, primitives_1.isString)(style)) {
|
|
107
110
|
if (isTextStyle(style)) {
|
|
108
111
|
const [open, close] = constants_1.ANSI_TEXT_STYLES[style];
|
|
109
112
|
openSeq += open;
|
|
110
113
|
closeSeq = close + closeSeq;
|
|
114
|
+
reopenSequences.set(close, (reopenSequences.get(close) ?? '') + open);
|
|
111
115
|
}
|
|
112
116
|
else if (isBGColor(style)) {
|
|
113
117
|
const hex = css_colors_1.CSS_COLORS[(0, helpers_2._extractColorName)(style)];
|
|
114
118
|
const [open, close] = hexToAnsi(hex, true);
|
|
115
119
|
openSeq += open;
|
|
116
120
|
closeSeq = close + closeSeq;
|
|
121
|
+
bgOpenSeq = open;
|
|
117
122
|
}
|
|
118
123
|
else if (isCSSColor(style)) {
|
|
119
124
|
const hex = css_colors_1.CSS_COLORS[style];
|
|
120
125
|
const [open, close] = hexToAnsi(hex, false);
|
|
121
126
|
openSeq += open;
|
|
122
127
|
closeSeq = close + closeSeq;
|
|
128
|
+
fgOpenSeq = open;
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
else if ((0, helpers_2._isAnsiSequence)(style)) {
|
|
126
132
|
openSeq += style[0];
|
|
127
133
|
closeSeq = style[1] + closeSeq;
|
|
134
|
+
if (style[1] === '\x1b[49m') {
|
|
135
|
+
bgOpenSeq = style[0];
|
|
136
|
+
}
|
|
137
|
+
else if (style[1] === '\x1b[39m') {
|
|
138
|
+
fgOpenSeq = style[0];
|
|
139
|
+
}
|
|
128
140
|
}
|
|
129
141
|
else if ((0, helpers_2._isAnsi16ColorValue)(style)) {
|
|
130
142
|
const [open, close] = style.map((s) => `\x1b[${s}m`);
|
|
131
143
|
openSeq += open;
|
|
132
144
|
closeSeq = close + closeSeq;
|
|
145
|
+
if (close === '\x1b[49m') {
|
|
146
|
+
bgOpenSeq = open;
|
|
147
|
+
}
|
|
148
|
+
else if (close === '\x1b[39m') {
|
|
149
|
+
fgOpenSeq = open;
|
|
150
|
+
}
|
|
133
151
|
}
|
|
134
152
|
}
|
|
135
153
|
if (!detectColorSupport()) {
|
|
136
154
|
return stringified;
|
|
137
155
|
}
|
|
138
156
|
else {
|
|
139
|
-
|
|
157
|
+
let nestedStr = stringified;
|
|
158
|
+
if (nestedStr.includes('\x1b[')) {
|
|
159
|
+
if (fgOpenSeq) {
|
|
160
|
+
nestedStr = nestedStr.replaceAll('\x1b[39m', `\x1b[39m${fgOpenSeq}`);
|
|
161
|
+
}
|
|
162
|
+
if (bgOpenSeq) {
|
|
163
|
+
nestedStr = nestedStr.replaceAll('\x1b[49m', `\x1b[49m${bgOpenSeq}`);
|
|
164
|
+
}
|
|
165
|
+
for (const [close, reopen] of reopenSequences) {
|
|
166
|
+
nestedStr = nestedStr.replaceAll(close, `${close}${reopen}`);
|
|
167
|
+
}
|
|
168
|
+
if (openSeq) {
|
|
169
|
+
nestedStr = nestedStr.replaceAll('\x1b[0m', `\x1b[0m${openSeq}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return openSeq.concat(nestedStr, closeSeq);
|
|
140
173
|
}
|
|
141
174
|
}
|
|
142
175
|
log(input, stringify = false) {
|
|
143
176
|
if ((0, specials_1.isBrowser)()) {
|
|
144
177
|
const [fmt, cssList] = this.toCSS(input, stringify);
|
|
145
|
-
|
|
178
|
+
(0, console_log_1._logToConsole)(fmt, cssList.join(';'));
|
|
146
179
|
}
|
|
147
180
|
else {
|
|
148
|
-
|
|
181
|
+
(0, console_log_1._logToConsole)(this.toANSI(input, stringify));
|
|
149
182
|
}
|
|
150
183
|
}
|
|
151
184
|
#isValidHexOrRGB(color) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCountryByPhone = getCountryByPhone;
|
|
4
|
+
const primitives_1 = require("../guards/primitives");
|
|
5
|
+
const countries_1 = require("../object/countries");
|
|
6
|
+
function getCountryByPhone(phone) {
|
|
7
|
+
if (!(0, primitives_1.isNonEmptyString)(phone) && !(0, primitives_1.isNumber)(phone))
|
|
8
|
+
return [];
|
|
9
|
+
const normalized = ((0, primitives_1.isString)(phone) ? phone : String(phone)).replace(/\D/g, '');
|
|
10
|
+
return countries_1.COUNTRIES.filter((country) => normalized.startsWith(country.country_code.replace(/-/g, '')));
|
|
11
|
+
}
|
|
@@ -8,10 +8,10 @@ import { $Time } from './time';
|
|
|
8
8
|
import type { $Unit, Converted } from './types';
|
|
9
9
|
import { $Volume } from './volume';
|
|
10
10
|
/**
|
|
11
|
-
* @function Converter
|
|
11
|
+
* @function `Converter` Creates instances of specific unit converter class based on the provided unit.
|
|
12
12
|
*
|
|
13
13
|
* @description Converts values between compatible units (time, length, data, temperature, mass, area, volume).
|
|
14
|
-
* The returned instance exposes only methods relevant to the provided unit type.
|
|
14
|
+
* @remarks The returned instance exposes only methods relevant to the provided unit type.
|
|
15
15
|
*/
|
|
16
16
|
export declare function Converter<U extends $Unit>(value: Numeric, unit?: U): Converted<U>;
|
|
17
17
|
export { $Area as AreaConverter, $Data as DataConverter, $Length as LengthConverter, $Mass as MassConverter, $Temperature as TemperatureConverter, $Time as TimeConverter, $Volume as VolumeConverter, Converter as converter, };
|
|
@@ -8,6 +8,6 @@ export declare const UNITS: Readonly<{
|
|
|
8
8
|
readonly volume: readonly ["cubic-millimeter", "cubic-centimeter", "cubic-meter", "cubic-kilometer", "cubic-millimetre", "cubic-centimetre", "cubic-metre", "cubic-kilometre", "cubic-inch", "cubic-foot", "cubic-yard", "liter", "litre", "milliliter", "millilitre", "gallon", "quart", "pint", "cup", "tablespoon", "teaspoon"];
|
|
9
9
|
readonly mass: readonly ["microgram", "milligram", "gram", "kilogram", "tonne", "ounce", "pound", "stone", "short-ton", "long-ton"];
|
|
10
10
|
}>;
|
|
11
|
-
export declare const IRREGULAR_PLURALS: Record<string, string
|
|
12
|
-
export declare const INVARIANT_UNITS: Set<string
|
|
13
|
-
export declare const Y_TO_IES: Set<string
|
|
11
|
+
export declare const IRREGULAR_PLURALS: Readonly<Record<string, string>>;
|
|
12
|
+
export declare const INVARIANT_UNITS: Readonly<Set<string>>;
|
|
13
|
+
export declare const Y_TO_IES: Readonly<Set<string>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { generateQueryParams as createQueryParams, generateQueryParams as formatQueryParams, generateQueryParams, getQueryParams, parseQueryString as getQueryStringAsObject, parseQueryString, parseQueryString as queryStringToObject, parseQueryStringLiteral as literalQueryStringToObject, parseQueryStringLiteral, updateQueryParam, } from './query';
|
|
2
|
+
export { getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './storage';
|
|
3
|
+
export { copyToClipboard, smoothScrollTo, toggleFullScreen } from './utils';
|
|
@@ -15,6 +15,12 @@ export declare function _uuidTimestamp(): bigint;
|
|
|
15
15
|
* LSB of first byte must be 1 to indicate a randomly generated node.
|
|
16
16
|
*/
|
|
17
17
|
export declare function _randomNode48(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Generates random hex string of given byte length using crypto API if available, otherwise falls back to Math.random.
|
|
20
|
+
* @param bytes Instance of {@link Uint8Array} to fill with random values.
|
|
21
|
+
* @returns Hex string representation of the random bytes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function _bytesToRandomHex(bytes: Uint8Array<ArrayBuffer>): string;
|
|
18
24
|
/** * Generates a 14-bit clock sequence (2 bytes, but only 14 bits used). */
|
|
19
25
|
export declare function _clockSeq14(): string;
|
|
20
26
|
/** Convert a hex string to UUID format */
|
package/dist/dts/hash/utils.d.ts
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
* * Generates a random hexadecimal string of the specified length.
|
|
3
3
|
*
|
|
4
4
|
* @param length - Number of hex characters to generate.
|
|
5
|
-
* @param uppercase - Whether to return uppercase `A–F` characters.
|
|
5
|
+
* @param uppercase - Whether to return uppercase `A–F` characters. Defaults to `false` (lowercase).
|
|
6
6
|
*
|
|
7
7
|
* @returns A randomly generated hexadecimal string.
|
|
8
8
|
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* - This function generates a random hexadecimal string of the specified length.
|
|
11
|
+
* - It uses {@link crypto.getRandomValues} when available for secure randomness, and falls back to {@link Math.random} if not.
|
|
12
|
+
* - The output is a string of hex characters (`0–9`, `a–f` or `A–F`) with no prefixes or separators.
|
|
13
|
+
* - If `length` is `0` or negative, an empty string is returned.
|
|
14
|
+
*
|
|
9
15
|
* @example
|
|
10
16
|
* // 16-character lowercase hex
|
|
11
17
|
* const id = randomHex(16);
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -59,11 +59,10 @@ export { cloneObject, countObjectFields, extractObjectKeys as extractKeys, extra
|
|
|
59
59
|
export { extractNewFields, extractUpdatedAndNewFields, extractUpdatedFields, flattenObjectDotNotation, flattenObjectKeyValue, mergeAndFlattenObjects, mergeObjects, parseJsonToObject, } from './object/objectify';
|
|
60
60
|
export { parseObjectValues, parseObjectValues as parseStringifiedObjectValues, sanitizeData, } from './object/sanitize';
|
|
61
61
|
export { convertObjectValues, deleteFields, deleteFields as deleteObjectFields, deleteFields as omitFields, deleteFields as omitObjectFields, pickFields, pickObjectFieldsByCondition as pickFieldsByCondition, pickFields as pickObjectFields, pickObjectFieldsByCondition, remapFields, remapFields as remapObjectFields, deleteFields as removeFields, deleteFields as removeObjectFields, } from './object/convert';
|
|
62
|
-
export {
|
|
63
|
-
export { copyToClipboard, smoothScrollTo, toggleFullScreen } from './dom/utils';
|
|
64
|
-
export { getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './dom/storage';
|
|
62
|
+
export { createQueryParams, formatQueryParams, generateQueryParams, getQueryParams, getQueryStringAsObject, literalQueryStringToObject, parseQueryString, parseQueryStringLiteral, queryStringToObject, updateQueryParam, copyToClipboard, smoothScrollTo, toggleFullScreen, getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './dom/index';
|
|
65
63
|
export { convertArrayToString, countInstanceMethods, countStaticMethods, debounceAction, deepParsePrimitives, definePrototypeMethod, getClassDetails, getInstanceGetterNames, getInstanceMethodNames, countInstanceMethods as getInstanceMethodsCount, getStaticGetterNames, getStaticMethodNames, countStaticMethods as getStaticMethodsCount, isDeepEqual, convertArrayToString as joinArrayElements, parseJSON, parseJSON as parseJsonDeep, deepParsePrimitives as parsePrimitivesDeep, stableStringify, stripJsonEdgeGarbage, throttleAction, } from './utils/index';
|
|
66
64
|
export { Paginator } from './utils/Paginator';
|
|
65
|
+
export { getCountryByPhone } from './utils/xtras';
|
|
67
66
|
export { isBigInt, isBoolean, isFalsy, isInteger, isNonEmptyString, isNormalPrimitive, isNull, isNumber, isPositiveInteger, isPrimitive, isString, isSymbol, isTruthy, isUndefined, } from './guards/primitives';
|
|
68
67
|
export { isReturningPromise as doesReturnPromise, isArray, isArrayOfType, isValidArray as isArrayWithLength, isDate, isEmptyObject, isEmptyObject as isEmptyObjectGuard, isError, isFunction, isJSON, isJSON as isJSONObject, isMap, isMethodDescriptor as isMethod, isMethodDescriptor, isNotEmptyObject, isObject, isEmptyObject as isObjectEmpty, isObjectWithKeys, isPromise, isRegExp, isRegExp as isRegularExpression, isReturningPromise, isSet, isValidArray, isJSON as isValidJSON, isMap as isValidMap, isNotEmptyObject as isValidObject, isSet as isValidSet, } from './guards/non-primitives';
|
|
69
68
|
export { HttpStatus, httpStatus } from './http-status/HttpStatus';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** List of countries with full-name, country code ISO country code (both 2 & 3 character) */
|
|
1
|
+
/** List of countries with full-name, country code, ISO country code (both 2 & 3 character) */
|
|
2
2
|
export declare const COUNTRIES: readonly [{
|
|
3
3
|
readonly country_name: "Afghanistan";
|
|
4
4
|
readonly country_code: "93";
|
|
@@ -245,4 +245,6 @@ export type $Record<Key extends PropertyKey = string, T = any> = {
|
|
|
245
245
|
} : {
|
|
246
246
|
[K in Key]: T;
|
|
247
247
|
};
|
|
248
|
+
/** * Represents the details (read-only) of a country, including its name, country code, and ISO codes. */
|
|
249
|
+
export type CountryDetails = Readonly<$Record<'country_name' | 'country_code' | 'iso_code_short' | 'iso_code', string>>;
|
|
248
250
|
export {};
|
|
@@ -193,7 +193,7 @@ export declare class LogStyler {
|
|
|
193
193
|
* // format: "%c{\"id\":123}"
|
|
194
194
|
* // cssList: ["color: #008000"]
|
|
195
195
|
*/
|
|
196
|
-
toCSS(input: unknown, stringify?: boolean): [string
|
|
196
|
+
toCSS(input: unknown, stringify?: boolean): [`%c${string}`, string[]];
|
|
197
197
|
/**
|
|
198
198
|
* * Returns the input as a styled string with ANSI escape codes.
|
|
199
199
|
*
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import type { Hex6 } from '../colors/types';
|
|
2
|
-
import type { AnsiSequence, TextStyle } from './Stylog';
|
|
3
1
|
/** ANSI styles for non-color text effects */
|
|
4
|
-
export declare const ANSI_TEXT_STYLES:
|
|
2
|
+
export declare const ANSI_TEXT_STYLES: Readonly<{
|
|
3
|
+
bold: [string, string];
|
|
4
|
+
bolder: [string, string];
|
|
5
|
+
dim: [string, string];
|
|
6
|
+
italic: [string, string];
|
|
7
|
+
underline: [string, string];
|
|
8
|
+
strikethrough: [string, string];
|
|
9
|
+
inverse: [string, string];
|
|
10
|
+
}>;
|
|
5
11
|
/** Browser CSS equivalents */
|
|
6
|
-
export declare const CSS_TEXT_STYLES:
|
|
12
|
+
export declare const CSS_TEXT_STYLES: Readonly<{
|
|
13
|
+
bold: string;
|
|
14
|
+
bolder: string;
|
|
15
|
+
dim: string;
|
|
16
|
+
italic: string;
|
|
17
|
+
underline: string;
|
|
18
|
+
strikethrough: string;
|
|
19
|
+
inverse: string;
|
|
20
|
+
}>;
|
|
7
21
|
/** Records of ANSI-16 colors with values */
|
|
8
22
|
export declare const ANSI_16_COLORS: Readonly<{
|
|
9
23
|
readonly black: readonly [30, 39];
|
|
@@ -40,4 +54,37 @@ export declare const ANSI_16_COLORS: Readonly<{
|
|
|
40
54
|
readonly bgWhiteBright: readonly [107, 49];
|
|
41
55
|
}>;
|
|
42
56
|
/** Browser CSS equivalents for ANSI 16 colors */
|
|
43
|
-
export declare const CSS_16_COLORS: Readonly<
|
|
57
|
+
export declare const CSS_16_COLORS: Readonly<{
|
|
58
|
+
black: "#000000";
|
|
59
|
+
red: "#800000";
|
|
60
|
+
green: "#008000";
|
|
61
|
+
yellow: "#808000";
|
|
62
|
+
blue: "#000080";
|
|
63
|
+
purple: "#800080";
|
|
64
|
+
cyan: "#008080";
|
|
65
|
+
white: "#c0c0c0";
|
|
66
|
+
blackBright: "#808080";
|
|
67
|
+
redBright: "#ff0000";
|
|
68
|
+
greenBright: "#00ff00";
|
|
69
|
+
yellowBright: "#ffff00";
|
|
70
|
+
blueBright: "#0000ff";
|
|
71
|
+
purpleBright: "#ff00ff";
|
|
72
|
+
cyanBright: "#00ffff";
|
|
73
|
+
whiteBright: "#ffffff";
|
|
74
|
+
bgBlack: "#000000";
|
|
75
|
+
bgRed: "#800000";
|
|
76
|
+
bgGreen: "#008000";
|
|
77
|
+
bgYellow: "#808000";
|
|
78
|
+
bgBlue: "#000080";
|
|
79
|
+
bgPurple: "#800080";
|
|
80
|
+
bgCyan: "#008080";
|
|
81
|
+
bgWhite: "#c0c0c0";
|
|
82
|
+
bgBlackBright: "#808080";
|
|
83
|
+
bgRedBright: "#ff0000";
|
|
84
|
+
bgGreenBright: "#00ff00";
|
|
85
|
+
bgYellowBright: "#ffff00";
|
|
86
|
+
bgBlueBright: "#0000ff";
|
|
87
|
+
bgPurpleBright: "#ff00ff";
|
|
88
|
+
bgCyanBright: "#00ffff";
|
|
89
|
+
bgWhiteBright: "#ffffff";
|
|
90
|
+
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CountryDetails } from '../object/types';
|
|
2
|
+
/**
|
|
3
|
+
* @function `getCountryByPhone` Get country details by matching the country code in the given phone number.
|
|
4
|
+
* @param phone - The phone number to look up, can be a string or a number. It will be normalized by removing any non-digit character before matching against the country codes.
|
|
5
|
+
* @returns An array of country details that match the provided phone number. Each country detail includes the country name, country code, ISO short code, and ISO code. If the input is invalid (not a primitive value or an empty string), an empty array will be returned.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* - The function uses the {@link COUNTRIES} constant, which is an array of country details, to find matches based on the normalized phone number.
|
|
9
|
+
* - The normalization process removes any non-digit character from the input phone number to ensure consistent matching against the country codes.
|
|
10
|
+
* - The function checks if the input is neither an empty string nor a finite number before proceeding with the normalization and matching process. If the input is invalid, it returns an empty array.
|
|
11
|
+
* - If multiple countries share the same country code, all matching countries will be included in the returned array.
|
|
12
|
+
* - **`IMPORTANT:`** If a phone number does not start with a country code (plain local number), the function will return an empty array since it cannot determine the country. But if the number matches the country code of any country, it will return the corresponding country details even if the number is a local number.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const country = getCountryByPhone('+8801623732187');
|
|
17
|
+
* console.info(country);
|
|
18
|
+
* // Output: [
|
|
19
|
+
* // {
|
|
20
|
+
* // country_name: 'Bangladesh',
|
|
21
|
+
* // country_code: '880',
|
|
22
|
+
* // iso_code_short: 'BD',
|
|
23
|
+
* // iso_code: 'BGD'
|
|
24
|
+
* // }
|
|
25
|
+
* // ]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function getCountryByPhone(phone: number | string): CountryDetails[];
|
|
@@ -97,13 +97,9 @@ export const UNITS = /* @__PURE__ */ Object.freeze({
|
|
|
97
97
|
'long-ton',
|
|
98
98
|
],
|
|
99
99
|
});
|
|
100
|
-
export const IRREGULAR_PLURALS = {
|
|
100
|
+
export const IRREGULAR_PLURALS = /* @__PURE__ */ Object.freeze({
|
|
101
101
|
millennium: 'millennia',
|
|
102
102
|
century: 'centuries',
|
|
103
|
-
};
|
|
104
|
-
export const INVARIANT_UNITS = new Set([
|
|
105
|
-
|
|
106
|
-
'fahrenheit',
|
|
107
|
-
'kelvin',
|
|
108
|
-
]);
|
|
109
|
-
export const Y_TO_IES = new Set(['century']);
|
|
103
|
+
});
|
|
104
|
+
export const INVARIANT_UNITS = /* @__PURE__ */ Object.freeze(new Set(['celsius', 'fahrenheit', 'kelvin']));
|
|
105
|
+
export const Y_TO_IES = /* @__PURE__ */ Object.freeze(new Set(['century']));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { generateQueryParams as createQueryParams, generateQueryParams as formatQueryParams, generateQueryParams, getQueryParams, parseQueryString as getQueryStringAsObject, parseQueryString, parseQueryString as queryStringToObject, parseQueryStringLiteral as literalQueryStringToObject, parseQueryStringLiteral, updateQueryParam, } from './query.js';
|
|
2
|
+
export { getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './storage.js';
|
|
3
|
+
export { copyToClipboard, smoothScrollTo, toggleFullScreen } from './utils.js';
|
package/dist/esm/hash/helpers.js
CHANGED
|
@@ -121,6 +121,21 @@ export function _randomNode48() {
|
|
|
121
121
|
const modified = (firstByte | 0b00000001).toString(16).padStart(2, '0');
|
|
122
122
|
return modified + node.slice(2).join('');
|
|
123
123
|
}
|
|
124
|
+
export function _bytesToRandomHex(bytes) {
|
|
125
|
+
if (crypto?.getRandomValues) {
|
|
126
|
+
crypto.getRandomValues(bytes);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
130
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
let hex = '';
|
|
134
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
135
|
+
hex += bytes[i].toString(16).padStart(2, '0');
|
|
136
|
+
}
|
|
137
|
+
return hex;
|
|
138
|
+
}
|
|
124
139
|
export function _clockSeq14() {
|
|
125
140
|
const seq = parseInt(randomHex(4), 16) & 0x3fff;
|
|
126
141
|
return seq.toString(16).padStart(4, '0');
|
package/dist/esm/hash/utils.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { isHexString } from '../guards/specials.js';
|
|
2
|
-
import { _splitByCharLength } from './helpers.js';
|
|
2
|
+
import { _bytesToRandomHex, _splitByCharLength } from './helpers.js';
|
|
3
3
|
export function randomHex(length, uppercase = false) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if (length <= 0)
|
|
5
|
+
return '';
|
|
6
|
+
const bytes = new Uint8Array(Math.ceil(length / 2));
|
|
7
|
+
const expected = _bytesToRandomHex(bytes).slice(0, length);
|
|
8
|
+
return uppercase ? expected.toUpperCase() : expected;
|
|
7
9
|
}
|
|
8
10
|
export function utf8ToBytes(str) {
|
|
9
11
|
const out = [];
|
package/dist/esm/hash/uuid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isUUID } from '../guards/specials.js';
|
|
2
2
|
import { md5, sha1 } from './core.js';
|
|
3
|
-
import { _checkUUIDVersion, _clockSeq14, _formatUUID, _isOptionV3V5, _randomNode48, _uuidTimestamp, } from './helpers.js';
|
|
3
|
+
import { _bytesToRandomHex, _checkUUIDVersion, _clockSeq14, _formatUUID, _isOptionV3V5, _randomNode48, _uuidTimestamp, } from './helpers.js';
|
|
4
4
|
import { randomHex } from './utils.js';
|
|
5
5
|
export function uuid(options) {
|
|
6
6
|
const { version = 'v4', uppercase = false } = options || {};
|
|
@@ -30,19 +30,7 @@ export function uuid(options) {
|
|
|
30
30
|
throw new Error('v3 requires valid namespace (uuid) and name!');
|
|
31
31
|
}
|
|
32
32
|
case 'v4': {
|
|
33
|
-
const
|
|
34
|
-
if (crypto.getRandomValues) {
|
|
35
|
-
crypto.getRandomValues(bytes);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
for (let i = 0; i < 16; i++) {
|
|
39
|
-
bytes[i] = Math.floor(Math.random() * 256);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
let hex = '';
|
|
43
|
-
for (let i = 0; i < 16; i++) {
|
|
44
|
-
hex += bytes[i].toString(16).padStart(2, '0');
|
|
45
|
-
}
|
|
33
|
+
const hex = _bytesToRandomHex(new Uint8Array(16));
|
|
46
34
|
return _formatUUID(hex, 4, uppercase);
|
|
47
35
|
}
|
|
48
36
|
case 'v5': {
|
|
@@ -81,18 +69,7 @@ export function uuid(options) {
|
|
|
81
69
|
bytes[i] = Number(temp & 0xffn);
|
|
82
70
|
temp >>= 8n;
|
|
83
71
|
}
|
|
84
|
-
|
|
85
|
-
crypto.getRandomValues(bytes);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
for (let i = 6; i < 16; i++) {
|
|
89
|
-
bytes[i] = Math.floor(Math.random() * 256);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
let hex = '';
|
|
93
|
-
for (let i = 0; i < 16; i++) {
|
|
94
|
-
hex += bytes[i].toString(16).padStart(2, '0');
|
|
95
|
-
}
|
|
72
|
+
const hex = _bytesToRandomHex(bytes);
|
|
96
73
|
return _formatUUID(hex, 8, uppercase);
|
|
97
74
|
}
|
|
98
75
|
default:
|
package/dist/esm/index.js
CHANGED
|
@@ -44,11 +44,10 @@ export { cloneObject, countObjectFields, extractObjectKeys as extractKeys, extra
|
|
|
44
44
|
export { extractNewFields, extractUpdatedAndNewFields, extractUpdatedFields, flattenObjectDotNotation, flattenObjectKeyValue, mergeAndFlattenObjects, mergeObjects, parseJsonToObject, } from './object/objectify.js';
|
|
45
45
|
export { parseObjectValues, parseObjectValues as parseStringifiedObjectValues, sanitizeData, } from './object/sanitize.js';
|
|
46
46
|
export { convertObjectValues, deleteFields, deleteFields as deleteObjectFields, deleteFields as omitFields, deleteFields as omitObjectFields, pickFields, pickObjectFieldsByCondition as pickFieldsByCondition, pickFields as pickObjectFields, pickObjectFieldsByCondition, remapFields, remapFields as remapObjectFields, deleteFields as removeFields, deleteFields as removeObjectFields, } from './object/convert.js';
|
|
47
|
-
export {
|
|
48
|
-
export { copyToClipboard, smoothScrollTo, toggleFullScreen } from './dom/utils.js';
|
|
49
|
-
export { getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './dom/storage.js';
|
|
47
|
+
export { createQueryParams, formatQueryParams, generateQueryParams, getQueryParams, getQueryStringAsObject, literalQueryStringToObject, parseQueryString, parseQueryStringLiteral, queryStringToObject, updateQueryParam, copyToClipboard, smoothScrollTo, toggleFullScreen, getFromLocalStorage, getFromSessionStorage, removeFromLocalStorage, removeFromSessionStorage, saveToLocalStorage, saveToSessionStorage, } from './dom/index.js';
|
|
50
48
|
export { convertArrayToString, countInstanceMethods, countStaticMethods, debounceAction, deepParsePrimitives, definePrototypeMethod, getClassDetails, getInstanceGetterNames, getInstanceMethodNames, countInstanceMethods as getInstanceMethodsCount, getStaticGetterNames, getStaticMethodNames, countStaticMethods as getStaticMethodsCount, isDeepEqual, convertArrayToString as joinArrayElements, parseJSON, parseJSON as parseJsonDeep, deepParsePrimitives as parsePrimitivesDeep, stableStringify, stripJsonEdgeGarbage, throttleAction, } from './utils/index.js';
|
|
51
49
|
export { Paginator } from './utils/Paginator.js';
|
|
50
|
+
export { getCountryByPhone } from './utils/xtras.js';
|
|
52
51
|
export { isBigInt, isBoolean, isFalsy, isInteger, isNonEmptyString, isNormalPrimitive, isNull, isNumber, isPositiveInteger, isPrimitive, isString, isSymbol, isTruthy, isUndefined, } from './guards/primitives.js';
|
|
53
52
|
export { isReturningPromise as doesReturnPromise, isArray, isArrayOfType, isValidArray as isArrayWithLength, isDate, isEmptyObject, isEmptyObject as isEmptyObjectGuard, isError, isFunction, isJSON, isJSON as isJSONObject, isMap, isMethodDescriptor as isMethod, isMethodDescriptor, isNotEmptyObject, isObject, isEmptyObject as isObjectEmpty, isObjectWithKeys, isPromise, isRegExp, isRegExp as isRegularExpression, isReturningPromise, isSet, isValidArray, isJSON as isValidJSON, isMap as isValidMap, isNotEmptyObject as isValidObject, isSet as isValidSet, } from './guards/non-primitives.js';
|
|
54
53
|
export { HttpStatus, httpStatus } from './http-status/HttpStatus.js';
|
|
@@ -5,6 +5,7 @@ import { isHex6, isRGB } from '../colors/guards.js';
|
|
|
5
5
|
import { _isValidHue, _isValidPercentage, _isValidRGBComponent } from '../colors/helpers.js';
|
|
6
6
|
import { isNumber, isString } from '../guards/primitives.js';
|
|
7
7
|
import { isBrowser } from '../guards/specials.js';
|
|
8
|
+
import { _logToConsole } from './console.log.js';
|
|
8
9
|
import { ANSI_16_COLORS, ANSI_TEXT_STYLES, CSS_TEXT_STYLES } from './constants.js';
|
|
9
10
|
import { _css16ToHex, _extractColorName, _isAnsi16ColorValue, _isAnsiSequence, _isCSS16Color, } from './helpers.js';
|
|
10
11
|
export function detectColorSupport() {
|
|
@@ -93,50 +94,82 @@ export class LogStyler {
|
|
|
93
94
|
toANSI(input, stringify = false) {
|
|
94
95
|
const stringified = stringify === true ? JSON.stringify(input) : `${input}`;
|
|
95
96
|
let openSeq = '', closeSeq = '';
|
|
97
|
+
let fgOpenSeq = '', bgOpenSeq = '';
|
|
98
|
+
const reopenSequences = new Map();
|
|
96
99
|
for (const style of this.#styles) {
|
|
97
100
|
if (isString(style)) {
|
|
98
101
|
if (isTextStyle(style)) {
|
|
99
102
|
const [open, close] = ANSI_TEXT_STYLES[style];
|
|
100
103
|
openSeq += open;
|
|
101
104
|
closeSeq = close + closeSeq;
|
|
105
|
+
reopenSequences.set(close, (reopenSequences.get(close) ?? '') + open);
|
|
102
106
|
}
|
|
103
107
|
else if (isBGColor(style)) {
|
|
104
108
|
const hex = CSS_COLORS[_extractColorName(style)];
|
|
105
109
|
const [open, close] = hexToAnsi(hex, true);
|
|
106
110
|
openSeq += open;
|
|
107
111
|
closeSeq = close + closeSeq;
|
|
112
|
+
bgOpenSeq = open;
|
|
108
113
|
}
|
|
109
114
|
else if (isCSSColor(style)) {
|
|
110
115
|
const hex = CSS_COLORS[style];
|
|
111
116
|
const [open, close] = hexToAnsi(hex, false);
|
|
112
117
|
openSeq += open;
|
|
113
118
|
closeSeq = close + closeSeq;
|
|
119
|
+
fgOpenSeq = open;
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
else if (_isAnsiSequence(style)) {
|
|
117
123
|
openSeq += style[0];
|
|
118
124
|
closeSeq = style[1] + closeSeq;
|
|
125
|
+
if (style[1] === '\x1b[49m') {
|
|
126
|
+
bgOpenSeq = style[0];
|
|
127
|
+
}
|
|
128
|
+
else if (style[1] === '\x1b[39m') {
|
|
129
|
+
fgOpenSeq = style[0];
|
|
130
|
+
}
|
|
119
131
|
}
|
|
120
132
|
else if (_isAnsi16ColorValue(style)) {
|
|
121
133
|
const [open, close] = style.map((s) => `\x1b[${s}m`);
|
|
122
134
|
openSeq += open;
|
|
123
135
|
closeSeq = close + closeSeq;
|
|
136
|
+
if (close === '\x1b[49m') {
|
|
137
|
+
bgOpenSeq = open;
|
|
138
|
+
}
|
|
139
|
+
else if (close === '\x1b[39m') {
|
|
140
|
+
fgOpenSeq = open;
|
|
141
|
+
}
|
|
124
142
|
}
|
|
125
143
|
}
|
|
126
144
|
if (!detectColorSupport()) {
|
|
127
145
|
return stringified;
|
|
128
146
|
}
|
|
129
147
|
else {
|
|
130
|
-
|
|
148
|
+
let nestedStr = stringified;
|
|
149
|
+
if (nestedStr.includes('\x1b[')) {
|
|
150
|
+
if (fgOpenSeq) {
|
|
151
|
+
nestedStr = nestedStr.replaceAll('\x1b[39m', `\x1b[39m${fgOpenSeq}`);
|
|
152
|
+
}
|
|
153
|
+
if (bgOpenSeq) {
|
|
154
|
+
nestedStr = nestedStr.replaceAll('\x1b[49m', `\x1b[49m${bgOpenSeq}`);
|
|
155
|
+
}
|
|
156
|
+
for (const [close, reopen] of reopenSequences) {
|
|
157
|
+
nestedStr = nestedStr.replaceAll(close, `${close}${reopen}`);
|
|
158
|
+
}
|
|
159
|
+
if (openSeq) {
|
|
160
|
+
nestedStr = nestedStr.replaceAll('\x1b[0m', `\x1b[0m${openSeq}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return openSeq.concat(nestedStr, closeSeq);
|
|
131
164
|
}
|
|
132
165
|
}
|
|
133
166
|
log(input, stringify = false) {
|
|
134
167
|
if (isBrowser()) {
|
|
135
168
|
const [fmt, cssList] = this.toCSS(input, stringify);
|
|
136
|
-
|
|
169
|
+
_logToConsole(fmt, cssList.join(';'));
|
|
137
170
|
}
|
|
138
171
|
else {
|
|
139
|
-
|
|
172
|
+
_logToConsole(this.toANSI(input, stringify));
|
|
140
173
|
}
|
|
141
174
|
}
|
|
142
175
|
#isValidHexOrRGB(color) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { isNonEmptyString, isNumber, isString } from '../guards/primitives.js';
|
|
2
|
+
import { COUNTRIES } from '../object/countries.js';
|
|
3
|
+
export function getCountryByPhone(phone) {
|
|
4
|
+
if (!isNonEmptyString(phone) && !isNumber(phone))
|
|
5
|
+
return [];
|
|
6
|
+
const normalized = (isString(phone) ? phone : String(phone)).replace(/\D/g, '');
|
|
7
|
+
return COUNTRIES.filter((country) => normalized.startsWith(country.country_code.replace(/-/g, '')));
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.30.1",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
},
|
|
45
45
|
"license": "Apache-2.0",
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@biomejs/biome": "^2.4.
|
|
47
|
+
"@biomejs/biome": "^2.4.12",
|
|
48
48
|
"@types/jest": "^30.0.0",
|
|
49
|
-
"@types/node": "^25.
|
|
49
|
+
"@types/node": "^25.6.0",
|
|
50
50
|
"husky": "^9.1.7",
|
|
51
51
|
"jest": "^30.3.0",
|
|
52
52
|
"lint-staged": "^16.4.0",
|
|
53
53
|
"nhb-scripts": "^1.9.2",
|
|
54
54
|
"ts-jest": "^29.4.9",
|
|
55
|
-
"typescript": "^6.0.
|
|
55
|
+
"typescript": "^6.0.3"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"toolbox",
|
|
@@ -164,6 +164,11 @@
|
|
|
164
164
|
"import": "./dist/esm/converter/Converter.js",
|
|
165
165
|
"require": "./dist/cjs/converter/Converter.js"
|
|
166
166
|
},
|
|
167
|
+
"./dom": {
|
|
168
|
+
"types": "./dist/dts/dom/index.d.ts",
|
|
169
|
+
"import": "./dist/esm/dom/index.js",
|
|
170
|
+
"require": "./dist/cjs/dom/index.js"
|
|
171
|
+
},
|
|
167
172
|
"./hash": {
|
|
168
173
|
"types": "./dist/dts/hash/index.d.ts",
|
|
169
174
|
"import": "./dist/esm/hash/index.js",
|
|
@@ -330,6 +335,9 @@
|
|
|
330
335
|
"converter": [
|
|
331
336
|
"dist/dts/converter/Converter.d.ts"
|
|
332
337
|
],
|
|
338
|
+
"dom": [
|
|
339
|
+
"dist/dts/dom/index.d.ts"
|
|
340
|
+
],
|
|
333
341
|
"hash": [
|
|
334
342
|
"dist/dts/hash/index.d.ts"
|
|
335
343
|
],
|