@hypernym/utils 0.2.1 → 0.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/README.md +1 -0
- package/dist/utils.d.ts +10 -5
- package/dist/utils.mjs +5 -3
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -12,10 +12,6 @@ type BuiltIn = Primitive | Date | RegExp;
|
|
|
12
12
|
* Checks if the code is running in the browser.
|
|
13
13
|
*/
|
|
14
14
|
declare const isClient: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* An empty arrow function that performs no operation.
|
|
17
|
-
*/
|
|
18
|
-
declare const noop: () => void;
|
|
19
15
|
/**
|
|
20
16
|
* Returns a boolean if the given value is a `null`.
|
|
21
17
|
*/
|
|
@@ -175,4 +171,13 @@ type RequiredObjectDeep<T extends object, Options extends OptionsDeep = {
|
|
|
175
171
|
[K in keyof T]-?: RequiredDeep<T[K], Options>;
|
|
176
172
|
};
|
|
177
173
|
|
|
178
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Returns a high resolution timestamp in milliseconds using the `performance.now()` method.
|
|
176
|
+
*/
|
|
177
|
+
declare const now: number;
|
|
178
|
+
/**
|
|
179
|
+
* An empty arrow function that performs no operation.
|
|
180
|
+
*/
|
|
181
|
+
declare const noop: () => void;
|
|
182
|
+
|
|
183
|
+
export { BuiltIn, IsAny, IsNever, IsNull, PartialDeep, Primitive, RequiredDeep, isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isElement, isError, isFunction, isHtmlCollection, isHtmlCollectionEmpty, isInfinity, isMap, isNaNValue, isNodeList, isNodeListEmpty, isNull, isNumber, isObject, isObjectEmpty, isPrimitive, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop, now };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const isClient = typeof window !== "undefined";
|
|
1
|
+
const now = performance.now();
|
|
3
2
|
const noop = () => {
|
|
4
3
|
};
|
|
4
|
+
|
|
5
|
+
const getType = (v) => Object.prototype.toString.call(v).slice(8, -1);
|
|
6
|
+
const isClient = typeof window !== "undefined";
|
|
5
7
|
const isNull = (v) => v === null;
|
|
6
8
|
const isUndefined = (v) => typeof v === "undefined";
|
|
7
9
|
const isString = (v) => typeof v === "string";
|
|
@@ -30,4 +32,4 @@ const isNodeListEmpty = (v) => isNodeList(v) && v.length === 0;
|
|
|
30
32
|
const isHtmlCollection = (v) => v instanceof HTMLCollection;
|
|
31
33
|
const isHtmlCollectionEmpty = (v) => isHtmlCollection(v) && v.length === 0;
|
|
32
34
|
|
|
33
|
-
export { isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isElement, isError, isFunction, isHtmlCollection, isHtmlCollectionEmpty, isInfinity, isMap, isNaNValue, isNodeList, isNodeListEmpty, isNull, isNumber, isObject, isObjectEmpty, isPrimitive, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop };
|
|
35
|
+
export { isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isElement, isError, isFunction, isHtmlCollection, isHtmlCollectionEmpty, isInfinity, isMap, isNaNValue, isNodeList, isNodeListEmpty, isNull, isNumber, isObject, isObjectEmpty, isPrimitive, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop, now };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypernym/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Hypernym Studio",
|
|
5
5
|
"description": "A collection of reusable utilities.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
50
50
|
"typescript": "^5.0.4",
|
|
51
51
|
"vite": "^4.3.9",
|
|
52
|
-
"vite-node": "^0.31.
|
|
52
|
+
"vite-node": "^0.31.4"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|