@stryke/types 0.0.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.
Files changed (225) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +295 -0
  3. package/dist/convert/buffer-to-string.cjs +8 -0
  4. package/dist/convert/buffer-to-string.d.ts +1 -0
  5. package/dist/convert/buffer-to-string.mjs +1 -0
  6. package/dist/convert/index.cjs +71 -0
  7. package/dist/convert/index.d.ts +6 -0
  8. package/dist/convert/index.mjs +1 -0
  9. package/dist/convert/string-to-uint8-array.cjs +8 -0
  10. package/dist/convert/string-to-uint8-array.d.ts +7 -0
  11. package/dist/convert/string-to-uint8-array.mjs +1 -0
  12. package/dist/convert/to-array.cjs +9 -0
  13. package/dist/convert/to-array.d.ts +8 -0
  14. package/dist/convert/to-array.mjs +1 -0
  15. package/dist/convert/to-string-key.cjs +9 -0
  16. package/dist/convert/to-string-key.d.ts +7 -0
  17. package/dist/convert/to-string-key.mjs +1 -0
  18. package/dist/convert/uint8-array-to-string.cjs +8 -0
  19. package/dist/convert/uint8-array-to-string.d.ts +13 -0
  20. package/dist/convert/uint8-array-to-string.mjs +1 -0
  21. package/dist/convert/utf8-array-to-string.cjs +8 -0
  22. package/dist/convert/utf8-array-to-string.d.ts +13 -0
  23. package/dist/convert/utf8-array-to-string.mjs +1 -0
  24. package/dist/helpers/index.cjs +16 -0
  25. package/dist/helpers/index.d.ts +1 -0
  26. package/dist/helpers/index.mjs +1 -0
  27. package/dist/helpers/parse-type-definition.cjs +33 -0
  28. package/dist/helpers/parse-type-definition.d.ts +8 -0
  29. package/dist/helpers/parse-type-definition.mjs +1 -0
  30. package/dist/index.cjs +49 -0
  31. package/dist/index.d.ts +12 -0
  32. package/dist/index.mjs +1 -0
  33. package/dist/type-checks/get-object-tag.cjs +8 -0
  34. package/dist/type-checks/get-object-tag.d.ts +7 -0
  35. package/dist/type-checks/get-object-tag.mjs +1 -0
  36. package/dist/type-checks/index.cjs +456 -0
  37. package/dist/type-checks/index.d.ts +41 -0
  38. package/dist/type-checks/index.mjs +1 -0
  39. package/dist/type-checks/is-array-like.cjs +11 -0
  40. package/dist/type-checks/is-array-like.d.ts +7 -0
  41. package/dist/type-checks/is-array-like.mjs +1 -0
  42. package/dist/type-checks/is-async-iterable.cjs +10 -0
  43. package/dist/type-checks/is-async-iterable.d.ts +7 -0
  44. package/dist/type-checks/is-async-iterable.mjs +1 -0
  45. package/dist/type-checks/is-bigint.cjs +9 -0
  46. package/dist/type-checks/is-bigint.d.ts +16 -0
  47. package/dist/type-checks/is-bigint.mjs +1 -0
  48. package/dist/type-checks/is-boolean.cjs +14 -0
  49. package/dist/type-checks/is-boolean.d.ts +7 -0
  50. package/dist/type-checks/is-boolean.mjs +1 -0
  51. package/dist/type-checks/is-buffer.cjs +10 -0
  52. package/dist/type-checks/is-buffer.d.ts +5 -0
  53. package/dist/type-checks/is-buffer.mjs +1 -0
  54. package/dist/type-checks/is-collection.cjs +11 -0
  55. package/dist/type-checks/is-collection.d.ts +8 -0
  56. package/dist/type-checks/is-collection.mjs +1 -0
  57. package/dist/type-checks/is-date.cjs +10 -0
  58. package/dist/type-checks/is-date.d.ts +16 -0
  59. package/dist/type-checks/is-date.mjs +1 -0
  60. package/dist/type-checks/is-deep-key.cjs +26 -0
  61. package/dist/type-checks/is-deep-key.d.ts +35 -0
  62. package/dist/type-checks/is-deep-key.mjs +1 -0
  63. package/dist/type-checks/is-empty-object.cjs +23 -0
  64. package/dist/type-checks/is-empty-object.d.ts +14 -0
  65. package/dist/type-checks/is-empty-object.mjs +1 -0
  66. package/dist/type-checks/is-empty-string.cjs +16 -0
  67. package/dist/type-checks/is-empty-string.d.ts +7 -0
  68. package/dist/type-checks/is-empty-string.mjs +1 -0
  69. package/dist/type-checks/is-empty.cjs +35 -0
  70. package/dist/type-checks/is-empty.d.ts +8 -0
  71. package/dist/type-checks/is-empty.mjs +1 -0
  72. package/dist/type-checks/is-equal.cjs +18 -0
  73. package/dist/type-checks/is-equal.d.ts +1 -0
  74. package/dist/type-checks/is-equal.mjs +1 -0
  75. package/dist/type-checks/is-error.cjs +15 -0
  76. package/dist/type-checks/is-error.d.ts +17 -0
  77. package/dist/type-checks/is-error.mjs +1 -0
  78. package/dist/type-checks/is-file-result.cjs +11 -0
  79. package/dist/type-checks/is-file-result.d.ts +8 -0
  80. package/dist/type-checks/is-file-result.mjs +1 -0
  81. package/dist/type-checks/is-float.cjs +9 -0
  82. package/dist/type-checks/is-float.d.ts +8 -0
  83. package/dist/type-checks/is-float.mjs +1 -0
  84. package/dist/type-checks/is-function.cjs +23 -0
  85. package/dist/type-checks/is-function.d.ts +10 -0
  86. package/dist/type-checks/is-function.mjs +1 -0
  87. package/dist/type-checks/is-integer.cjs +10 -0
  88. package/dist/type-checks/is-integer.d.ts +8 -0
  89. package/dist/type-checks/is-integer.mjs +1 -0
  90. package/dist/type-checks/is-mergeable-object.cjs +14 -0
  91. package/dist/type-checks/is-mergeable-object.d.ts +1 -0
  92. package/dist/type-checks/is-mergeable-object.mjs +1 -0
  93. package/dist/type-checks/is-non-null-object.cjs +10 -0
  94. package/dist/type-checks/is-non-null-object.d.ts +7 -0
  95. package/dist/type-checks/is-non-null-object.mjs +1 -0
  96. package/dist/type-checks/is-not-empty.cjs +17 -0
  97. package/dist/type-checks/is-not-empty.d.ts +7 -0
  98. package/dist/type-checks/is-not-empty.mjs +1 -0
  99. package/dist/type-checks/is-null.cjs +14 -0
  100. package/dist/type-checks/is-null.d.ts +1 -0
  101. package/dist/type-checks/is-null.mjs +1 -0
  102. package/dist/type-checks/is-number.cjs +19 -0
  103. package/dist/type-checks/is-number.d.ts +15 -0
  104. package/dist/type-checks/is-number.mjs +1 -0
  105. package/dist/type-checks/is-object-index.cjs +17 -0
  106. package/dist/type-checks/is-object-index.d.ts +7 -0
  107. package/dist/type-checks/is-object-index.mjs +1 -0
  108. package/dist/type-checks/is-object.cjs +30 -0
  109. package/dist/type-checks/is-object.d.ts +30 -0
  110. package/dist/type-checks/is-object.mjs +1 -0
  111. package/dist/type-checks/is-plain-object.cjs +17 -0
  112. package/dist/type-checks/is-plain-object.d.ts +50 -0
  113. package/dist/type-checks/is-plain-object.mjs +1 -0
  114. package/dist/type-checks/is-primitive.cjs +14 -0
  115. package/dist/type-checks/is-primitive.d.ts +1 -0
  116. package/dist/type-checks/is-primitive.mjs +1 -0
  117. package/dist/type-checks/is-promise.cjs +12 -0
  118. package/dist/type-checks/is-promise.d.ts +17 -0
  119. package/dist/type-checks/is-promise.mjs +1 -0
  120. package/dist/type-checks/is-react-element.cjs +8 -0
  121. package/dist/type-checks/is-react-element.d.ts +1 -0
  122. package/dist/type-checks/is-react-element.mjs +1 -0
  123. package/dist/type-checks/is-ref.cjs +14 -0
  124. package/dist/type-checks/is-ref.d.ts +8 -0
  125. package/dist/type-checks/is-ref.mjs +1 -0
  126. package/dist/type-checks/is-regexp.cjs +10 -0
  127. package/dist/type-checks/is-regexp.d.ts +16 -0
  128. package/dist/type-checks/is-regexp.mjs +1 -0
  129. package/dist/type-checks/is-select-option.cjs +15 -0
  130. package/dist/type-checks/is-select-option.d.ts +8 -0
  131. package/dist/type-checks/is-select-option.mjs +1 -0
  132. package/dist/type-checks/is-set-object.cjs +15 -0
  133. package/dist/type-checks/is-set-object.d.ts +7 -0
  134. package/dist/type-checks/is-set-object.mjs +1 -0
  135. package/dist/type-checks/is-set-string.cjs +16 -0
  136. package/dist/type-checks/is-set-string.d.ts +7 -0
  137. package/dist/type-checks/is-set-string.mjs +1 -0
  138. package/dist/type-checks/is-set.cjs +15 -0
  139. package/dist/type-checks/is-set.d.ts +7 -0
  140. package/dist/type-checks/is-set.mjs +1 -0
  141. package/dist/type-checks/is-string.cjs +14 -0
  142. package/dist/type-checks/is-string.d.ts +1 -0
  143. package/dist/type-checks/is-string.mjs +1 -0
  144. package/dist/type-checks/is-symbol.cjs +14 -0
  145. package/dist/type-checks/is-symbol.d.ts +1 -0
  146. package/dist/type-checks/is-symbol.mjs +1 -0
  147. package/dist/type-checks/is-typed-array.cjs +9 -0
  148. package/dist/type-checks/is-typed-array.d.ts +1 -0
  149. package/dist/type-checks/is-typed-array.mjs +1 -0
  150. package/dist/type-checks/is-typed.cjs +16 -0
  151. package/dist/type-checks/is-typed.d.ts +8 -0
  152. package/dist/type-checks/is-typed.mjs +1 -0
  153. package/dist/type-checks/is-undefined.cjs +8 -0
  154. package/dist/type-checks/is-undefined.d.ts +1 -0
  155. package/dist/type-checks/is-undefined.mjs +1 -0
  156. package/dist/type-checks/property-exists.cjs +17 -0
  157. package/dist/type-checks/property-exists.d.ts +16 -0
  158. package/dist/type-checks/property-exists.mjs +1 -0
  159. package/dist/type-checks/type-detect.cjs +38 -0
  160. package/dist/type-checks/type-detect.d.ts +1 -0
  161. package/dist/type-checks/type-detect.mjs +1 -0
  162. package/dist/utility-types/array.cjs +9 -0
  163. package/dist/utility-types/array.d.ts +130 -0
  164. package/dist/utility-types/array.mjs +1 -0
  165. package/dist/utility-types/async.cjs +1 -0
  166. package/dist/utility-types/async.d.ts +103 -0
  167. package/dist/utility-types/async.mjs +0 -0
  168. package/dist/utility-types/base.cjs +16 -0
  169. package/dist/utility-types/base.d.ts +325 -0
  170. package/dist/utility-types/base.mjs +2 -0
  171. package/dist/utility-types/configuration.cjs +1 -0
  172. package/dist/utility-types/configuration.d.ts +59 -0
  173. package/dist/utility-types/configuration.mjs +0 -0
  174. package/dist/utility-types/file.cjs +12 -0
  175. package/dist/utility-types/file.d.ts +29 -0
  176. package/dist/utility-types/file.mjs +1 -0
  177. package/dist/utility-types/form.cjs +1 -0
  178. package/dist/utility-types/form.d.ts +35 -0
  179. package/dist/utility-types/form.mjs +0 -0
  180. package/dist/utility-types/index.cjs +214 -0
  181. package/dist/utility-types/index.d.ts +19 -0
  182. package/dist/utility-types/index.mjs +1 -0
  183. package/dist/utility-types/json.cjs +1 -0
  184. package/dist/utility-types/json.d.ts +82 -0
  185. package/dist/utility-types/json.mjs +0 -0
  186. package/dist/utility-types/logic.cjs +1 -0
  187. package/dist/utility-types/logic.d.ts +152 -0
  188. package/dist/utility-types/logic.mjs +0 -0
  189. package/dist/utility-types/messages.cjs +13 -0
  190. package/dist/utility-types/messages.d.ts +24 -0
  191. package/dist/utility-types/messages.mjs +1 -0
  192. package/dist/utility-types/navigator.cjs +1 -0
  193. package/dist/utility-types/navigator.d.ts +40 -0
  194. package/dist/utility-types/navigator.mjs +0 -0
  195. package/dist/utility-types/number.cjs +1 -0
  196. package/dist/utility-types/number.d.ts +198 -0
  197. package/dist/utility-types/number.mjs +0 -0
  198. package/dist/utility-types/object.cjs +1 -0
  199. package/dist/utility-types/object.d.ts +434 -0
  200. package/dist/utility-types/object.mjs +0 -0
  201. package/dist/utility-types/package-json.cjs +1 -0
  202. package/dist/utility-types/package-json.d.ts +504 -0
  203. package/dist/utility-types/package-json.mjs +0 -0
  204. package/dist/utility-types/package-manager.cjs +18 -0
  205. package/dist/utility-types/package-manager.d.ts +14 -0
  206. package/dist/utility-types/package-manager.mjs +1 -0
  207. package/dist/utility-types/string.cjs +1 -0
  208. package/dist/utility-types/string.d.ts +87 -0
  209. package/dist/utility-types/string.mjs +0 -0
  210. package/dist/utility-types/system.cjs +1 -0
  211. package/dist/utility-types/system.d.ts +1 -0
  212. package/dist/utility-types/system.mjs +0 -0
  213. package/dist/utility-types/tsconfig.cjs +1 -0
  214. package/dist/utility-types/tsconfig.d.ts +800 -0
  215. package/dist/utility-types/tsconfig.mjs +0 -0
  216. package/dist/utility-types/user.cjs +11 -0
  217. package/dist/utility-types/user.d.ts +30 -0
  218. package/dist/utility-types/user.mjs +1 -0
  219. package/dist/utility-types/utilities.cjs +1 -0
  220. package/dist/utility-types/utilities.d.ts +53 -0
  221. package/dist/utility-types/utilities.mjs +0 -0
  222. package/dist/utility-types/validations.cjs +1 -0
  223. package/dist/utility-types/validations.d.ts +16 -0
  224. package/dist/utility-types/validations.mjs +0 -0
  225. package/package.json +1157 -0
