yummies 5.7.1 → 5.8.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.
Files changed (391) hide show
  1. package/async.js +26 -59
  2. package/async.js.map +1 -0
  3. package/common.d.ts +1 -1
  4. package/common.d.ts.map +1 -1
  5. package/common.js +5 -13
  6. package/common.js.map +1 -0
  7. package/complex/global-config.d.ts +1 -1
  8. package/complex/global-config.d.ts.map +1 -1
  9. package/complex/index.d.ts +3 -3
  10. package/complex/index.d.ts.map +1 -1
  11. package/complex/modules-factory.d.ts +1 -1
  12. package/complex/modules-factory.d.ts.map +1 -1
  13. package/complex.js +66 -0
  14. package/complex.js.map +1 -0
  15. package/cookie.d.ts +1 -1
  16. package/cookie.d.ts.map +1 -1
  17. package/cookie.js +4 -8
  18. package/cookie.js.map +1 -0
  19. package/css.d.ts +1 -1
  20. package/css.js +2780 -49
  21. package/css.js.map +1 -0
  22. package/data.js +32 -50
  23. package/data.js.map +1 -0
  24. package/date-time.d.ts +2 -3
  25. package/date-time.d.ts.map +1 -1
  26. package/date-time.js +588 -154
  27. package/date-time.js.map +1 -0
  28. package/device.js +23 -20
  29. package/device.js.map +1 -0
  30. package/encodings.js +269 -265
  31. package/encodings.js.map +1 -0
  32. package/errors.d.ts +1 -1
  33. package/errors.d.ts.map +1 -1
  34. package/errors.js +8 -29
  35. package/errors.js.map +1 -0
  36. package/file.js +19 -23
  37. package/file.js.map +1 -0
  38. package/format/_exports.d.ts +4 -4
  39. package/format/_exports.d.ts.map +1 -1
  40. package/format/index.d.ts +1 -1
  41. package/format/index.d.ts.map +1 -1
  42. package/format/number.d.ts +1 -1
  43. package/format/number.d.ts.map +1 -1
  44. package/format/percent.d.ts +2 -2
  45. package/format/percent.d.ts.map +1 -1
  46. package/format.js +27 -0
  47. package/format.js.map +1 -0
  48. package/html.d.ts +2 -2
  49. package/html.d.ts.map +1 -1
  50. package/html.js +636 -169
  51. package/html.js.map +1 -0
  52. package/id.js +25 -70
  53. package/id.js.map +1 -0
  54. package/imports.js +22 -37
  55. package/imports.js.map +1 -0
  56. package/math.d.ts +1 -1
  57. package/math.d.ts.map +1 -1
  58. package/math.js +10 -14
  59. package/math.js.map +1 -0
  60. package/media.js +54 -96
  61. package/media.js.map +1 -0
  62. package/mobx/apply-observable.d.ts +1 -1
  63. package/mobx/apply-observable.d.ts.map +1 -1
  64. package/mobx/create-enhanced-atom.d.ts +2 -2
  65. package/mobx/create-enhanced-atom.d.ts.map +1 -1
  66. package/mobx/deep-observable-struct.d.ts +1 -1
  67. package/mobx/deep-observable-struct.d.ts.map +1 -1
  68. package/mobx/get-mobx-administration.d.ts +2 -2
  69. package/mobx/get-mobx-administration.d.ts.map +1 -1
  70. package/mobx/index.d.ts +5 -5
  71. package/mobx/index.d.ts.map +1 -1
  72. package/mobx.js +89 -0
  73. package/mobx.js.map +1 -0
  74. package/ms.js +12 -17
  75. package/ms.js.map +1 -0
  76. package/number.js +9 -12
  77. package/number.js.map +1 -0
  78. package/package.json +93 -92
  79. package/parser/_exports.d.ts +3 -3
  80. package/parser/_exports.d.ts.map +1 -1
  81. package/parser/index.d.ts +1 -1
  82. package/parser/index.d.ts.map +1 -1
  83. package/parser/number.d.ts +1 -1
  84. package/parser/number.d.ts.map +1 -1
  85. package/parser/percent.d.ts +2 -2
  86. package/parser/percent.d.ts.map +1 -1
  87. package/parser/string.d.ts +1 -1
  88. package/parser/string.d.ts.map +1 -1
  89. package/parser.js +15 -0
  90. package/parser.js.map +1 -0
  91. package/price.js +13 -16
  92. package/price.js.map +1 -0
  93. package/random.js +11 -13
  94. package/random.js.map +1 -0
  95. package/react/hooks/index.d.ts +21 -21
  96. package/react/hooks/index.d.ts.map +1 -1
  97. package/react/hooks/use-click-outside.d.ts +1 -1
  98. package/react/hooks/use-define-ref.d.ts +1 -1
  99. package/react/hooks/use-element-ref.d.ts +1 -1
  100. package/react/hooks/use-event.d.ts +1 -1
  101. package/react/hooks/use-event.d.ts.map +1 -1
  102. package/react/hooks/use-initial-height.d.ts +1 -1
  103. package/react/hooks/use-last-value-ref.d.ts +1 -1
  104. package/react/hooks/use-resize-observer.d.ts +1 -1
  105. package/react/hooks/use-sync-ref.d.ts +1 -1
  106. package/react/hooks/use-toggle.d.ts +1 -1
  107. package/react/hooks/use-value.d.ts +1 -1
  108. package/react/index.d.ts +1 -1
  109. package/react/index.d.ts.map +1 -1
  110. package/react.js +152 -0
  111. package/react.js.map +1 -0
  112. package/sound.js +7 -11
  113. package/sound.js.map +1 -0
  114. package/text.js +20 -46
  115. package/text.js.map +1 -0
  116. package/type-guard/_exports.d.ts +1 -1
  117. package/type-guard/_exports.d.ts.map +1 -1
  118. package/type-guard/index.d.ts +1 -1
  119. package/type-guard/index.d.ts.map +1 -1
  120. package/type-guard.js +5 -0
  121. package/type-guard.js.map +1 -0
  122. package/utility-types.d.ts.map +1 -0
  123. package/utility-types.js +2 -0
  124. package/utility-types.js.map +1 -0
  125. package/utils/types.js +2 -1
  126. package/utils/types.js.map +1 -0
  127. package/vibrate.js +6 -7
  128. package/vibrate.js.map +1 -0
  129. package/~index-C3wKHvHr.js +80 -0
  130. package/~index-C3wKHvHr.js.map +1 -0
  131. package/~number-EWff2XI6.js +25 -0
  132. package/~number-EWff2XI6.js.map +1 -0
  133. package/~number-baxVnzrJ.js +32 -0
  134. package/~number-baxVnzrJ.js.map +1 -0
  135. package/async.cjs +0 -70
  136. package/async.d.cts +0 -28
  137. package/async.d.cts.map +0 -1
  138. package/common.cjs +0 -18
  139. package/common.d.cts +0 -15
  140. package/common.d.cts.map +0 -1
  141. package/complex/counter.cjs +0 -21
  142. package/complex/counter.d.cts +0 -15
  143. package/complex/counter.d.cts.map +0 -1
  144. package/complex/counter.js +0 -17
  145. package/complex/global-config.cjs +0 -46
  146. package/complex/global-config.d.cts +0 -11
  147. package/complex/global-config.d.cts.map +0 -1
  148. package/complex/global-config.js +0 -41
  149. package/complex/index.cjs +0 -19
  150. package/complex/index.d.cts +0 -4
  151. package/complex/index.d.cts.map +0 -1
  152. package/complex/index.js +0 -3
  153. package/complex/modules-factory.cjs +0 -50
  154. package/complex/modules-factory.d.cts +0 -49
  155. package/complex/modules-factory.d.cts.map +0 -1
  156. package/complex/modules-factory.js +0 -46
  157. package/cookie.cjs +0 -13
  158. package/cookie.d.cts +0 -3
  159. package/cookie.d.cts.map +0 -1
  160. package/css.cjs +0 -64
  161. package/css.d.cts +0 -42
  162. package/css.d.cts.map +0 -1
  163. package/data.cjs +0 -58
  164. package/data.d.cts +0 -4
  165. package/data.d.cts.map +0 -1
  166. package/date-time.cjs +0 -171
  167. package/date-time.d.cts +0 -28
  168. package/date-time.d.cts.map +0 -1
  169. package/device.cjs +0 -28
  170. package/device.d.cts +0 -8
  171. package/device.d.cts.map +0 -1
  172. package/encodings.cjs +0 -270
  173. package/encodings.d.cts +0 -2
  174. package/encodings.d.cts.map +0 -1
  175. package/errors.cjs +0 -34
  176. package/errors.d.cts +0 -19
  177. package/errors.d.cts.map +0 -1
  178. package/file.cjs +0 -29
  179. package/file.d.cts +0 -3
  180. package/file.d.cts.map +0 -1
  181. package/format/_exports.cjs +0 -20
  182. package/format/_exports.d.cts +0 -5
  183. package/format/_exports.d.cts.map +0 -1
  184. package/format/_exports.js +0 -4
  185. package/format/constants.cjs +0 -6
  186. package/format/constants.d.cts +0 -4
  187. package/format/constants.d.cts.map +0 -1
  188. package/format/constants.js +0 -3
  189. package/format/index.cjs +0 -40
  190. package/format/index.d.cts +0 -3
  191. package/format/index.d.cts.map +0 -1
  192. package/format/index.js +0 -4
  193. package/format/number.cjs +0 -48
  194. package/format/number.d.cts +0 -36
  195. package/format/number.d.cts.map +0 -1
  196. package/format/number.js +0 -44
  197. package/format/percent.cjs +0 -27
  198. package/format/percent.d.cts +0 -15
  199. package/format/percent.d.cts.map +0 -1
  200. package/format/percent.js +0 -23
  201. package/format/skip-spaces.cjs +0 -8
  202. package/format/skip-spaces.d.cts +0 -5
  203. package/format/skip-spaces.d.cts.map +0 -1
  204. package/format/skip-spaces.js +0 -4
  205. package/html.cjs +0 -202
  206. package/html.d.cts +0 -44
  207. package/html.d.cts.map +0 -1
  208. package/id.cjs +0 -76
  209. package/id.d.cts +0 -63
  210. package/id.d.cts.map +0 -1
  211. package/imports.cjs +0 -45
  212. package/imports.d.cts +0 -15
  213. package/imports.d.cts.map +0 -1
  214. package/math.cjs +0 -23
  215. package/math.d.cts +0 -13
  216. package/math.d.cts.map +0 -1
  217. package/media.cjs +0 -115
  218. package/media.d.cts +0 -20
  219. package/media.d.cts.map +0 -1
  220. package/mobx/apply-observable.cjs +0 -16
  221. package/mobx/apply-observable.d.cts +0 -4
  222. package/mobx/apply-observable.d.cts.map +0 -1
  223. package/mobx/apply-observable.js +0 -12
  224. package/mobx/create-enhanced-atom.cjs +0 -16
  225. package/mobx/create-enhanced-atom.d.cts +0 -11
  226. package/mobx/create-enhanced-atom.d.cts.map +0 -1
  227. package/mobx/create-enhanced-atom.js +0 -12
  228. package/mobx/deep-observable-struct.cjs +0 -61
  229. package/mobx/deep-observable-struct.d.cts +0 -7
  230. package/mobx/deep-observable-struct.d.cts.map +0 -1
  231. package/mobx/deep-observable-struct.js +0 -57
  232. package/mobx/get-mobx-administration.cjs +0 -6
  233. package/mobx/get-mobx-administration.d.cts +0 -6
  234. package/mobx/get-mobx-administration.d.cts.map +0 -1
  235. package/mobx/get-mobx-administration.js +0 -2
  236. package/mobx/index.cjs +0 -21
  237. package/mobx/index.d.cts +0 -6
  238. package/mobx/index.d.cts.map +0 -1
  239. package/mobx/index.js +0 -5
  240. package/mobx/lazy-observe.cjs +0 -66
  241. package/mobx/lazy-observe.d.cts +0 -14
  242. package/mobx/lazy-observe.d.cts.map +0 -1
  243. package/mobx/lazy-observe.js +0 -62
  244. package/ms.cjs +0 -22
  245. package/ms.d.cts +0 -19
  246. package/ms.d.cts.map +0 -1
  247. package/number.cjs +0 -16
  248. package/number.d.cts +0 -8
  249. package/number.d.cts.map +0 -1
  250. package/parser/_exports.cjs +0 -19
  251. package/parser/_exports.d.cts +0 -4
  252. package/parser/_exports.d.cts.map +0 -1
  253. package/parser/_exports.js +0 -3
  254. package/parser/index.cjs +0 -40
  255. package/parser/index.d.cts +0 -3
  256. package/parser/index.d.cts.map +0 -1
  257. package/parser/index.js +0 -4
  258. package/parser/number.cjs +0 -48
  259. package/parser/number.d.cts +0 -21
  260. package/parser/number.d.cts.map +0 -1
  261. package/parser/number.js +0 -44
  262. package/parser/percent.cjs +0 -8
  263. package/parser/percent.d.cts +0 -4
  264. package/parser/percent.d.cts.map +0 -1
  265. package/parser/percent.js +0 -4
  266. package/parser/string.cjs +0 -18
  267. package/parser/string.d.cts +0 -7
  268. package/parser/string.d.cts.map +0 -1
  269. package/parser/string.js +0 -14
  270. package/price.cjs +0 -21
  271. package/price.d.cts +0 -6
  272. package/price.d.cts.map +0 -1
  273. package/random.cjs +0 -25
  274. package/random.d.cts +0 -9
  275. package/random.d.cts.map +0 -1
  276. package/react/hooks/index.cjs +0 -37
  277. package/react/hooks/index.d.cts +0 -22
  278. package/react/hooks/index.d.cts.map +0 -1
  279. package/react/hooks/index.js +0 -21
  280. package/react/hooks/use-abort-controller.cjs +0 -15
  281. package/react/hooks/use-abort-controller.d.cts +0 -2
  282. package/react/hooks/use-abort-controller.d.cts.map +0 -1
  283. package/react/hooks/use-abort-controller.js +0 -11
  284. package/react/hooks/use-abort-signal.cjs +0 -8
  285. package/react/hooks/use-abort-signal.d.cts +0 -2
  286. package/react/hooks/use-abort-signal.d.cts.map +0 -1
  287. package/react/hooks/use-abort-signal.js +0 -4
  288. package/react/hooks/use-click-outside.cjs +0 -17
  289. package/react/hooks/use-click-outside.d.cts +0 -9
  290. package/react/hooks/use-click-outside.d.cts.map +0 -1
  291. package/react/hooks/use-click-outside.js +0 -13
  292. package/react/hooks/use-constant.cjs +0 -19
  293. package/react/hooks/use-constant.d.cts +0 -9
  294. package/react/hooks/use-constant.d.cts.map +0 -1
  295. package/react/hooks/use-constant.js +0 -15
  296. package/react/hooks/use-define-ref.cjs +0 -19
  297. package/react/hooks/use-define-ref.d.cts +0 -10
  298. package/react/hooks/use-define-ref.d.cts.map +0 -1
  299. package/react/hooks/use-define-ref.js +0 -15
  300. package/react/hooks/use-element-ref.cjs +0 -12
  301. package/react/hooks/use-element-ref.d.cts +0 -2
  302. package/react/hooks/use-element-ref.d.cts.map +0 -1
  303. package/react/hooks/use-element-ref.js +0 -8
  304. package/react/hooks/use-event-listener.cjs +0 -17
  305. package/react/hooks/use-event-listener.d.cts +0 -8
  306. package/react/hooks/use-event-listener.d.cts.map +0 -1
  307. package/react/hooks/use-event-listener.js +0 -13
  308. package/react/hooks/use-event.cjs +0 -23
  309. package/react/hooks/use-event.d.cts +0 -3
  310. package/react/hooks/use-event.d.cts.map +0 -1
  311. package/react/hooks/use-event.js +0 -19
  312. package/react/hooks/use-flag.cjs +0 -19
  313. package/react/hooks/use-flag.d.cts +0 -8
  314. package/react/hooks/use-flag.d.cts.map +0 -1
  315. package/react/hooks/use-flag.js +0 -15
  316. package/react/hooks/use-force-update.cjs +0 -11
  317. package/react/hooks/use-force-update.d.cts +0 -2
  318. package/react/hooks/use-force-update.d.cts.map +0 -1
  319. package/react/hooks/use-force-update.js +0 -7
  320. package/react/hooks/use-initial-height.cjs +0 -15
  321. package/react/hooks/use-initial-height.d.cts +0 -5
  322. package/react/hooks/use-initial-height.d.cts.map +0 -1
  323. package/react/hooks/use-initial-height.js +0 -11
  324. package/react/hooks/use-instance.cjs +0 -31
  325. package/react/hooks/use-instance.d.cts +0 -27
  326. package/react/hooks/use-instance.d.cts.map +0 -1
  327. package/react/hooks/use-instance.js +0 -27
  328. package/react/hooks/use-intersection-observer.cjs +0 -14
  329. package/react/hooks/use-intersection-observer.d.cts +0 -2
  330. package/react/hooks/use-intersection-observer.d.cts.map +0 -1
  331. package/react/hooks/use-intersection-observer.js +0 -10
  332. package/react/hooks/use-last-defined-value.cjs +0 -12
  333. package/react/hooks/use-last-defined-value.d.cts +0 -2
  334. package/react/hooks/use-last-defined-value.d.cts.map +0 -1
  335. package/react/hooks/use-last-defined-value.js +0 -8
  336. package/react/hooks/use-last-value-ref.cjs +0 -12
  337. package/react/hooks/use-last-value-ref.d.cts +0 -2
  338. package/react/hooks/use-last-value-ref.d.cts.map +0 -1
  339. package/react/hooks/use-last-value-ref.js +0 -8
  340. package/react/hooks/use-life-cycle.cjs +0 -14
  341. package/react/hooks/use-life-cycle.d.cts +0 -5
  342. package/react/hooks/use-life-cycle.d.cts.map +0 -1
  343. package/react/hooks/use-life-cycle.js +0 -10
  344. package/react/hooks/use-resize-observer.cjs +0 -15
  345. package/react/hooks/use-resize-observer.d.cts +0 -2
  346. package/react/hooks/use-resize-observer.d.cts.map +0 -1
  347. package/react/hooks/use-resize-observer.js +0 -11
  348. package/react/hooks/use-sync-ref.cjs +0 -10
  349. package/react/hooks/use-sync-ref.d.cts +0 -2
  350. package/react/hooks/use-sync-ref.d.cts.map +0 -1
  351. package/react/hooks/use-sync-ref.js +0 -6
  352. package/react/hooks/use-toggle.cjs +0 -10
  353. package/react/hooks/use-toggle.d.cts +0 -2
  354. package/react/hooks/use-toggle.d.cts.map +0 -1
  355. package/react/hooks/use-toggle.js +0 -6
  356. package/react/hooks/use-value.cjs +0 -12
  357. package/react/hooks/use-value.d.cts +0 -5
  358. package/react/hooks/use-value.d.cts.map +0 -1
  359. package/react/hooks/use-value.js +0 -8
  360. package/react/hooks/use-visibility-state.cjs +0 -18
  361. package/react/hooks/use-visibility-state.d.cts +0 -2
  362. package/react/hooks/use-visibility-state.d.cts.map +0 -1
  363. package/react/hooks/use-visibility-state.js +0 -14
  364. package/react/index.cjs +0 -17
  365. package/react/index.d.cts +0 -2
  366. package/react/index.d.cts.map +0 -1
  367. package/react/index.js +0 -1
  368. package/sound.cjs +0 -16
  369. package/sound.d.cts +0 -7
  370. package/sound.d.cts.map +0 -1
  371. package/storage.cjs +0 -48
  372. package/storage.d.cts +0 -39
  373. package/storage.d.cts.map +0 -1
  374. package/storage.js +0 -43
  375. package/text.cjs +0 -53
  376. package/text.d.cts +0 -15
  377. package/text.d.cts.map +0 -1
  378. package/type-guard/_exports.cjs +0 -129
  379. package/type-guard/_exports.d.cts +0 -86
  380. package/type-guard/_exports.d.cts.map +0 -1
  381. package/type-guard/_exports.js +0 -125
  382. package/type-guard/index.cjs +0 -40
  383. package/type-guard/index.d.cts +0 -3
  384. package/type-guard/index.d.cts.map +0 -1
  385. package/type-guard/index.js +0 -4
  386. package/utils/types.cjs +0 -2
  387. package/utils/types.d.cts +0 -395
  388. package/utils/types.d.cts.map +0 -1
  389. package/vibrate.cjs +0 -12
  390. package/vibrate.d.cts +0 -5
  391. package/vibrate.d.cts.map +0 -1
