nhb-toolbox 4.10.77 → 4.10.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/sort.mjs +3 -3
- package/dist/array/transform.mjs +2 -2
- package/dist/colors/Color.mjs +5 -5
- package/dist/colors/convert.mjs +2 -2
- package/dist/colors/initials.mjs +2 -2
- package/dist/colors/random.mjs +2 -2
- package/dist/colors/utils.mjs +1 -1
- package/dist/date/Chronos.mjs +7 -7
- package/dist/date/greet.mjs +2 -2
- package/dist/date/guards.mjs +2 -2
- package/dist/dom/query.mjs +3 -3
- package/dist/form/convert.mjs +4 -4
- package/dist/form/transform.mjs +2 -2
- package/dist/guards/non-primitives.mjs +1 -1
- package/dist/guards/specials.mjs +2 -2
- package/dist/index.mjs +45 -45
- package/dist/number/Currency.mjs +1 -1
- package/dist/number/Unit.mjs +1 -1
- package/dist/number/basics.mjs +2 -2
- package/dist/number/convert.mjs +2 -2
- package/dist/number/helpers.mjs +1 -1
- package/dist/number/percent.mjs +2 -2
- package/dist/number/range.mjs +6 -6
- package/dist/number/utilities.mjs +1 -1
- package/dist/object/objectify.mjs +3 -3
- package/dist/object/sanitize.mjs +3 -3
- package/dist/string/convert.mjs +2 -2
- package/dist/string/guards.mjs +1 -1
- package/dist/utils/index.mjs +5 -5
- package/package.json +2 -2
package/dist/array/sort.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
isArrayOfType,
|
|
3
3
|
isObject,
|
|
4
4
|
isValidArray
|
|
5
|
-
} from "../guards/non-primitives";
|
|
6
|
-
import { isBoolean, isNumber, isString } from "../guards/primitives";
|
|
7
|
-
import { naturalSort } from "./utils";
|
|
5
|
+
} from "../guards/non-primitives.mjs";
|
|
6
|
+
import { isBoolean, isNumber, isString } from "../guards/primitives.mjs";
|
|
7
|
+
import { naturalSort } from "./utils.mjs";
|
|
8
8
|
function sortAnArray(array, options) {
|
|
9
9
|
if (!isValidArray(array)) return array;
|
|
10
10
|
if (isArrayOfType(array, isString)) {
|
package/dist/array/transform.mjs
CHANGED
package/dist/colors/Color.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { convertColorCode } from "./convert";
|
|
2
|
-
import { CSS_COLORS } from "./css-colors";
|
|
1
|
+
import { convertColorCode } from "./convert.mjs";
|
|
2
|
+
import { CSS_COLORS } from "./css-colors.mjs";
|
|
3
3
|
import {
|
|
4
4
|
_convertOpacityToHex,
|
|
5
5
|
_isHSL,
|
|
6
6
|
_isHSLA,
|
|
7
7
|
_isRGB,
|
|
8
8
|
_isRGBA
|
|
9
|
-
} from "./helpers";
|
|
10
|
-
import { generateRandomHSLColor } from "./random";
|
|
11
|
-
import { extractAlphaColorValues, extractSolidColorValues } from "./utils";
|
|
9
|
+
} from "./helpers.mjs";
|
|
10
|
+
import { generateRandomHSLColor } from "./random.mjs";
|
|
11
|
+
import { extractAlphaColorValues, extractSolidColorValues } from "./utils.mjs";
|
|
12
12
|
const hsl = generateRandomHSLColor();
|
|
13
13
|
const { hex, rgb } = convertColorCode(hsl);
|
|
14
14
|
class Color {
|
package/dist/colors/convert.mjs
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
_isRGB,
|
|
8
8
|
_isRGBA,
|
|
9
9
|
_isValidAlpha
|
|
10
|
-
} from "./helpers";
|
|
11
|
-
import { extractAlphaColorValues, extractSolidColorValues } from "./utils";
|
|
10
|
+
} from "./helpers.mjs";
|
|
11
|
+
import { extractAlphaColorValues, extractSolidColorValues } from "./utils.mjs";
|
|
12
12
|
const convertHslToRgb = (h, s, l) => {
|
|
13
13
|
s /= 100;
|
|
14
14
|
l /= 100;
|
package/dist/colors/initials.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { alphabetColorPalette, numberColorPalette } from "./constants";
|
|
2
|
-
import { _applyOpacity, _convertOpacityToHex } from "./helpers";
|
|
1
|
+
import { alphabetColorPalette, numberColorPalette } from "./constants.mjs";
|
|
2
|
+
import { _applyOpacity, _convertOpacityToHex } from "./helpers.mjs";
|
|
3
3
|
function getColorForInitial(input = "", opacity = 100) {
|
|
4
4
|
let initial;
|
|
5
5
|
const hexOpacity = _convertOpacityToHex(opacity);
|
package/dist/colors/random.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { convertColorCode } from "./convert";
|
|
2
|
-
import { _generateRandomHSL, _isSimilarToLast } from "./helpers";
|
|
1
|
+
import { convertColorCode } from "./convert.mjs";
|
|
2
|
+
import { _generateRandomHSL, _isSimilarToLast } from "./helpers.mjs";
|
|
3
3
|
const generatedColors = /* @__PURE__ */ new Set();
|
|
4
4
|
const recentColors = [];
|
|
5
5
|
const generateRandomHSLColor = (maxColors = 16) => {
|
package/dist/colors/utils.mjs
CHANGED
package/dist/date/Chronos.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isString } from "../guards/primitives";
|
|
2
|
-
import { getOrdinal, roundToNearest } from "../number/utilities";
|
|
3
|
-
import { formatUnitWithPlural } from "../string/convert";
|
|
4
|
-
import { isPalindrome } from "../string/guards";
|
|
1
|
+
import { isString } from "../guards/primitives.mjs";
|
|
2
|
+
import { getOrdinal, roundToNearest } from "../number/utilities.mjs";
|
|
3
|
+
import { formatUnitWithPlural } from "../string/convert.mjs";
|
|
4
|
+
import { isPalindrome } from "../string/guards.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DAYS,
|
|
7
7
|
DEFAULT_RANGES,
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
TIME_ZONE_LABELS,
|
|
12
12
|
TIME_ZONES,
|
|
13
13
|
ZODIAC_SIGNS
|
|
14
|
-
} from "./constants";
|
|
15
|
-
import { isLeapYear, isValidUTCOffSet } from "./guards";
|
|
16
|
-
import { extractMinutesFromUTC, formatUTCOffset } from "./utils";
|
|
14
|
+
} from "./constants.mjs";
|
|
15
|
+
import { isLeapYear, isValidUTCOffSet } from "./guards.mjs";
|
|
16
|
+
import { extractMinutesFromUTC, formatUTCOffset } from "./utils.mjs";
|
|
17
17
|
class Chronos {
|
|
18
18
|
#date;
|
|
19
19
|
#offset;
|
package/dist/date/greet.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isValidTime } from "./guards";
|
|
1
|
+
import { isValidTime } from "./guards.mjs";
|
|
2
2
|
import {
|
|
3
3
|
extractHourMinute,
|
|
4
4
|
getCurrentDateTime,
|
|
5
5
|
getTotalMinutes
|
|
6
|
-
} from "./utils";
|
|
6
|
+
} from "./utils.mjs";
|
|
7
7
|
function getGreeting(configs) {
|
|
8
8
|
const {
|
|
9
9
|
morningEnds = "11:59",
|
package/dist/date/guards.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isString } from "../guards/primitives";
|
|
2
|
-
import { isNumericString } from "../guards/specials";
|
|
1
|
+
import { isString } from "../guards/primitives.mjs";
|
|
2
|
+
import { isNumericString } from "../guards/specials.mjs";
|
|
3
3
|
function isValidTime(value) {
|
|
4
4
|
if (!isString(value)) return false;
|
|
5
5
|
const [hourStr, minuteStr] = value.split(":");
|
package/dist/dom/query.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { flattenObjectKeyValue } from "../object/objectify";
|
|
2
|
-
import { parseObjectValues } from "../object/sanitize";
|
|
3
|
-
import { deepParsePrimitives } from "../utils";
|
|
1
|
+
import { flattenObjectKeyValue } from "../object/objectify.mjs";
|
|
2
|
+
import { parseObjectValues } from "../object/sanitize.mjs";
|
|
3
|
+
import { deepParsePrimitives } from "../utils.mjs";
|
|
4
4
|
const generateQueryParams = (params = {}) => {
|
|
5
5
|
const flattenedParams = flattenObjectKeyValue(params);
|
|
6
6
|
const queryParams = Object.entries(flattenedParams)?.filter(
|
package/dist/form/convert.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isDateLike } from "../date/guards";
|
|
1
|
+
import { isDateLike } from "../date/guards.mjs";
|
|
2
2
|
import {
|
|
3
3
|
isEmptyObject,
|
|
4
4
|
isNotEmptyObject,
|
|
5
5
|
isValidArray
|
|
6
|
-
} from "../guards/non-primitives";
|
|
7
|
-
import { isNonEmptyString } from "../guards/primitives";
|
|
6
|
+
} from "../guards/non-primitives.mjs";
|
|
7
|
+
import { isNonEmptyString } from "../guards/primitives.mjs";
|
|
8
8
|
import {
|
|
9
9
|
isCustomFile,
|
|
10
10
|
isCustomFileArray,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isFileList,
|
|
13
13
|
isFileOrBlob,
|
|
14
14
|
isFileUpload
|
|
15
|
-
} from "./guards";
|
|
15
|
+
} from "./guards.mjs";
|
|
16
16
|
const createControlledFormData = (data, configs) => {
|
|
17
17
|
const formData = new FormData();
|
|
18
18
|
const { stringifyNested = "*" } = configs || {};
|
package/dist/form/transform.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { generateQueryParams } from "../dom/query";
|
|
2
|
-
import { parseObjectValues } from "../object/sanitize";
|
|
1
|
+
import { generateQueryParams } from "../dom/query.mjs";
|
|
2
|
+
import { parseObjectValues } from "../object/sanitize.mjs";
|
|
3
3
|
function serializeForm(form, toQueryString = false) {
|
|
4
4
|
const formData = new FormData(form);
|
|
5
5
|
const data = {};
|
package/dist/guards/specials.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isArray } from "./non-primitives";
|
|
2
|
-
import { isString } from "./primitives";
|
|
1
|
+
import { isArray } from "./non-primitives.mjs";
|
|
2
|
+
import { isString } from "./primitives.mjs";
|
|
3
3
|
function isEmail(value) {
|
|
4
4
|
return isString(value) && /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value);
|
|
5
5
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
generateRandomID,
|
|
4
4
|
trimString,
|
|
5
5
|
truncateString
|
|
6
|
-
} from "./string/basics";
|
|
7
|
-
import { generateAnagrams } from "./string/anagram";
|
|
6
|
+
} from "./string/basics.mjs";
|
|
7
|
+
import { generateAnagrams } from "./string/anagram.mjs";
|
|
8
8
|
import {
|
|
9
9
|
isCamelCase,
|
|
10
10
|
isEmojiOnly,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isPalindrome,
|
|
13
13
|
isPascalCase,
|
|
14
14
|
isSnakeCase
|
|
15
|
-
} from "./string/guards";
|
|
15
|
+
} from "./string/guards.mjs";
|
|
16
16
|
import {
|
|
17
17
|
convertStringCase,
|
|
18
18
|
extractEmails,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
replaceAllInString,
|
|
26
26
|
reverseString,
|
|
27
27
|
slugifyString
|
|
28
|
-
} from "./string/convert";
|
|
28
|
+
} from "./string/convert.mjs";
|
|
29
29
|
import {
|
|
30
30
|
countWords,
|
|
31
31
|
countWords as countWords2,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getLevenshteinDistance as getLevenshteinDistance2,
|
|
36
36
|
extractNumbersFromString as extractNumbersFromString3,
|
|
37
37
|
countWords as countWords3
|
|
38
|
-
} from "./string/utilities";
|
|
38
|
+
} from "./string/utilities.mjs";
|
|
39
39
|
import {
|
|
40
40
|
getAverage,
|
|
41
41
|
calculateHCF,
|
|
@@ -55,10 +55,10 @@ import {
|
|
|
55
55
|
sumDigits,
|
|
56
56
|
sumNumbers as sumNumbers2,
|
|
57
57
|
sumNumbers as sumNumbers3
|
|
58
|
-
} from "./number/basics";
|
|
59
|
-
import { Currency } from "./number/Currency";
|
|
60
|
-
import { Unit, Unit as Unit2 } from "./number/Unit";
|
|
61
|
-
import { calculatePercentage } from "./number/percent";
|
|
58
|
+
} from "./number/basics.mjs";
|
|
59
|
+
import { Currency } from "./number/Currency.mjs";
|
|
60
|
+
import { Unit, Unit as Unit2 } from "./number/Unit.mjs";
|
|
61
|
+
import { calculatePercentage } from "./number/percent.mjs";
|
|
62
62
|
import {
|
|
63
63
|
fibonacciGenerator,
|
|
64
64
|
fibonacciGenerator as fibonacciGenerator2,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
getFibonacciSeriesMemo as getFibonacciSeriesMemo2,
|
|
70
70
|
getFibonacciSeriesMemo as getFibonacciSeriesMemo3,
|
|
71
71
|
getNthFibonacci
|
|
72
|
-
} from "./number/fibonacci";
|
|
72
|
+
} from "./number/fibonacci.mjs";
|
|
73
73
|
import {
|
|
74
74
|
areInvalidNumbers,
|
|
75
75
|
areInvalidNumbers as areInvalidNumbers2,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
isFibonacci as isFibonacci2,
|
|
85
85
|
isFibonacci as isFibonacci3,
|
|
86
86
|
isPerfectSquare
|
|
87
|
-
} from "./number/guards";
|
|
87
|
+
} from "./number/guards.mjs";
|
|
88
88
|
import {
|
|
89
89
|
numberToWords,
|
|
90
90
|
convertToRomanNumerals,
|
|
@@ -94,13 +94,13 @@ import {
|
|
|
94
94
|
convertToRomanNumerals as convertToRomanNumerals4,
|
|
95
95
|
convertToRomanNumerals as convertToRomanNumerals5,
|
|
96
96
|
convertToRomanNumerals as convertToRomanNumerals6
|
|
97
|
-
} from "./number/convert";
|
|
97
|
+
} from "./number/convert.mjs";
|
|
98
98
|
import {
|
|
99
99
|
findPrimeNumbers,
|
|
100
100
|
findPrimeNumbers as findPrimeNumbers2,
|
|
101
101
|
isPrime,
|
|
102
102
|
isPrime as isPrime2
|
|
103
|
-
} from "./number/prime";
|
|
103
|
+
} from "./number/prime.mjs";
|
|
104
104
|
import {
|
|
105
105
|
getOrdinal,
|
|
106
106
|
clampNumber,
|
|
@@ -116,13 +116,13 @@ import {
|
|
|
116
116
|
roundToNearest,
|
|
117
117
|
roundToNearest as roundToNearest2,
|
|
118
118
|
roundToNearest as roundToNearest3
|
|
119
|
-
} from "./number/utilities";
|
|
120
|
-
import { getNumbersInRange } from "./number/range";
|
|
121
|
-
import { getColorForInitial } from "./colors/initials";
|
|
119
|
+
} from "./number/utilities.mjs";
|
|
120
|
+
import { getNumbersInRange } from "./number/range.mjs";
|
|
121
|
+
import { getColorForInitial } from "./colors/initials.mjs";
|
|
122
122
|
import {
|
|
123
123
|
generateRandomColorInHexRGB,
|
|
124
124
|
generateRandomHSLColor
|
|
125
|
-
} from "./colors/random";
|
|
125
|
+
} from "./colors/random.mjs";
|
|
126
126
|
import {
|
|
127
127
|
convertColorCode,
|
|
128
128
|
convertHex8ToHsla,
|
|
@@ -138,17 +138,17 @@ import {
|
|
|
138
138
|
convertRgbToHex,
|
|
139
139
|
convertRgbToHsl,
|
|
140
140
|
convertRgbToRgba
|
|
141
|
-
} from "./colors/convert";
|
|
142
|
-
import { Color, Color as Color2 } from "./colors/Color";
|
|
141
|
+
} from "./colors/convert.mjs";
|
|
142
|
+
import { Color, Color as Color2 } from "./colors/Color.mjs";
|
|
143
143
|
import {
|
|
144
144
|
extractAlphaColorValues,
|
|
145
145
|
extractSolidColorValues
|
|
146
|
-
} from "./colors/utils";
|
|
146
|
+
} from "./colors/utils.mjs";
|
|
147
147
|
import {
|
|
148
148
|
getGreeting,
|
|
149
149
|
getGreeting as getGreeting2,
|
|
150
150
|
getGreeting as getGreeting3
|
|
151
|
-
} from "./date/greet";
|
|
151
|
+
} from "./date/greet.mjs";
|
|
152
152
|
import {
|
|
153
153
|
isDateLike,
|
|
154
154
|
isLeapYear,
|
|
@@ -156,8 +156,8 @@ import {
|
|
|
156
156
|
isValidTime as isValidTime2,
|
|
157
157
|
isValidUTCOffSet,
|
|
158
158
|
isValidUTCOffSet as isValidUTCOffSet2
|
|
159
|
-
} from "./date/guards";
|
|
160
|
-
import { Chronos, Chronos as Chronos2 } from "./date/Chronos";
|
|
159
|
+
} from "./date/guards.mjs";
|
|
160
|
+
import { Chronos, Chronos as Chronos2 } from "./date/Chronos.mjs";
|
|
161
161
|
import {
|
|
162
162
|
chronos,
|
|
163
163
|
chronos as chronos2,
|
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
chronos as chronos4,
|
|
166
166
|
chronos as chronos5,
|
|
167
167
|
chronos as chronos6
|
|
168
|
-
} from "./date/chronos-fn";
|
|
168
|
+
} from "./date/chronos-fn.mjs";
|
|
169
169
|
import {
|
|
170
170
|
formatUTCOffset,
|
|
171
171
|
extractHourMinute,
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
getTotalMinutes as getTotalMinutes3,
|
|
183
183
|
extractMinutesFromUTC as extractMinutesFromUTC3,
|
|
184
184
|
formatUTCOffset as formatUTCOffset3
|
|
185
|
-
} from "./date/utils";
|
|
185
|
+
} from "./date/utils.mjs";
|
|
186
186
|
import {
|
|
187
187
|
filterArrayOfObjects,
|
|
188
188
|
flattenArray,
|
|
@@ -190,9 +190,9 @@ import {
|
|
|
190
190
|
isInvalidOrEmptyArray,
|
|
191
191
|
isInvalidOrEmptyArray as isInvalidOrEmptyArray2,
|
|
192
192
|
shuffleArray
|
|
193
|
-
} from "./array/basics";
|
|
194
|
-
import { Finder } from "./array/Finder";
|
|
195
|
-
import { sortAnArray } from "./array/sort";
|
|
193
|
+
} from "./array/basics.mjs";
|
|
194
|
+
import { Finder } from "./array/Finder.mjs";
|
|
195
|
+
import { sortAnArray } from "./array/sort.mjs";
|
|
196
196
|
import {
|
|
197
197
|
createOptionsArray,
|
|
198
198
|
getDuplicates,
|
|
@@ -207,19 +207,19 @@ import {
|
|
|
207
207
|
removeDuplicatesFromArray as removeDuplicatesFromArray2,
|
|
208
208
|
rotateArray,
|
|
209
209
|
splitArray
|
|
210
|
-
} from "./array/transform";
|
|
210
|
+
} from "./array/transform.mjs";
|
|
211
211
|
import {
|
|
212
212
|
naturalSort,
|
|
213
213
|
naturalSort as naturalSort2,
|
|
214
214
|
naturalSort as naturalSort3,
|
|
215
215
|
naturalSort as naturalSort4
|
|
216
|
-
} from "./array/utils";
|
|
216
|
+
} from "./array/utils.mjs";
|
|
217
217
|
import {
|
|
218
218
|
createControlledFormData,
|
|
219
219
|
createControlledFormData as createControlledFormData2,
|
|
220
220
|
createControlledFormData as createControlledFormData3
|
|
221
|
-
} from "./form/convert";
|
|
222
|
-
import { parseFormData, serializeForm } from "./form/transform";
|
|
221
|
+
} from "./form/convert.mjs";
|
|
222
|
+
import { parseFormData, serializeForm } from "./form/transform.mjs";
|
|
223
223
|
import {
|
|
224
224
|
isCustomFile,
|
|
225
225
|
isCustomFileArray,
|
|
@@ -229,8 +229,8 @@ import {
|
|
|
229
229
|
isFileUpload,
|
|
230
230
|
isOriginFileObj,
|
|
231
231
|
isValidFormData
|
|
232
|
-
} from "./form/guards";
|
|
233
|
-
import { cloneObject, countObjectFields } from "./object/basics";
|
|
232
|
+
} from "./form/guards.mjs";
|
|
233
|
+
import { cloneObject, countObjectFields } from "./object/basics.mjs";
|
|
234
234
|
import {
|
|
235
235
|
extractNewFields,
|
|
236
236
|
extractUpdatedAndNewFields,
|
|
@@ -240,12 +240,12 @@ import {
|
|
|
240
240
|
mergeAndFlattenObjects,
|
|
241
241
|
mergeObjects,
|
|
242
242
|
parseJsonToObject
|
|
243
|
-
} from "./object/objectify";
|
|
243
|
+
} from "./object/objectify.mjs";
|
|
244
244
|
import {
|
|
245
245
|
parseObjectValues,
|
|
246
246
|
parseObjectValues as parseObjectValues2,
|
|
247
247
|
sanitizeData
|
|
248
|
-
} from "./object/sanitize";
|
|
248
|
+
} from "./object/sanitize.mjs";
|
|
249
249
|
import {
|
|
250
250
|
convertObjectValues,
|
|
251
251
|
pickFields,
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
pickObjectFieldsByCondition as pickObjectFieldsByCondition2,
|
|
255
255
|
remapFields,
|
|
256
256
|
remapFields as remapFields2
|
|
257
|
-
} from "./object/convert";
|
|
257
|
+
} from "./object/convert.mjs";
|
|
258
258
|
import {
|
|
259
259
|
generateQueryParams,
|
|
260
260
|
generateQueryParams as generateQueryParams2,
|
|
@@ -264,8 +264,8 @@ import {
|
|
|
264
264
|
parseQueryString as parseQueryString2,
|
|
265
265
|
parseQueryString as parseQueryString3,
|
|
266
266
|
updateQueryParam
|
|
267
|
-
} from "./dom/query";
|
|
268
|
-
import { copyToClipboard, smoothScrollTo, toggleFullScreen } from "./dom/utils";
|
|
267
|
+
} from "./dom/query.mjs";
|
|
268
|
+
import { copyToClipboard, smoothScrollTo, toggleFullScreen } from "./dom/utils.mjs";
|
|
269
269
|
import {
|
|
270
270
|
getFromLocalStorage,
|
|
271
271
|
getFromSessionStorage,
|
|
@@ -273,7 +273,7 @@ import {
|
|
|
273
273
|
removeFromSessionStorage,
|
|
274
274
|
saveToLocalStorage,
|
|
275
275
|
saveToSessionStorage
|
|
276
|
-
} from "./dom/storage";
|
|
276
|
+
} from "./dom/storage.mjs";
|
|
277
277
|
import {
|
|
278
278
|
convertArrayToString,
|
|
279
279
|
countInstanceMethods,
|
|
@@ -290,8 +290,8 @@ import {
|
|
|
290
290
|
parseJSON as parseJSON2,
|
|
291
291
|
deepParsePrimitives as deepParsePrimitives2,
|
|
292
292
|
throttleAction
|
|
293
|
-
} from "./utils";
|
|
294
|
-
import { Paginator } from "./utils/Paginator";
|
|
293
|
+
} from "./utils.mjs";
|
|
294
|
+
import { Paginator } from "./utils/Paginator.mjs";
|
|
295
295
|
import {
|
|
296
296
|
isBigInt,
|
|
297
297
|
isBoolean,
|
|
@@ -307,7 +307,7 @@ import {
|
|
|
307
307
|
isSymbol,
|
|
308
308
|
isTruthy,
|
|
309
309
|
isUndefined
|
|
310
|
-
} from "./guards/primitives";
|
|
310
|
+
} from "./guards/primitives.mjs";
|
|
311
311
|
import {
|
|
312
312
|
isReturningPromise,
|
|
313
313
|
isArray,
|
|
@@ -337,7 +337,7 @@ import {
|
|
|
337
337
|
isMap as isMap2,
|
|
338
338
|
isNotEmptyObject as isNotEmptyObject2,
|
|
339
339
|
isSet as isSet2
|
|
340
|
-
} from "./guards/non-primitives";
|
|
340
|
+
} from "./guards/non-primitives.mjs";
|
|
341
341
|
import {
|
|
342
342
|
isBase64,
|
|
343
343
|
isBrowser,
|
|
@@ -356,7 +356,7 @@ import {
|
|
|
356
356
|
isUUID,
|
|
357
357
|
isEmail as isEmail2,
|
|
358
358
|
isURL as isURL2
|
|
359
|
-
} from "./guards/specials";
|
|
359
|
+
} from "./guards/specials.mjs";
|
|
360
360
|
export {
|
|
361
361
|
Chronos,
|
|
362
362
|
Chronos2 as Chronus,
|
package/dist/number/Currency.mjs
CHANGED
package/dist/number/Unit.mjs
CHANGED
package/dist/number/basics.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isNumber } from "../guards/primitives";
|
|
2
|
-
import { _find2NumbersHCF, _find2NumbersLCM } from "./helpers";
|
|
1
|
+
import { isNumber } from "../guards/primitives.mjs";
|
|
2
|
+
import { _find2NumbersHCF, _find2NumbersLCM } from "./helpers.mjs";
|
|
3
3
|
const getRandomNumber = (options) => {
|
|
4
4
|
const {
|
|
5
5
|
min = 0,
|
package/dist/number/convert.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { THOUSANDS } from "./constants";
|
|
2
|
-
import { _convertLessThanThousand } from "./helpers";
|
|
1
|
+
import { THOUSANDS } from "./constants.mjs";
|
|
2
|
+
import { _convertLessThanThousand } from "./helpers.mjs";
|
|
3
3
|
function numberToWords(num) {
|
|
4
4
|
let number = Math.trunc(Number(num));
|
|
5
5
|
if (!Number.isFinite(number) || isNaN(number)) {
|
package/dist/number/helpers.mjs
CHANGED
package/dist/number/percent.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getAverage } from "./basics";
|
|
2
|
-
import { areInvalidNumbers } from "./guards";
|
|
1
|
+
import { getAverage } from "./basics.mjs";
|
|
2
|
+
import { areInvalidNumbers } from "./guards.mjs";
|
|
3
3
|
function calculatePercentage(options) {
|
|
4
4
|
const { roundTo = 3 } = options;
|
|
5
5
|
const _roundNumber = (num) => {
|
package/dist/number/range.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { shuffleArray } from "../array/basics";
|
|
2
|
-
import { convertArrayToString } from "../utils";
|
|
3
|
-
import { getRandomNumber } from "./basics";
|
|
4
|
-
import { isEven, isOdd } from "./guards";
|
|
5
|
-
import { _applyMultiples } from "./helpers";
|
|
6
|
-
import { isPrime } from "./prime";
|
|
1
|
+
import { shuffleArray } from "../array/basics.mjs";
|
|
2
|
+
import { convertArrayToString } from "../utils.mjs";
|
|
3
|
+
import { getRandomNumber } from "./basics.mjs";
|
|
4
|
+
import { isEven, isOdd } from "./guards.mjs";
|
|
5
|
+
import { _applyMultiples } from "./helpers.mjs";
|
|
6
|
+
import { isPrime } from "./prime.mjs";
|
|
7
7
|
function getNumbersInRange(type = "any", options) {
|
|
8
8
|
const {
|
|
9
9
|
getAsString = false,
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
isEmptyObject,
|
|
3
3
|
isNotEmptyObject,
|
|
4
4
|
isObject
|
|
5
|
-
} from "../guards/non-primitives";
|
|
6
|
-
import { isDeepEqual } from "../utils";
|
|
7
|
-
import { parseObjectValues } from "./sanitize";
|
|
5
|
+
} from "../guards/non-primitives.mjs";
|
|
6
|
+
import { isDeepEqual } from "../utils.mjs";
|
|
7
|
+
import { parseObjectValues } from "./sanitize.mjs";
|
|
8
8
|
const mergeObjects = (...objects) => {
|
|
9
9
|
const map = /* @__PURE__ */ new Map();
|
|
10
10
|
objects?.forEach((obj) => {
|
package/dist/object/sanitize.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
isArrayOfType,
|
|
3
3
|
isNotEmptyObject,
|
|
4
4
|
isObject
|
|
5
|
-
} from "../guards/non-primitives";
|
|
6
|
-
import { isString } from "../guards/primitives";
|
|
7
|
-
import { trimString } from "../string/basics";
|
|
5
|
+
} from "../guards/non-primitives.mjs";
|
|
6
|
+
import { isString } from "../guards/primitives.mjs";
|
|
7
|
+
import { trimString } from "../string/basics.mjs";
|
|
8
8
|
function sanitizeData(input, options, _return) {
|
|
9
9
|
const {
|
|
10
10
|
keysToIgnore = [],
|
package/dist/string/convert.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { trimString } from "./basics";
|
|
2
|
-
import { LOWERCASE } from "./constants";
|
|
1
|
+
import { trimString } from "./basics.mjs";
|
|
2
|
+
import { LOWERCASE } from "./constants.mjs";
|
|
3
3
|
function convertStringCase(string, format) {
|
|
4
4
|
if (!string || typeof string !== "string") return "";
|
|
5
5
|
const start = string?.match(/^[^\d\w\s]+/)?.[0] || "";
|
package/dist/string/guards.mjs
CHANGED
package/dist/utils/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isInvalidOrEmptyArray } from "../array/basics";
|
|
2
|
-
import { sortAnArray } from "../array/sort";
|
|
3
|
-
import { isMethodDescriptor, isObject } from "../guards/non-primitives";
|
|
4
|
-
import { isString } from "../guards/primitives";
|
|
5
|
-
import { isNumericString } from "../guards/specials";
|
|
1
|
+
import { isInvalidOrEmptyArray } from "../array/basics.mjs";
|
|
2
|
+
import { sortAnArray } from "../array/sort.mjs";
|
|
3
|
+
import { isMethodDescriptor, isObject } from "../guards/non-primitives.mjs";
|
|
4
|
+
import { isString } from "../guards/primitives.mjs";
|
|
5
|
+
import { isNumericString } from "../guards/specials.mjs";
|
|
6
6
|
const isDeepEqual = (a, b) => {
|
|
7
7
|
if (a === b) return true;
|
|
8
8
|
if (typeof a !== typeof b) return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.80",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
},
|
|
153
153
|
"scripts": {
|
|
154
154
|
"clean": "rimraf dist",
|
|
155
|
-
"build": "tsup --config tsup.config.ts && node scripts/types.mjs && prettier --write .",
|
|
155
|
+
"build": "tsup --config tsup.config.ts && node scripts/extensions.mjs node scripts/types.mjs && prettier --write .",
|
|
156
156
|
"test": "jest --coverage --verbose",
|
|
157
157
|
"format": "prettier --write .",
|
|
158
158
|
"lint": "node scripts/lint.mjs",
|