@@ -0,0 +1,41 @@
1
+ export * from "./get-object-tag";
2
+ export * from "./is-array-like";
3
+ export * from "./is-async-iterable";
4
+ export * from "./is-bigint";
5
+ export * from "./is-boolean";
6
+ export * from "./is-buffer";
7
+ export * from "./is-collection";
8
+ export * from "./is-date";
9
+ export * from "./is-deep-key";
10
+ export * from "./is-empty";
11
+ export * from "./is-empty-object";
12
+ export * from "./is-empty-string";
13
+ export * from "./is-equal";
14
+ export * from "./is-error";
15
+ export * from "./is-file-result";
16
+ export * from "./is-float";
17
+ export * from "./is-function";
18
+ export * from "./is-integer";
19
+ export * from "./is-mergeable-object";
20
+ export * from "./is-not-empty";
21
+ export * from "./is-null";
22
+ export * from "./is-number";
23
+ export * from "./is-object";
24
+ export * from "./is-object-index";
25
+ export * from "./is-plain-object";
26
+ export * from "./is-primitive";
27
+ export * from "./is-promise";
28
+ export * from "./is-react-element";
29
+ export * from "./is-ref";
30
+ export * from "./is-regexp";
31
+ export * from "./is-select-option";
32
+ export * from "./is-set";
33
+ export * from "./is-set-object";
34
+ export * from "./is-set-string";
35
+ export * from "./is-string";
36
+ export * from "./is-symbol";
37
+ export * from "./is-typed";
38
+ export * from "./is-typed-array";
39
+ export * from "./is-undefined";
40
+ export * from "./property-exists";
41
+ export * from "./type-detect";
@@ -0,0 +1 @@
1
+ export*from"./get-object-tag";export*from"./is-array-like";export*from"./is-async-iterable";export*from"./is-bigint";export*from"./is-boolean";export*from"./is-buffer";export*from"./is-collection";export*from"./is-date";export*from"./is-deep-key";export*from"./is-empty";export*from"./is-empty-object";export*from"./is-empty-string";export*from"./is-equal";export*from"./is-error";export*from"./is-file-result";export*from"./is-float";export*from"./is-function";export*from"./is-integer";export*from"./is-mergeable-object";export*from"./is-not-empty";export*from"./is-null";export*from"./is-number";export*from"./is-object";export*from"./is-object-index";export*from"./is-plain-object";export*from"./is-primitive";export*from"./is-promise";export*from"./is-react-element";export*from"./is-ref";export*from"./is-regexp";export*from"./is-select-option";export*from"./is-set";export*from"./is-set-object";export*from"./is-set-string";export*from"./is-string";export*from"./is-symbol";export*from"./is-typed";export*from"./is-typed-array";export*from"./is-undefined";export*from"./property-exists";export*from"./type-detect";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isArrayLike = void 0;
7
+ var _isEmpty = require("./is-empty.cjs");
8
+ var _isNumber = require("./is-number.cjs");
9
+ var _isObject = require("./is-object.cjs");
10
+ const isArrayLike = t => (0, _isObject.isObject)(t) && !(0, _isEmpty.isEmpty)(t) && "length" in t && (0, _isNumber.isNumber)(t.length) && (t.length === 0 || t.length > 0 && Object.prototype.hasOwnProperty.call(t, t.length - 1));
11
+ exports.isArrayLike = isArrayLike;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Check if the provided value's type is "array-like"
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the object provided is "array-like"
6
+ */
7
+ export declare const isArrayLike: (value: any) => boolean;
@@ -0,0 +1 @@
1
+ import{isEmpty as r}from"./is-empty";import{isNumber as o}from"./is-number";import{isObject as n}from"./is-object";export const isArrayLike=t=>n(t)&&!r(t)&&"length"in t&&o(t.length)&&(t.length===0||t.length>0&&Object.prototype.hasOwnProperty.call(t,t.length-1));
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAsyncIterable = void 0;
7
+ var _isNull = require("./is-null.cjs");
8
+ var _isObject = require("./is-object.cjs");
9
+ const isAsyncIterable = n => (0, _isObject.isObject)(n) && !(0, _isNull.isNull)(n) && Symbol.asyncIterator in n;
10
+ exports.isAsyncIterable = isAsyncIterable;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Check if the provided value's type is `AsyncIterable`
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the object provided is `AsyncIterable`
6
+ */
7
+ export declare const isAsyncIterable: (value: unknown) => value is AsyncIterable<unknown>;
@@ -0,0 +1 @@
1
+ import{isNull as r}from"./is-null";import{isObject as o}from"./is-object";export const isAsyncIterable=n=>o(n)&&!r(n)&&Symbol.asyncIterator in n;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBigInt = void 0;
7
+ var _getObjectTag = require("./get-object-tag.cjs");
8
+ const isBigInt = t => typeof t == "bigint" || (0, _getObjectTag.getObjectTag)(t) == "[object BigInt]";
9
+ exports.isBigInt = isBigInt;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Checks if `value` is classified as a `bigint` object.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * isDate(37n)
7
+ * // => true
8
+ *
9
+ * isBigInt(37)
10
+ * // => false
11
+ * ```
12
+ *
13
+ * @param value - The obj to check.
14
+ * @returns Returns `true` if `value` is a bigint object, else `false`.
15
+ */
16
+ export declare const isBigInt: (value: unknown) => value is bigint;
@@ -0,0 +1 @@
1
+ import{getObjectTag as i}from"./get-object-tag";export const isBigInt=t=>typeof t=="bigint"||i(t)=="[object BigInt]";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBoolean = void 0;
7
+ const isBoolean = o => {
8
+ try {
9
+ return o instanceof Boolean || typeof o == "boolean" || !!o === o;
10
+ } catch {
11
+ return !1;
12
+ }
13
+ };
14
+ exports.isBoolean = isBoolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Check if the provided value's type is `boolean`
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the value provided is of type `boolean`
6
+ */
7
+ export declare const isBoolean: (value: unknown) => value is boolean;
@@ -0,0 +1 @@
1
+ export const isBoolean=o=>{try{return o instanceof Boolean||typeof o=="boolean"||!!o===o}catch{return!1}};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBufferExists = exports.isBuffer = void 0;
7
+ const isBufferExists = exports.isBufferExists = typeof Buffer < "u",
8
+ isBuffer = exports.isBuffer = isBufferExists ? Buffer.isBuffer.bind(Buffer) : function (e) {
9
+ return !1;
10
+ };
@@ -0,0 +1,5 @@
1
+ export declare const isBufferExists: boolean;
2
+ /**
3
+ * Check if the provided value's type is `Buffer`
4
+ */
5
+ export declare const isBuffer: typeof Buffer.isBuffer;
@@ -0,0 +1 @@
1
+ export const isBufferExists=typeof Buffer<"u",isBuffer=isBufferExists?Buffer.isBuffer.bind(Buffer):function(e){return!1};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isCollection = isCollection;
7
+ var _typeDetect = require("./type-detect.cjs");
8
+ const o = new Set(["Arguments", "Array", "Map", "Object", "Set"]);
9
+ function isCollection(t) {
10
+ return o.has((0, _typeDetect.typeDetect)(t));
11
+ }
@@ -0,0 +1,8 @@
1
+ import { Collection } from "../utility-types/base";
2
+ /**
3
+ * Check if the provided value's type is `Collection`
4
+ *
5
+ * @param value - The value to type check
6
+ * @returns An indicator specifying if the value provided is of type `Collection`
7
+ */
8
+ export declare function isCollection(value: any): value is Collection;
@@ -0,0 +1 @@
1
+ import{typeDetect as e}from"./type-detect";const o=new Set(["Arguments","Array","Map","Object","Set"]);export function isCollection(t){return o.has(e(t))}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isDate = void 0;
7
+ var _getObjectTag = require("./get-object-tag.cjs");
8
+ var _isPlainObject = require("./is-plain-object.cjs");
9
+ const isDate = t => (0, _isPlainObject.isObjectLike)(t) && (0, _getObjectTag.getObjectTag)(t) == "[object Date]";
10
+ exports.isDate = isDate;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Checks if `value` is classified as a `Date` object.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * isDate(new Date)
7
+ * // => true
8
+ *
9
+ * isDate('Mon April 23 2012')
10
+ * // => false
11
+ * ```
12
+ *
13
+ * @param value - The value to check.
14
+ * @returns Returns `true` if `obj` is a date object, else `false`.
15
+ */
16
+ export declare const isDate: (value: unknown) => value is Date;
@@ -0,0 +1 @@
1
+ import{getObjectTag as e}from"./get-object-tag";import{isObjectLike as o}from"./is-plain-object";export const isDate=t=>o(t)&&e(t)=="[object Date]";
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isDeepKey = isDeepKey;
7
+ exports.isKeyOrDeepKey = isKeyOrDeepKey;
8
+ function isDeepKey(e) {
9
+ switch (typeof e) {
10
+ case "number":
11
+ case "symbol":
12
+ return !1;
13
+ case "string":
14
+ return e.includes(".") || e.includes("[") || e.includes("]");
15
+ }
16
+ }
17
+ function isKeyOrDeepKey(e) {
18
+ switch (typeof e) {
19
+ case "number":
20
+ return !0;
21
+ case "symbol":
22
+ return !1;
23
+ case "string":
24
+ return !0;
25
+ }
26
+ }
@@ -0,0 +1,35 @@
1
+ import { DeepKey } from "../utility-types/object";
2
+ /**
3
+ * Checks if a given key is a deep key.
4
+ *
5
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
6
+ *
7
+ * @example
8
+ * isDeepKey('a.b') // true
9
+ * isDeepKey('a[b]') // true
10
+ * isDeepKey('a') // false
11
+ * isDeepKey(123) // false
12
+ * isDeepKey('a.b.c') // true
13
+ * isDeepKey('a[b][c]') // true
14
+ *
15
+ * @param key - The key to check.
16
+ * @returns Returns true if the key is a deep key, otherwise false.
17
+ */
18
+ export declare function isDeepKey(key: PropertyKey): key is DeepKey<any>;
19
+ /**
20
+ * Checks if a given key is a deep key or normal (shallow key).
21
+ *
22
+ * A deep key is a string that contains a dot (.) or square brackets with a property accessor.
23
+ *
24
+ * @example
25
+ * isDeepKey('a.b') // true
26
+ * isDeepKey('a[b]') // true
27
+ * isDeepKey('a') // true
28
+ * isDeepKey(123) // false
29
+ * isDeepKey('a.b.c') // true
30
+ * isDeepKey('a[b][c]') // true
31
+ *
32
+ * @param key - The key to check.
33
+ * @returns Returns true if the key is a deep key, otherwise false.
34
+ */
35
+ export declare function isKeyOrDeepKey(key: PropertyKey): key is DeepKey<any>;
@@ -0,0 +1 @@
1
+ export function isDeepKey(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}export function isKeyOrDeepKey(e){switch(typeof e){case"number":return!0;case"symbol":return!1;case"string":return!0}}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isEmptyOrEmptyObject = exports.isEmptyObject = void 0;
7
+ var _isEmpty = require("./is-empty.cjs");
8
+ const isEmptyObject = t => {
9
+ try {
10
+ return !!t || Object.keys(t ?? {}).length === 0;
11
+ } catch {
12
+ return !0;
13
+ }
14
+ },
15
+ isEmptyOrEmptyObject = t => {
16
+ try {
17
+ return (0, _isEmpty.isEmpty)(t) || isEmptyObject(t);
18
+ } catch {
19
+ return !0;
20
+ }
21
+ };
22
+ exports.isEmptyOrEmptyObject = isEmptyOrEmptyObject;
23
+ exports.isEmptyObject = isEmptyObject;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if the provided value's type is `{}`
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the value provided is of type `{}`
6
+ */
7
+ export declare const isEmptyObject: (value: unknown) => value is {};
8
+ /**
9
+ * Check if the provided value's type is `null` or `undefined` or `{}`
10
+ *
11
+ * @param value - The value to type check
12
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined` or `{}`
13
+ */
14
+ export declare const isEmptyOrEmptyObject: (value: unknown) => boolean;
@@ -0,0 +1 @@
1
+ import{isEmpty as r}from"./is-empty";export const isEmptyObject=t=>{try{return!!t||Object.keys(t??{}).length===0}catch{return!0}},isEmptyOrEmptyObject=t=>{try{return r(t)||isEmptyObject(t)}catch{return!0}};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isEmptyString = void 0;
7
+ var _base = require("../utility-types/base.cjs");
8
+ var _isString = require("./is-string.cjs");
9
+ const isEmptyString = r => {
10
+ try {
11
+ return (0, _isString.isString)(r) && r === _base.EMPTY_STRING;
12
+ } catch {
13
+ return !1;
14
+ }
15
+ };
16
+ exports.isEmptyString = isEmptyString;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Determine if the type is string and is empty
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the value provided is of type `""`
6
+ */
7
+ export declare const isEmptyString: (value: unknown) => value is string;
@@ -0,0 +1 @@
1
+ import{EMPTY_STRING as t}from"../utility-types/base";import{isString as n}from"./is-string";export const isEmptyString=r=>{try{return n(r)&&r===t}catch{return!1}};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isEmptyAnything = exports.isEmpty = void 0;
7
+ var _isDate = require("./is-date.cjs");
8
+ var _isFunction = require("./is-function.cjs");
9
+ var _isNull = require("./is-null.cjs");
10
+ var _isNumber = require("./is-number.cjs");
11
+ var _isSymbol = require("./is-symbol.cjs");
12
+ var _isUndefined = require("./is-undefined.cjs");
13
+ const isEmpty = r => {
14
+ try {
15
+ return (0, _isUndefined.isUndefined)(r) || (0, _isNull.isNull)(r);
16
+ } catch {
17
+ return !1;
18
+ }
19
+ },
20
+ isEmptyAnything = r => {
21
+ if (r === !0 || r === !1 || r == null) return !0;
22
+ if ((0, _isNumber.isNumber)(r)) return r === 0;
23
+ if ((0, _isDate.isDate)(r)) return Number.isNaN(r.getTime());
24
+ if ((0, _isFunction.isFunction)(r) || (0, _isSymbol.isSymbol)(r)) return !1;
25
+ const {
26
+ length: n
27
+ } = r;
28
+ if ((0, _isNumber.isNumber)(n)) return n === 0;
29
+ const {
30
+ size: i
31
+ } = r;
32
+ return (0, _isNumber.isNumber)(i) ? i === 0 : Object.keys(r).length === 0;
33
+ };
34
+ exports.isEmptyAnything = isEmptyAnything;
35
+ exports.isEmpty = isEmpty;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Check if the provided value's type is `null` or `undefined`
3
+ *
4
+ * @param value - The value to type check
5
+ * @returns An indicator specifying if the value provided is of type `null` or `undefined`
6
+ */
7
+ export declare const isEmpty: (value: unknown) => boolean;
8
+ export declare const isEmptyAnything: (value: any) => boolean;
@@ -0,0 +1 @@
1
+ import{isDate as e}from"./is-date";import{isFunction as o}from"./is-function";import{isNull as s}from"./is-null";import{isNumber as t}from"./is-number";import{isSymbol as f}from"./is-symbol";import{isUndefined as m}from"./is-undefined";export const isEmpty=r=>{try{return m(r)||s(r)}catch{return!1}},isEmptyAnything=r=>{if(r===!0||r===!1||r==null)return!0;if(t(r))return r===0;if(e(r))return Number.isNaN(r.getTime());if(o(r)||f(r))return!1;const{length:n}=r;if(t(n))return n===0;const{size:i}=r;return t(i)?i===0:Object.keys(r).length===0};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isEqual = void 0;
7
+ const isEqual = (t, e) => {
8
+ if (Object.is(t, e)) return !0;
9
+ if (t instanceof Date && e instanceof Date) return t.getTime() === e.getTime();
10
+ if (t instanceof RegExp && e instanceof RegExp) return t.toString() === e.toString();
11
+ if (typeof t != "object" || t === null || typeof e != "object" || e === null) return !1;
12
+ const o = Reflect.ownKeys(t),
13
+ s = Reflect.ownKeys(e);
14
+ if (o.length !== s.length) return !1;
15
+ for (const n of o) if (!Reflect.has(e, n) || !isEqual(t[n], e[n])) return !1;
16
+ return !0;
17
+ };
18
+ exports.isEqual = isEqual;
@@ -0,0 +1 @@
1
+ export declare const isEqual: <TType>(x: TType, y: TType) => boolean;
@@ -0,0 +1 @@
1
+ export const isEqual=(t,e)=>{if(Object.is(t,e))return!0;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const o=Reflect.ownKeys(t),s=Reflect.ownKeys(e);if(o.length!==s.length)return!1;for(const n of o)if(!Reflect.has(e,n)||!isEqual(t[n],e[n]))return!1;return!0};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isError = void 0;
7
+ var _getObjectTag = require("./get-object-tag.cjs");
8
+ var _isObject = require("./is-object.cjs");
9
+ var _isPlainObject = require("./is-plain-object.cjs");
10
+ const isError = r => {
11
+ if (!(0, _isObject.isObject)(r)) return !1;
12
+ const t = (0, _getObjectTag.getObjectTag)(r);
13
+ return t === "[object Error]" || t === "[object DOMException]" || typeof r?.message == "string" && typeof r?.name == "string" && !(0, _isPlainObject.isPlainObject)(r);
14
+ };
15
+ exports.isError = isError;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Checks if `obj` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
3
+ * `SyntaxError`, `TypeError`, or `URIError` object.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * isError(new Error)
8
+ * // => true
9
+ *
10
+ * isError(Error)
11
+ * // => false
12
+ * ```
13
+ *
14
+ * @param obj - The obj to check.
15
+ * @returns Returns `true` if `obj` is an error object, else `false`.
16
+ */
17
+ export declare const isError: (obj: unknown) => obj is Error;
@@ -0,0 +1 @@
1
+ import{getObjectTag as o}from"./get-object-tag";import{isObject as e}from"./is-object";import{isPlainObject as s}from"./is-plain-object";export const isError=r=>{if(!e(r))return!1;const t=o(r);return t==="[object Error]"||t==="[object DOMException]"||typeof r?.message=="string"&&typeof r?.name=="string"&&!s(r)};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFileResult = void 0;
7
+ var _file = require("../utility-types/file.cjs");
8
+ var _isSetObject = require("./is-set-object.cjs");
9
+ var _isSetString = require("./is-set-string.cjs");
10
+ const isFileResult = t => (0, _isSetObject.isSetObject)(t) && "status" in t && Object.values(_file.FileStatus).includes(t.status) && ((0, _isSetString.isSetString)(t?.uri) || (0, _isSetObject.isSetObject)(t?.file));
11
+ exports.isFileResult = isFileResult;
@@ -0,0 +1,8 @@
1
+ import { FileResult } from "../utility-types/file";
2
+ /**
3
+ * Check if the provided value is a `FileResult` object
4
+ *
5
+ * @param value - The value to type check
6
+ * @returns An indicator specifying if the value provided is a `FileResult` object
7
+ */
8
+ export declare const isFileResult: (value: any) => value is FileResult;
@@ -0,0 +1 @@
1
+ import{FileStatus as i}from"../utility-types/file";import{isSetObject as s}from"./is-set-object";import{isSetString as e}from"./is-set-string";export const isFileResult=t=>s(t)&&"status"in t&&Object.values(i).includes(t.status)&&(e(t?.uri)||s(t?.file));
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFloat = void 0;
7
+ var _isNumber = require("./is-number.cjs");
8
+ const isFloat = o => (0, _isNumber.isNumber)(o) && o % 1 !== 0;
9
+ exports.isFloat = isFloat;
@@ -0,0 +1,8 @@
1
+ import { Float } from "../utility-types/number";
2
+ /**
3
+ * Check if the provided value's type is a float
4
+ *
5
+ * @param value - The value to type check
6
+ * @returns An indicator specifying if the value provided is of type `number` and is a float
7
+ */
8
+ export declare const isFloat: <T extends number>(value: T) => value is Float<T>;
@@ -0,0 +1 @@
1
+ import{isNumber as t}from"./is-number";export const isFloat=o=>t(o)&&o%1!==0;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAsyncFunction = isAsyncFunction;
7
+ exports.isFunction = void 0;
8
+ exports.isSyncFunction = isSyncFunction;
9
+ var _getObjectTag = require("./get-object-tag.cjs");
10
+ function isSyncFunction(n) {
11
+ return (0, _getObjectTag.getObjectTag)(n) === "[object Function]";
12
+ }
13
+ function isAsyncFunction(n) {
14
+ return (0, _getObjectTag.getObjectTag)(n) === "[object AsyncFunction]";
15
+ }
16
+ const isFunction = n => {
17
+ try {
18
+ return n instanceof Function || typeof n == "function" || !!(n?.constructor && n?.call && n?.apply) || isSyncFunction(n) || isAsyncFunction(n);
19
+ } catch {
20
+ return !1;
21
+ }
22
+ };
23
+ exports.isFunction = isFunction;
@@ -0,0 +1,10 @@
1
+ import { AnyFunction } from "../utility-types/base";
2
+ export declare function isSyncFunction(value?: any): value is AnyFunction;
3
+ export declare function isAsyncFunction(value?: any): value is AnyFunction;
4
+ /**
5
+ * Check if the provided value's type is `Function`
6
+ *
7
+ * @param value - The value to type check
8
+ * @returns An indicator specifying if the value provided is of type `Function`
9
+ */
10
+ export declare const isFunction: (value: unknown) => value is AnyFunction;
@@ -0,0 +1 @@
1
+ import{getObjectTag as t}from"./get-object-tag";export function isSyncFunction(n){return t(n)==="[object Function]"}export function isAsyncFunction(n){return t(n)==="[object AsyncFunction]"}export const isFunction=n=>{try{return n instanceof Function||typeof n=="function"||!!(n?.constructor&&n?.call&&n?.apply)||isSyncFunction(n)||isAsyncFunction(n)}catch{return!1}};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isInteger = void 0;
7
+ var _isNumber = require("./is-number.cjs");
8
+ var _isString = require("./is-string.cjs");
9
+ const isInteger = r => (0, _isNumber.isNumber)(r) && !(0, _isString.isString)(r) && r % 1 === 0;
10
+ exports.isInteger = isInteger;
@@ -0,0 +1,8 @@
1
+ import { Integer } from "../utility-types/number";
2
+ /**
3
+ * Check if the provided value's type is an integer
4
+ *
5
+ * @param value - The value to type check
6
+ * @returns An indicator specifying if the value provided is of type `number` and is an integer
7
+ */
8
+ export declare const isInteger: <T extends number>(value: T) => value is Integer<T>;
@@ -0,0 +1 @@
1
+ import{isNumber as e}from"./is-number";import{isString as t}from"./is-string";export const isInteger=r=>e(r)&&!t(r)&&r%1===0;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isMergeableObject = void 0;
7
+ var _isNonNullObject = require("./is-non-null-object.cjs");
8
+ var _isReactElement = require("./is-react-element.cjs");
9
+ const n = t => {
10
+ const e = Object.prototype.toString.call(t);
11
+ return e === "[object RegExp]" || e === "[object Date]" || (0, _isReactElement.isReactElement)(t);
12
+ };
13
+ const isMergeableObject = t => (0, _isNonNullObject.isNonNullObject)(t) && !n(t);
14
+ exports.isMergeableObject = isMergeableObject;
@@ -0,0 +1 @@
1
+ export declare const isMergeableObject: (value: any) => boolean;
@@ -0,0 +1 @@
1
+ import{isNonNullObject as o}from"./is-non-null-object";import{isReactElement as r}from"./is-react-element";const n=t=>{const e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||r(t)};export const isMergeableObject=t=>o(t)&&!n(t);