@@ -1,129 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSymbol = exports.isInfinite = exports.isNaN = exports.isElement = exports.isRegExp = exports.isFunction = exports.isBoolean = exports.isNumber = exports.isString = exports.isArray = exports.isObject = exports.isUndefined = exports.isNull = exports.isDefined = void 0;
4
- var Type;
5
- (function (Type) {
6
- Type["Null"] = "null";
7
- Type["Undefined"] = "undefined";
8
- Type["NaN"] = "nan";
9
- Type["Object"] = "[object Object]";
10
- Type["Array"] = "[object Array]";
11
- Type["String"] = "[object String]";
12
- Type["Number"] = "[object Number]";
13
- Type["Boolean"] = "[object Boolean]";
14
- Type["Function"] = "[object Function]";
15
- Type["RegExp"] = "[object RegExp]";
16
- Type["Symbol"] = "[object Symbol]";
17
- Type["Infinite"] = "infinite";
18
- Type["Element"] = "element";
19
- })(Type || (Type = {}));
20
- function getType(value) {
21
- if (value === undefined) {
22
- return Type.Undefined;
23
- }
24
- if (value === null) {
25
- return Type.Null;
26
- }
27
- // handle DOM elements
28
- // @ts-expect-error
29
- if (value && (value.nodeType === 1 || value.nodeType === 9)) {
30
- return Type.Element;
31
- }
32
- const stringifiedValue = Object.prototype.toString.call(value);
33
- // handle NaN and Infinity
34
- if (stringifiedValue === Type.Number) {
35
- if (Number.isNaN(value)) {
36
- return Type.NaN;
37
- }
38
- if (!Number.isFinite(value)) {
39
- return Type.Infinite;
40
- }
41
- }
42
- return stringifiedValue;
43
- }
44
- const createTypeGuard = (type) => (value) => getType(value) === type;
45
- /**
46
- * Check if a value is not null or undefined
47
- * @param value the value to check
48
- * @returns boolean
49
- */
50
- const isDefined = (value) => value != null;
51
- exports.isDefined = isDefined;
52
- /**
53
- * Check if a value is null
54
- * @param value the value to check
55
- * @returns boolean
56
- */
57
- exports.isNull = createTypeGuard(Type.Null);
58
- /**
59
- * Check if a value is undefined
60
- * @param value the value to check
61
- * @returns boolean
62
- */
63
- exports.isUndefined = createTypeGuard(Type.Undefined);
64
- /**
65
- * Check if a value is an object
66
- * @param value the value to check
67
- * @returns boolean
68
- */
69
- exports.isObject = createTypeGuard(Type.Object);
70
- /**
71
- * Check if a value is an array
72
- * @param value the value to check
73
- * @returns boolean
74
- */
75
- exports.isArray = createTypeGuard(Type.Array);
76
- /**
77
- * Check if a value is a string
78
- * @param value the value to check
79
- * @returns boolean
80
- */
81
- exports.isString = createTypeGuard(Type.String);
82
- /**
83
- * Check if a value is a number
84
- * @param value the value to check
85
- * @returns boolean
86
- */
87
- exports.isNumber = createTypeGuard(Type.Number);
88
- /**
89
- * Check if a value is a boolean
90
- * @param value the value to check
91
- * @returns boolean
92
- */
93
- exports.isBoolean = createTypeGuard(Type.Boolean);
94
- /**
95
- * Check if a value is a function
96
- * @param value the value to check
97
- * @returns boolean
98
- */
99
- exports.isFunction = createTypeGuard(Type.Function);
100
- /**
101
- * Check if a value is a regular expression
102
- * @param value the value to check
103
- * @returns boolean
104
- */
105
- exports.isRegExp = createTypeGuard(Type.RegExp);
106
- /**
107
- * Check if a value is a DOM element
108
- * @param value the value to check
109
- * @returns boolean
110
- */
111
- exports.isElement = createTypeGuard(Type.Element);
112
- /**
113
- * Check if a value is NaN
114
- * @param value the value to check
115
- * @returns boolean
116
- */
117
- exports.isNaN = createTypeGuard(Type.NaN);
118
- /**
119
- * Check if a value is infinity
120
- * @param value the value to check
121
- * @returns boolean
122
- */
123
- exports.isInfinite = createTypeGuard(Type.Infinite);
124
- /**
125
- * Check if a value is a symbol
126
- * @param value the value to check
127
- * @returns boolean
128
- */
129
- exports.isSymbol = createTypeGuard(Type.Symbol);
@@ -1,86 +0,0 @@
1
- import type { AnyFunction, AnyObject } from "../utils/types.cjs";
2
- /**
3
- * Check if a value is not null or undefined
4
- * @param value the value to check
5
- * @returns boolean
6
- */
7
- export declare const isDefined: <T>(value: T | undefined | null) => value is T;
8
- /**
9
- * Check if a value is null
10
- * @param value the value to check
11
- * @returns boolean
12
- */
13
- export declare const isNull: (value: unknown) => value is null;
14
- /**
15
- * Check if a value is undefined
16
- * @param value the value to check
17
- * @returns boolean
18
- */
19
- export declare const isUndefined: (value: unknown) => value is undefined;
20
- /**
21
- * Check if a value is an object
22
- * @param value the value to check
23
- * @returns boolean
24
- */
25
- export declare const isObject: (value: unknown) => value is AnyObject;
26
- /**
27
- * Check if a value is an array
28
- * @param value the value to check
29
- * @returns boolean
30
- */
31
- export declare const isArray: (value: unknown) => value is unknown[];
32
- /**
33
- * Check if a value is a string
34
- * @param value the value to check
35
- * @returns boolean
36
- */
37
- export declare const isString: (value: unknown) => value is string;
38
- /**
39
- * Check if a value is a number
40
- * @param value the value to check
41
- * @returns boolean
42
- */
43
- export declare const isNumber: (value: unknown) => value is number;
44
- /**
45
- * Check if a value is a boolean
46
- * @param value the value to check
47
- * @returns boolean
48
- */
49
- export declare const isBoolean: (value: unknown) => value is boolean;
50
- /**
51
- * Check if a value is a function
52
- * @param value the value to check
53
- * @returns boolean
54
- */
55
- export declare const isFunction: (value: unknown) => value is AnyFunction;
56
- /**
57
- * Check if a value is a regular expression
58
- * @param value the value to check
59
- * @returns boolean
60
- */
61
- export declare const isRegExp: (value: unknown) => value is RegExp;
62
- /**
63
- * Check if a value is a DOM element
64
- * @param value the value to check
65
- * @returns boolean
66
- */
67
- export declare const isElement: (value: unknown) => value is HTMLElement;
68
- /**
69
- * Check if a value is NaN
70
- * @param value the value to check
71
- * @returns boolean
72
- */
73
- export declare const isNaN: (value: unknown) => boolean;
74
- /**
75
- * Check if a value is infinity
76
- * @param value the value to check
77
- * @returns boolean
78
- */
79
- export declare const isInfinite: (value: unknown) => boolean;
80
- /**
81
- * Check if a value is a symbol
82
- * @param value the value to check
83
- * @returns boolean
84
- */
85
- export declare const isSymbol: (value: unknown) => value is symbol;
86
- //# sourceMappingURL=_exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/type-guard/_exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,2BAA0B;AAoDhE;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,KAAG,KAAK,IAAI,CACrD,CAAC;AAEhB;;;;GAIG;AACH,eAAO,MAAM,MAAM,UAhBT,OAAO,KAAG,KAAK,QAgB6B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAvBd,OAAO,KAAG,KAAK,aAuB4C,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UA9BX,OAAO,KAAG,KAAK,aA8BsC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,OAAO,UArCV,OAAO,KAAG,KAAK,aAqCoC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UA5CX,OAAO,KAAG,KAAK,UA4CmC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAnDX,OAAO,KAAG,KAAK,UAmDmC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,SAAS,UA1DZ,OAAO,KAAG,KAAK,WA0DsC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,UAAU,UAjEb,OAAO,KAAG,KAAK,eAiE4C,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAxEX,OAAO,KAAG,KAAK,UAwEmC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,SAAS,UA/EZ,OAAO,KAAG,KAAK,eA+E0C,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAwC,CACxD,KAAK,EAAE,OAAO,KACX,OAAO,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAA6C,CAClE,KAAK,EAAE,OAAO,KACX,OAAO,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAxGX,OAAO,KAAG,KAAK,UAwGmC,CAAC"}
@@ -1,125 +0,0 @@
1
- var Type;
2
- (function (Type) {
3
- Type["Null"] = "null";
4
- Type["Undefined"] = "undefined";
5
- Type["NaN"] = "nan";
6
- Type["Object"] = "[object Object]";
7
- Type["Array"] = "[object Array]";
8
- Type["String"] = "[object String]";
9
- Type["Number"] = "[object Number]";
10
- Type["Boolean"] = "[object Boolean]";
11
- Type["Function"] = "[object Function]";
12
- Type["RegExp"] = "[object RegExp]";
13
- Type["Symbol"] = "[object Symbol]";
14
- Type["Infinite"] = "infinite";
15
- Type["Element"] = "element";
16
- })(Type || (Type = {}));
17
- function getType(value) {
18
- if (value === undefined) {
19
- return Type.Undefined;
20
- }
21
- if (value === null) {
22
- return Type.Null;
23
- }
24
- // handle DOM elements
25
- // @ts-expect-error
26
- if (value && (value.nodeType === 1 || value.nodeType === 9)) {
27
- return Type.Element;
28
- }
29
- const stringifiedValue = Object.prototype.toString.call(value);
30
- // handle NaN and Infinity
31
- if (stringifiedValue === Type.Number) {
32
- if (Number.isNaN(value)) {
33
- return Type.NaN;
34
- }
35
- if (!Number.isFinite(value)) {
36
- return Type.Infinite;
37
- }
38
- }
39
- return stringifiedValue;
40
- }
41
- const createTypeGuard = (type) => (value) => getType(value) === type;
42
- /**
43
- * Check if a value is not null or undefined
44
- * @param value the value to check
45
- * @returns boolean
46
- */
47
- export const isDefined = (value) => value != null;
48
- /**
49
- * Check if a value is null
50
- * @param value the value to check
51
- * @returns boolean
52
- */
53
- export const isNull = createTypeGuard(Type.Null);
54
- /**
55
- * Check if a value is undefined
56
- * @param value the value to check
57
- * @returns boolean
58
- */
59
- export const isUndefined = createTypeGuard(Type.Undefined);
60
- /**
61
- * Check if a value is an object
62
- * @param value the value to check
63
- * @returns boolean
64
- */
65
- export const isObject = createTypeGuard(Type.Object);
66
- /**
67
- * Check if a value is an array
68
- * @param value the value to check
69
- * @returns boolean
70
- */
71
- export const isArray = createTypeGuard(Type.Array);
72
- /**
73
- * Check if a value is a string
74
- * @param value the value to check
75
- * @returns boolean
76
- */
77
- export const isString = createTypeGuard(Type.String);
78
- /**
79
- * Check if a value is a number
80
- * @param value the value to check
81
- * @returns boolean
82
- */
83
- export const isNumber = createTypeGuard(Type.Number);
84
- /**
85
- * Check if a value is a boolean
86
- * @param value the value to check
87
- * @returns boolean
88
- */
89
- export const isBoolean = createTypeGuard(Type.Boolean);
90
- /**
91
- * Check if a value is a function
92
- * @param value the value to check
93
- * @returns boolean
94
- */
95
- export const isFunction = createTypeGuard(Type.Function);
96
- /**
97
- * Check if a value is a regular expression
98
- * @param value the value to check
99
- * @returns boolean
100
- */
101
- export const isRegExp = createTypeGuard(Type.RegExp);
102
- /**
103
- * Check if a value is a DOM element
104
- * @param value the value to check
105
- * @returns boolean
106
- */
107
- export const isElement = createTypeGuard(Type.Element);
108
- /**
109
- * Check if a value is NaN
110
- * @param value the value to check
111
- * @returns boolean
112
- */
113
- export const isNaN = createTypeGuard(Type.NaN);
114
- /**
115
- * Check if a value is infinity
116
- * @param value the value to check
117
- * @returns boolean
118
- */
119
- export const isInfinite = createTypeGuard(Type.Infinite);
120
- /**
121
- * Check if a value is a symbol
122
- * @param value the value to check
123
- * @returns boolean
124
- */
125
- export const isSymbol = createTypeGuard(Type.Symbol);
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.typeGuard = void 0;
37
- // This way is more treeshakable than collecting
38
- // it into one exportable object export const typeGuard
39
- const typeGuard = __importStar(require("./_exports.cjs"));
40
- exports.typeGuard = typeGuard;
@@ -1,3 +0,0 @@
1
- import * as typeGuard from "./_exports.cjs";
2
- export { typeGuard };
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/type-guard/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,uBAAsB;AAE3C,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- // This way is more treeshakable than collecting
2
- // it into one exportable object export const typeGuard
3
- import * as typeGuard from "./_exports.js";
4
- export { typeGuard };
package/utils/types.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });