@giveback007/util-lib 0.23.2 → 0.24.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/dist/general.d.ts +1 -1
- package/dist/general.js +3 -3
- package/package.json +1 -1
- package/src/general.ts +1 -1
package/dist/general.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const cloneLog: (x: any) => void;
|
|
|
22
22
|
/** An improved version of native `typeof` */
|
|
23
23
|
export declare function type(val: any): JsType;
|
|
24
24
|
export declare function assertType<T extends JsType>(val: any, types: T | T[]): asserts val is T;
|
|
25
|
-
export declare const
|
|
25
|
+
export declare const uuid: () => string;
|
|
26
26
|
export declare const randomColorHex: () => string;
|
|
27
27
|
export declare function debounceTimeOut(): (fct: Function | 'cancel', ms?: number | undefined) => void;
|
|
28
28
|
export declare function promiseOut<T = any>(): {
|
package/dist/general.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promiseOut = exports.debounceTimeOut = exports.randomColorHex = exports.
|
|
3
|
+
exports.promiseOut = exports.debounceTimeOut = exports.randomColorHex = exports.uuid = exports.assertType = exports.type = exports.cloneLog = exports.unsubAll = exports.wait = exports.interval = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
@@ -73,7 +73,7 @@ function assertType(val, types) {
|
|
|
73
73
|
throw Error(`value needs to be of type ${types.join(' || ')}`);
|
|
74
74
|
}
|
|
75
75
|
exports.assertType = assertType;
|
|
76
|
-
const
|
|
76
|
+
const uuid = () => {
|
|
77
77
|
let d = new Date().getTime();
|
|
78
78
|
let d2 = (performance
|
|
79
79
|
&&
|
|
@@ -94,7 +94,7 @@ const uiid = () => {
|
|
|
94
94
|
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
|
-
exports.
|
|
97
|
+
exports.uuid = uuid;
|
|
98
98
|
const randomColorHex = () => '#' + ((1 << 24) * Math.random() | 0).toString(16);
|
|
99
99
|
exports.randomColorHex = randomColorHex;
|
|
100
100
|
// export const jsonp = async <T = any>(
|
package/package.json
CHANGED
package/src/general.ts
CHANGED