@hypernym/utils 0.0.1 → 0.1.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/utils.d.ts CHANGED
@@ -100,6 +100,22 @@ declare const isURL: (v: any) => v is URL;
100
100
  * Returns a boolean if the given value is a `Error`.
101
101
  */
102
102
  declare const isError: (v: any) => v is Error;
103
+ /**
104
+ * Returns a boolean if the given value is a `Primitive`.
105
+ */
106
+ declare const isPrimitive: (v: any) => v is Primitive;
107
+ /**
108
+ * Returns a boolean if the given value is a `Element`.
109
+ */
110
+ declare const isElement: (v: any) => v is Element;
111
+ /**
112
+ * Returns a boolean if the given value is a `NodeList`.
113
+ */
114
+ declare const isNodeList: (v: any) => v is NodeList;
115
+ /**
116
+ * Returns a boolean if the given value is a `HTMLCollection`.
117
+ */
118
+ declare const isHtmlCollection: (v: any) => v is HTMLCollection;
103
119
 
104
120
  /**
105
121
  * Returns a boolean if the given type is a `null`.
@@ -151,4 +167,4 @@ type RequiredObjectDeep<T extends object, Options extends OptionsDeep = {
151
167
  [K in keyof T]-?: RequiredDeep<T[K], Options>;
152
168
  };
153
169
 
154
- export { BuiltIn, IsAny, IsNever, IsNull, PartialDeep, Primitive, RequiredDeep, isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isError, isFunction, isInfinity, isMap, isNaNValue, isNull, isNumber, isObject, isObjectEmpty, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop };
170
+ export { BuiltIn, IsAny, IsNever, IsNull, PartialDeep, Primitive, RequiredDeep, isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isElement, isError, isFunction, isHtmlCollection, isInfinity, isMap, isNaNValue, isNodeList, isNull, isNumber, isObject, isObjectEmpty, isPrimitive, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop };
package/dist/utils.mjs CHANGED
@@ -23,5 +23,9 @@ const isBigint = (v) => typeof v === "bigint";
23
23
  const isInfinity = (v) => v === Infinity || v === -Infinity;
24
24
  const isURL = (v) => v instanceof URL;
25
25
  const isError = (v) => v instanceof Error;
26
+ const isPrimitive = (v) => isString(v) || isNumber(v) || isBigint(v) || isBoolean(v) || isSymbol(v) || isNull(v) || isUndefined(v);
27
+ const isElement = (v) => v instanceof Element;
28
+ const isNodeList = (v) => v instanceof NodeList;
29
+ const isHtmlCollection = (v) => v instanceof HTMLCollection;
26
30
 
27
- export { isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isError, isFunction, isInfinity, isMap, isNaNValue, isNull, isNumber, isObject, isObjectEmpty, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop };
31
+ export { isArray, isArrayEmpty, isBigint, isBoolean, isClient, isDate, isElement, isError, isFunction, isHtmlCollection, isInfinity, isMap, isNaNValue, isNodeList, isNull, isNumber, isObject, isObjectEmpty, isPrimitive, isRegExp, isSet, isString, isStringEmpty, isSymbol, isURL, isUndefined, noop };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypernym/utils",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "author": "Hypernym Studio",
5
5
  "description": "A collection of reusable utilities.",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "fix": "eslint --fix ."
38
38
  },
39
39
  "devDependencies": {
40
- "@types/node": "^20.2.3",
40
+ "@types/node": "^20.2.4",
41
41
  "@typescript-eslint/eslint-plugin": "^5.59.5",
42
42
  "@typescript-eslint/parser": "^5.59.5",
43
43
  "eslint": "^8.41.0",
@@ -47,7 +47,7 @@
47
47
  "rollup-plugin-dts": "^5.3.0",
48
48
  "rollup-plugin-esbuild": "^5.0.0",
49
49
  "typescript": "^5.0.4",
50
- "vite": "^4.3.5",
50
+ "vite": "^4.3.9",
51
51
  "vite-node": "^0.31.1"
52
52
  },
53
53
  "publishConfig": {