@heyform-inc/utils 1.2.2 → 1.3.0
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/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -18
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export * from 'deep-object-diff';
|
|
2
2
|
import { parse, stringify } from 'qs';
|
|
3
3
|
export { default as qs } from 'qs';
|
|
4
|
-
import
|
|
4
|
+
import _isEmail from 'validator/lib/isEmail';
|
|
5
5
|
import _isFQDN from 'validator/lib/isFQDN';
|
|
6
6
|
import _isNumeric from 'validator/lib/isNumeric';
|
|
7
|
-
import _isEmail from 'validator/lib/isEmail';
|
|
8
7
|
import _isURL from 'validator/lib/isURL';
|
|
8
|
+
import _isUUID from 'validator/lib/isUUID';
|
|
9
9
|
import _clone from 'clone';
|
|
10
|
+
import { clsx as clsx$1 } from 'clsx';
|
|
11
|
+
import { twMerge } from 'tailwind-merge';
|
|
10
12
|
import { convert } from 'html-to-text';
|
|
11
|
-
import _ms from 'ms';
|
|
12
13
|
import _dayjs from 'dayjs';
|
|
14
|
+
import _ms from 'ms';
|
|
13
15
|
import { customAlphabet } from 'nanoid';
|
|
14
16
|
import * as objectPath from 'object-path';
|
|
15
17
|
export { deepEqual } from 'fast-equals';
|
|
@@ -270,6 +272,9 @@ function formatBytes(value) {
|
|
|
270
272
|
function clone(obj) {
|
|
271
273
|
return _clone(obj);
|
|
272
274
|
}
|
|
275
|
+
function clsx(...inputs) {
|
|
276
|
+
return twMerge(clsx$1(inputs));
|
|
277
|
+
}
|
|
273
278
|
|
|
274
279
|
// src/color.ts
|
|
275
280
|
var HEX_REGEX = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
|
|
@@ -349,9 +354,7 @@ function alphaHexToRgb(hex, alpha2, backgroundHex) {
|
|
|
349
354
|
const backgroundRgb = hexToRgb(backgroundHex);
|
|
350
355
|
return hexRgb.map((color, index) => {
|
|
351
356
|
return colorRange(
|
|
352
|
-
Math.floor(
|
|
353
|
-
colorRange(color) * alpha2 + colorRange(backgroundRgb[index]) * (1 - alpha2)
|
|
354
|
-
)
|
|
357
|
+
Math.floor(colorRange(color) * alpha2 + colorRange(backgroundRgb[index]) * (1 - alpha2))
|
|
355
358
|
);
|
|
356
359
|
});
|
|
357
360
|
}
|
|
@@ -515,13 +518,15 @@ function ms(arg) {
|
|
|
515
518
|
}
|
|
516
519
|
var toSecond = hs;
|
|
517
520
|
var toMillisecond = ms;
|
|
521
|
+
|
|
522
|
+
// src/date.ts
|
|
518
523
|
function timestamp() {
|
|
519
524
|
return Math.floor(Date.now() / 1e3);
|
|
520
525
|
}
|
|
521
526
|
var dayjs = _dayjs;
|
|
522
527
|
var date = dayjs;
|
|
523
528
|
function unixDate(t) {
|
|
524
|
-
return
|
|
529
|
+
return dayjs.unix(t);
|
|
525
530
|
}
|
|
526
531
|
function isDateExpired(start, end, expire) {
|
|
527
532
|
return end - start > hs(expire);
|
|
@@ -1922,6 +1927,6 @@ function slugify(text, options) {
|
|
|
1922
1927
|
});
|
|
1923
1928
|
}
|
|
1924
1929
|
|
|
1925
|
-
export { FILE_MIME_TYPES, IMAGE_MIME_TYPES, RandomType, alpha, alphaHexToRgb, bytes, clone, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, dayjs, excludeObject, formatBytes, helper_default as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, toDuration, toFixed, toFloat, toInt, toInteger, toIntlNumber, toJSON, toMillisecond, toSecond, toURLParams, toURLQuery, type, unixDate, unixDiff };
|
|
1926
|
-
//# sourceMappingURL=
|
|
1930
|
+
export { FILE_MIME_TYPES, IMAGE_MIME_TYPES, RandomType, alpha, alphaHexToRgb, bytes, clone, clsx, colorBrightness, commonFileMimeTypes, commonImageMimeTypes, copyObjectValues, darken, date, datePeriod, dayjs, excludeObject, formatBytes, helper_default as helper, hexToRgb, hs, htmlToText, invert, isDarkColor, isDateExpired, isHexColor, isLightColor, isRgb, isRgba, lighten, mime, ms, nanoid, nanoidCustomAlphabet, parseBool, parseBytes, parseJson, parseNumber, pickObject, pickValidValues, random, removeObjectNil, rgbToHex, slugify, timestamp, toBool, toDuration, toFixed, toFloat, toInt, toInteger, toIntlNumber, toJSON, toMillisecond, toSecond, toURLParams, toURLQuery, type, unixDate, unixDiff };
|
|
1931
|
+
//# sourceMappingURL=index.mjs.map
|
|
1927
1932
|
//# sourceMappingURL=index.mjs.map
|