yummies 7.10.0 → 7.12.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 (154) hide show
  1. package/async.cjs +162 -48
  2. package/async.cjs.map +1 -1
  3. package/async.d.ts +112 -13
  4. package/async.js +163 -54
  5. package/async.js.map +1 -1
  6. package/chunk-CVq3Gv4J.cjs +50 -0
  7. package/chunk-YKewjYmz.js +37 -0
  8. package/common.cjs +48 -8
  9. package/common.cjs.map +1 -1
  10. package/common.d.ts +35 -2
  11. package/common.js +49 -11
  12. package/common.js.map +1 -1
  13. package/complex.cjs +275 -104
  14. package/complex.cjs.map +1 -1
  15. package/complex.d.ts +133 -13
  16. package/complex.js +275 -109
  17. package/complex.js.map +1 -1
  18. package/cookie.cjs +17 -7
  19. package/cookie.cjs.map +1 -1
  20. package/cookie.d.ts +8 -0
  21. package/cookie.js +18 -9
  22. package/cookie.js.map +1 -1
  23. package/css.cjs +147 -39
  24. package/css.cjs.map +1 -1
  25. package/css.d.ts +98 -6
  26. package/css.js +143 -41
  27. package/css.js.map +1 -1
  28. package/data.cjs +90 -55
  29. package/data.cjs.map +1 -1
  30. package/data.d.ts +32 -0
  31. package/data.js +91 -61
  32. package/data.js.map +1 -1
  33. package/date-time.cjs +578 -412
  34. package/date-time.cjs.map +1 -1
  35. package/date-time.d.ts +88 -0
  36. package/date-time.js +575 -421
  37. package/date-time.js.map +1 -1
  38. package/device.cjs +48 -23
  39. package/device.cjs.map +1 -1
  40. package/device.d.ts +32 -0
  41. package/device.js +49 -31
  42. package/device.js.map +1 -1
  43. package/encodings.cjs +275 -266
  44. package/encodings.cjs.map +1 -1
  45. package/encodings.d.ts +8 -0
  46. package/encodings.js +276 -268
  47. package/encodings.js.map +1 -1
  48. package/errors.cjs +20 -18
  49. package/errors.cjs.map +1 -1
  50. package/errors.js +19 -19
  51. package/errors.js.map +1 -1
  52. package/file.cjs +42 -24
  53. package/file.cjs.map +1 -1
  54. package/file.d.ts +16 -0
  55. package/file.js +43 -27
  56. package/file.js.map +1 -1
  57. package/format.cjs +125 -83
  58. package/format.cjs.map +1 -1
  59. package/format.d.ts +89 -4
  60. package/format.js +118 -82
  61. package/format.js.map +1 -1
  62. package/html.cjs +226 -137
  63. package/html.cjs.map +1 -1
  64. package/html.d.ts +67 -3
  65. package/html.js +223 -150
  66. package/html.js.map +1 -1
  67. package/id.cjs +74 -17
  68. package/id.cjs.map +1 -1
  69. package/id.d.ts +10 -10
  70. package/id.js +73 -24
  71. package/id.js.map +1 -1
  72. package/imports.cjs +41 -29
  73. package/imports.cjs.map +1 -1
  74. package/imports.d.ts +13 -4
  75. package/imports.js +40 -31
  76. package/imports.js.map +1 -1
  77. package/math.cjs +32 -6
  78. package/math.cjs.map +1 -1
  79. package/math.d.ts +17 -1
  80. package/math.js +33 -10
  81. package/math.js.map +1 -1
  82. package/media.cjs +275 -84
  83. package/media.cjs.map +1 -1
  84. package/media.d.ts +188 -2
  85. package/media.js +274 -93
  86. package/media.js.map +1 -1
  87. package/mobx.cjs +353 -193
  88. package/mobx.cjs.map +1 -1
  89. package/mobx.d.ts +172 -6
  90. package/mobx.js +351 -200
  91. package/mobx.js.map +1 -1
  92. package/ms.cjs +21 -10
  93. package/ms.cjs.map +1 -1
  94. package/ms.d.ts +1 -1
  95. package/ms.js +22 -13
  96. package/ms.js.map +1 -1
  97. package/number.cjs +13 -7
  98. package/number.cjs.map +1 -1
  99. package/number.js +14 -9
  100. package/number.js.map +1 -1
  101. package/package.json +13 -5
  102. package/parser.cjs +117 -64
  103. package/parser.cjs.map +1 -1
  104. package/parser.d.ts +63 -0
  105. package/parser.js +111 -64
  106. package/parser.js.map +1 -1
  107. package/price.cjs +24 -18
  108. package/price.cjs.map +1 -1
  109. package/price.d.ts +8 -0
  110. package/price.js +25 -20
  111. package/price.js.map +1 -1
  112. package/random.cjs +79 -13
  113. package/random.cjs.map +1 -1
  114. package/random.d.ts +64 -0
  115. package/random.js +80 -22
  116. package/random.js.map +1 -1
  117. package/react.cjs +673 -214
  118. package/react.cjs.map +1 -1
  119. package/react.d.ts +428 -9
  120. package/react.js +674 -239
  121. package/react.js.map +1 -1
  122. package/sound.cjs +14 -9
  123. package/sound.cjs.map +1 -1
  124. package/sound.d.ts +1 -1
  125. package/sound.js +15 -11
  126. package/sound.js.map +1 -1
  127. package/storage.cjs +49 -50
  128. package/storage.cjs.map +1 -1
  129. package/storage.d.ts +15 -6
  130. package/storage.js +50 -53
  131. package/storage.js.map +1 -1
  132. package/text.cjs +51 -34
  133. package/text.cjs.map +1 -1
  134. package/text.d.ts +5 -5
  135. package/text.js +52 -37
  136. package/text.js.map +1 -1
  137. package/type-guard.cjs +292 -72
  138. package/type-guard.cjs.map +1 -1
  139. package/type-guard.d.ts +199 -42
  140. package/type-guard.js +288 -73
  141. package/type-guard.js.map +1 -1
  142. package/types.cjs +0 -2
  143. package/types.global.cjs +0 -2
  144. package/types.global.js +0 -2
  145. package/types.js +0 -2
  146. package/vibrate.cjs +31 -6
  147. package/vibrate.cjs.map +1 -1
  148. package/vibrate.d.ts +23 -1
  149. package/vibrate.js +32 -8
  150. package/vibrate.js.map +1 -1
  151. package/types.cjs.map +0 -1
  152. package/types.global.cjs.map +0 -1
  153. package/types.global.js.map +0 -1
  154. package/types.js.map +0 -1
package/text.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"text.cjs","sources":["../src/text.ts"],"sourcesContent":["/**\n * Склонение слова в зависимости от количества\n * @example\n * declension(1, ['слово', 'слова', 'слов']) // 'слово'\n * @example\n * declension(2, ['слово', 'слова', 'слов']) // 'слова'\n * @example\n * declension(5, ['слово', 'слова', 'слов']) // 'слов'\n */\nexport const declension = (\n count: number,\n txt: readonly [one: string, two: string, five: string],\n cases = [2, 0, 1, 1, 1, 2],\n) =>\n txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n\n/**\n * Разбиение текста на линии\n */\nexport const splitTextByLines = (\n text: string,\n lineLingth: number = 60,\n): string[] => {\n const words = text.split(/\\s+/).filter((word) => word !== '');\n const lines = [];\n let currentLine = '';\n\n for (const word of words) {\n if (word.length > lineLingth) {\n if (currentLine !== '') {\n lines.push(currentLine);\n currentLine = '';\n }\n\n let start = 0;\n while (start < word.length) {\n const chunk = word.slice(start, start + lineLingth);\n lines.push(chunk);\n start += lineLingth;\n }\n continue;\n }\n\n // Проверка возможности добавления слова в текущую строку\n if (currentLine === '') {\n currentLine = word;\n } else if (currentLine.length + 1 + word.length <= lineLingth) {\n currentLine += ` ${word}`;\n } else {\n lines.push(currentLine);\n currentLine = word;\n }\n }\n\n if (currentLine !== '' || lines.length === 0) {\n lines.push(currentLine);\n }\n\n return lines;\n};\n"],"names":[],"mappings":";;AASO,MAAM,aAAa,CACxB,OACA,KACA,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,MAEzB,IAAI,QAAQ,MAAM,KAAK,QAAQ,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC;AAKvE,MAAM,mBAAmB,CAC9B,MACA,aAAqB,OACR;AACb,QAAM,QAAQ,KAAK,MAAM,KAAK,EAAE,OAAO,CAAC,SAAS,SAAS,EAAE;AAC5D,QAAM,QAAQ,CAAA;AACd,MAAI,cAAc;AAElB,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,SAAS,YAAY;AAC5B,UAAI,gBAAgB,IAAI;AACtB,cAAM,KAAK,WAAW;AACtB,sBAAc;AAAA,MAChB;AAEA,UAAI,QAAQ;AACZ,aAAO,QAAQ,KAAK,QAAQ;AAC1B,cAAM,QAAQ,KAAK,MAAM,OAAO,QAAQ,UAAU;AAClD,cAAM,KAAK,KAAK;AAChB,iBAAS;AAAA,MACX;AACA;AAAA,IACF;AAGA,QAAI,gBAAgB,IAAI;AACtB,oBAAc;AAAA,IAChB,WAAW,YAAY,SAAS,IAAI,KAAK,UAAU,YAAY;AAC7D,qBAAe,IAAI,IAAI;AAAA,IACzB,OAAO;AACL,YAAM,KAAK,WAAW;AACtB,oBAAc;AAAA,IAChB;AAAA,EACF;AAEA,MAAI,gBAAgB,MAAM,MAAM,WAAW,GAAG;AAC5C,UAAM,KAAK,WAAW;AAAA,EACxB;AAEA,SAAO;AACT;;;"}
1
+ {"version":3,"file":"text.cjs","names":[],"sources":["../src/text.ts"],"sourcesContent":["/**\n * Returns the correct word form based on the provided count.\n * @example\n * declension(1, ['slovo', 'slova', 'slov']) // 'slovo'\n * @example\n * declension(2, ['slovo', 'slova', 'slov']) // 'slova'\n * @example\n * declension(5, ['slovo', 'slova', 'slov']) // 'slov'\n */\nexport const declension = (\n count: number,\n txt: readonly [one: string, two: string, five: string],\n cases = [2, 0, 1, 1, 1, 2],\n) =>\n txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n\n/**\n * Splits text into lines with a maximum line length.\n */\nexport const splitTextByLines = (\n text: string,\n lineLingth: number = 60,\n): string[] => {\n const words = text.split(/\\s+/).filter((word) => word !== '');\n const lines = [];\n let currentLine = '';\n\n for (const word of words) {\n if (word.length > lineLingth) {\n if (currentLine !== '') {\n lines.push(currentLine);\n currentLine = '';\n }\n\n let start = 0;\n while (start < word.length) {\n const chunk = word.slice(start, start + lineLingth);\n lines.push(chunk);\n start += lineLingth;\n }\n continue;\n }\n\n // Проверка возможности добавления слова в текущую строку\n if (currentLine === '') {\n currentLine = word;\n } else if (currentLine.length + 1 + word.length <= lineLingth) {\n currentLine += ` ${word}`;\n } else {\n lines.push(currentLine);\n currentLine = word;\n }\n }\n\n if (currentLine !== '' || lines.length === 0) {\n lines.push(currentLine);\n }\n\n return lines;\n};\n"],"mappings":";;;;;;;;;;;AASA,IAAa,cACX,OACA,KACA,QAAQ;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAE,KAE1B,IAAI,QAAQ,MAAM,KAAK,QAAQ,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,QAAQ,IAAI,EAAE;;;;AAK7E,IAAa,oBACX,MACA,aAAqB,OACR;CACb,MAAM,QAAQ,KAAK,MAAM,MAAM,CAAC,QAAQ,SAAS,SAAS,GAAG;CAC7D,MAAM,QAAQ,EAAE;CAChB,IAAI,cAAc;AAElB,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,KAAK,SAAS,YAAY;AAC5B,OAAI,gBAAgB,IAAI;AACtB,UAAM,KAAK,YAAY;AACvB,kBAAc;;GAGhB,IAAI,QAAQ;AACZ,UAAO,QAAQ,KAAK,QAAQ;IAC1B,MAAM,QAAQ,KAAK,MAAM,OAAO,QAAQ,WAAW;AACnD,UAAM,KAAK,MAAM;AACjB,aAAS;;AAEX;;AAIF,MAAI,gBAAgB,GAClB,eAAc;WACL,YAAY,SAAS,IAAI,KAAK,UAAU,WACjD,gBAAe,IAAI;OACd;AACL,SAAM,KAAK,YAAY;AACvB,iBAAc;;;AAIlB,KAAI,gBAAgB,MAAM,MAAM,WAAW,EACzC,OAAM,KAAK,YAAY;AAGzB,QAAO"}
package/text.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  /**
2
- * Склонение слова в зависимости от количества
2
+ * Returns the correct word form based on the provided count.
3
3
  * @example
4
- * declension(1, ['слово', 'слова', 'слов']) // 'слово'
4
+ * declension(1, ['slovo', 'slova', 'slov']) // 'slovo'
5
5
  * @example
6
- * declension(2, ['слово', 'слова', 'слов']) // 'слова'
6
+ * declension(2, ['slovo', 'slova', 'slov']) // 'slova'
7
7
  * @example
8
- * declension(5, ['слово', 'слова', 'слов']) // 'слов'
8
+ * declension(5, ['slovo', 'slova', 'slov']) // 'slov'
9
9
  */
10
10
  declare const declension: (count: number, txt: readonly [one: string, two: string, five: string], cases?: number[]) => string;
11
11
  /**
12
- * Разбиение текста на линии
12
+ * Splits text into lines with a maximum line length.
13
13
  */
14
14
  declare const splitTextByLines: (text: string, lineLingth?: number) => string[];
15
15
 
package/text.js CHANGED
@@ -1,38 +1,53 @@
1
- const declension = (count, txt, cases = [2, 0, 1, 1, 1, 2]) => txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];
2
- const splitTextByLines = (text, lineLingth = 60) => {
3
- const words = text.split(/\s+/).filter((word) => word !== "");
4
- const lines = [];
5
- let currentLine = "";
6
- for (const word of words) {
7
- if (word.length > lineLingth) {
8
- if (currentLine !== "") {
9
- lines.push(currentLine);
10
- currentLine = "";
11
- }
12
- let start = 0;
13
- while (start < word.length) {
14
- const chunk = word.slice(start, start + lineLingth);
15
- lines.push(chunk);
16
- start += lineLingth;
17
- }
18
- continue;
19
- }
20
- if (currentLine === "") {
21
- currentLine = word;
22
- } else if (currentLine.length + 1 + word.length <= lineLingth) {
23
- currentLine += ` ${word}`;
24
- } else {
25
- lines.push(currentLine);
26
- currentLine = word;
27
- }
28
- }
29
- if (currentLine !== "" || lines.length === 0) {
30
- lines.push(currentLine);
31
- }
32
- return lines;
1
+ //#region src/text.ts
2
+ /**
3
+ * Returns the correct word form based on the provided count.
4
+ * @example
5
+ * declension(1, ['slovo', 'slova', 'slov']) // 'slovo'
6
+ * @example
7
+ * declension(2, ['slovo', 'slova', 'slov']) // 'slova'
8
+ * @example
9
+ * declension(5, ['slovo', 'slova', 'slov']) // 'slov'
10
+ */
11
+ var declension = (count, txt, cases = [
12
+ 2,
13
+ 0,
14
+ 1,
15
+ 1,
16
+ 1,
17
+ 2
18
+ ]) => txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];
19
+ /**
20
+ * Splits text into lines with a maximum line length.
21
+ */
22
+ var splitTextByLines = (text, lineLingth = 60) => {
23
+ const words = text.split(/\s+/).filter((word) => word !== "");
24
+ const lines = [];
25
+ let currentLine = "";
26
+ for (const word of words) {
27
+ if (word.length > lineLingth) {
28
+ if (currentLine !== "") {
29
+ lines.push(currentLine);
30
+ currentLine = "";
31
+ }
32
+ let start = 0;
33
+ while (start < word.length) {
34
+ const chunk = word.slice(start, start + lineLingth);
35
+ lines.push(chunk);
36
+ start += lineLingth;
37
+ }
38
+ continue;
39
+ }
40
+ if (currentLine === "") currentLine = word;
41
+ else if (currentLine.length + 1 + word.length <= lineLingth) currentLine += ` ${word}`;
42
+ else {
43
+ lines.push(currentLine);
44
+ currentLine = word;
45
+ }
46
+ }
47
+ if (currentLine !== "" || lines.length === 0) lines.push(currentLine);
48
+ return lines;
33
49
  };
34
- export {
35
- declension,
36
- splitTextByLines
37
- };
38
- //# sourceMappingURL=text.js.map
50
+ //#endregion
51
+ export { declension, splitTextByLines };
52
+
53
+ //# sourceMappingURL=text.js.map
package/text.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sources":["../src/text.ts"],"sourcesContent":["/**\n * Склонение слова в зависимости от количества\n * @example\n * declension(1, ['слово', 'слова', 'слов']) // 'слово'\n * @example\n * declension(2, ['слово', 'слова', 'слов']) // 'слова'\n * @example\n * declension(5, ['слово', 'слова', 'слов']) // 'слов'\n */\nexport const declension = (\n count: number,\n txt: readonly [one: string, two: string, five: string],\n cases = [2, 0, 1, 1, 1, 2],\n) =>\n txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n\n/**\n * Разбиение текста на линии\n */\nexport const splitTextByLines = (\n text: string,\n lineLingth: number = 60,\n): string[] => {\n const words = text.split(/\\s+/).filter((word) => word !== '');\n const lines = [];\n let currentLine = '';\n\n for (const word of words) {\n if (word.length > lineLingth) {\n if (currentLine !== '') {\n lines.push(currentLine);\n currentLine = '';\n }\n\n let start = 0;\n while (start < word.length) {\n const chunk = word.slice(start, start + lineLingth);\n lines.push(chunk);\n start += lineLingth;\n }\n continue;\n }\n\n // Проверка возможности добавления слова в текущую строку\n if (currentLine === '') {\n currentLine = word;\n } else if (currentLine.length + 1 + word.length <= lineLingth) {\n currentLine += ` ${word}`;\n } else {\n lines.push(currentLine);\n currentLine = word;\n }\n }\n\n if (currentLine !== '' || lines.length === 0) {\n lines.push(currentLine);\n }\n\n return lines;\n};\n"],"names":[],"mappings":"AASO,MAAM,aAAa,CACxB,OACA,KACA,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,MAEzB,IAAI,QAAQ,MAAM,KAAK,QAAQ,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC;AAKvE,MAAM,mBAAmB,CAC9B,MACA,aAAqB,OACR;AACb,QAAM,QAAQ,KAAK,MAAM,KAAK,EAAE,OAAO,CAAC,SAAS,SAAS,EAAE;AAC5D,QAAM,QAAQ,CAAA;AACd,MAAI,cAAc;AAElB,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,SAAS,YAAY;AAC5B,UAAI,gBAAgB,IAAI;AACtB,cAAM,KAAK,WAAW;AACtB,sBAAc;AAAA,MAChB;AAEA,UAAI,QAAQ;AACZ,aAAO,QAAQ,KAAK,QAAQ;AAC1B,cAAM,QAAQ,KAAK,MAAM,OAAO,QAAQ,UAAU;AAClD,cAAM,KAAK,KAAK;AAChB,iBAAS;AAAA,MACX;AACA;AAAA,IACF;AAGA,QAAI,gBAAgB,IAAI;AACtB,oBAAc;AAAA,IAChB,WAAW,YAAY,SAAS,IAAI,KAAK,UAAU,YAAY;AAC7D,qBAAe,IAAI,IAAI;AAAA,IACzB,OAAO;AACL,YAAM,KAAK,WAAW;AACtB,oBAAc;AAAA,IAChB;AAAA,EACF;AAEA,MAAI,gBAAgB,MAAM,MAAM,WAAW,GAAG;AAC5C,UAAM,KAAK,WAAW;AAAA,EACxB;AAEA,SAAO;AACT;"}
1
+ {"version":3,"file":"text.js","names":[],"sources":["../src/text.ts"],"sourcesContent":["/**\n * Returns the correct word form based on the provided count.\n * @example\n * declension(1, ['slovo', 'slova', 'slov']) // 'slovo'\n * @example\n * declension(2, ['slovo', 'slova', 'slov']) // 'slova'\n * @example\n * declension(5, ['slovo', 'slova', 'slov']) // 'slov'\n */\nexport const declension = (\n count: number,\n txt: readonly [one: string, two: string, five: string],\n cases = [2, 0, 1, 1, 1, 2],\n) =>\n txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n\n/**\n * Splits text into lines with a maximum line length.\n */\nexport const splitTextByLines = (\n text: string,\n lineLingth: number = 60,\n): string[] => {\n const words = text.split(/\\s+/).filter((word) => word !== '');\n const lines = [];\n let currentLine = '';\n\n for (const word of words) {\n if (word.length > lineLingth) {\n if (currentLine !== '') {\n lines.push(currentLine);\n currentLine = '';\n }\n\n let start = 0;\n while (start < word.length) {\n const chunk = word.slice(start, start + lineLingth);\n lines.push(chunk);\n start += lineLingth;\n }\n continue;\n }\n\n // Проверка возможности добавления слова в текущую строку\n if (currentLine === '') {\n currentLine = word;\n } else if (currentLine.length + 1 + word.length <= lineLingth) {\n currentLine += ` ${word}`;\n } else {\n lines.push(currentLine);\n currentLine = word;\n }\n }\n\n if (currentLine !== '' || lines.length === 0) {\n lines.push(currentLine);\n }\n\n return lines;\n};\n"],"mappings":";;;;;;;;;;AASA,IAAa,cACX,OACA,KACA,QAAQ;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAE,KAE1B,IAAI,QAAQ,MAAM,KAAK,QAAQ,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,QAAQ,IAAI,EAAE;;;;AAK7E,IAAa,oBACX,MACA,aAAqB,OACR;CACb,MAAM,QAAQ,KAAK,MAAM,MAAM,CAAC,QAAQ,SAAS,SAAS,GAAG;CAC7D,MAAM,QAAQ,EAAE;CAChB,IAAI,cAAc;AAElB,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,KAAK,SAAS,YAAY;AAC5B,OAAI,gBAAgB,IAAI;AACtB,UAAM,KAAK,YAAY;AACvB,kBAAc;;GAGhB,IAAI,QAAQ;AACZ,UAAO,QAAQ,KAAK,QAAQ;IAC1B,MAAM,QAAQ,KAAK,MAAM,OAAO,QAAQ,WAAW;AACnD,UAAM,KAAK,MAAM;AACjB,aAAS;;AAEX;;AAIF,MAAI,gBAAgB,GAClB,eAAc;WACL,YAAY,SAAS,IAAI,KAAK,UAAU,WACjD,gBAAe,IAAI;OACd;AACL,SAAM,KAAK,YAAY;AACvB,iBAAc;;;AAIlB,KAAI,gBAAgB,MAAM,MAAM,WAAW,EACzC,OAAM,KAAK,YAAY;AAGzB,QAAO"}
package/type-guard.cjs CHANGED
@@ -1,76 +1,296 @@
1
- "use strict";
2
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const TYPE = {
4
- Null: "null",
5
- Undefined: "undefined",
6
- NaN: "nan",
7
- Object: "[object Object]",
8
- Array: "[object Array]",
9
- String: "[object String]",
10
- Number: "[object Number]",
11
- Boolean: "[object Boolean]",
12
- Function: "[object Function]",
13
- AsyncFunction: "[object AsyncFunction]",
14
- RegExp: "[object RegExp]",
15
- Symbol: "[object Symbol]",
16
- Infinite: "infinite",
17
- Element: "element"
2
+ //#region src/type-guard/_exports.ts
3
+ var _exports_exports = /* @__PURE__ */ require("./chunk-CVq3Gv4J.cjs").__exportAll({
4
+ isArray: () => isArray,
5
+ isBoolean: () => isBoolean,
6
+ isDefined: () => isDefined,
7
+ isElement: () => isElement,
8
+ isFunction: () => isFunction,
9
+ isInfinite: () => isInfinite,
10
+ isNaN: () => isNaN,
11
+ isNull: () => isNull,
12
+ isNumber: () => isNumber,
13
+ isObject: () => isObject,
14
+ isRegExp: () => isRegExp,
15
+ isString: () => isString,
16
+ isSymbol: () => isSymbol,
17
+ isUndefined: () => isUndefined
18
+ });
19
+ var TYPE = {
20
+ Null: "null",
21
+ Undefined: "undefined",
22
+ NaN: "nan",
23
+ Object: "[object Object]",
24
+ Array: "[object Array]",
25
+ String: "[object String]",
26
+ Number: "[object Number]",
27
+ Boolean: "[object Boolean]",
28
+ Function: "[object Function]",
29
+ AsyncFunction: "[object AsyncFunction]",
30
+ RegExp: "[object RegExp]",
31
+ Symbol: "[object Symbol]",
32
+ Infinite: "infinite",
33
+ Element: "element"
18
34
  };
19
35
  function getType(value) {
20
- if (value === void 0) {
21
- return TYPE.Undefined;
22
- }
23
- if (value === null) {
24
- return TYPE.Null;
25
- }
26
- if (value && (value.nodeType === 1 || value.nodeType === 9)) {
27
- return TYPE.Element;
28
- }
29
- const stringifiedValue = Object.prototype.toString.call(value);
30
- if (stringifiedValue === TYPE.Number) {
31
- if (Number.isNaN(value)) {
32
- return TYPE.NaN;
33
- }
34
- if (!Number.isFinite(value)) {
35
- return TYPE.Infinite;
36
- }
37
- }
38
- return stringifiedValue;
36
+ if (value === void 0) return TYPE.Undefined;
37
+ if (value === null) return TYPE.Null;
38
+ if (value && (value.nodeType === 1 || value.nodeType === 9)) return TYPE.Element;
39
+ const stringifiedValue = Object.prototype.toString.call(value);
40
+ if (stringifiedValue === TYPE.Number) {
41
+ if (Number.isNaN(value)) return TYPE.NaN;
42
+ if (!Number.isFinite(value)) return TYPE.Infinite;
43
+ }
44
+ return stringifiedValue;
39
45
  }
40
- const createTypeGuard = (...types) => (value) => types.includes(getType(value));
41
- const isDefined = (value) => value != null;
42
- const isNull = createTypeGuard(TYPE.Null);
43
- const isUndefined = createTypeGuard(TYPE.Undefined);
44
- const isObject = createTypeGuard(TYPE.Object);
45
- const isArray = createTypeGuard(TYPE.Array);
46
- const isString = createTypeGuard(TYPE.String);
47
- const isNumber = createTypeGuard(TYPE.Number);
48
- const isBoolean = createTypeGuard(TYPE.Boolean);
49
- const isFunction = createTypeGuard(
50
- TYPE.Function,
51
- TYPE.AsyncFunction
52
- );
53
- const isRegExp = createTypeGuard(TYPE.RegExp);
54
- const isElement = createTypeGuard(TYPE.Element);
55
- const isNaN = createTypeGuard(TYPE.NaN);
56
- const isInfinite = createTypeGuard(TYPE.Infinite);
57
- const isSymbol = createTypeGuard(TYPE.Symbol);
58
- const _exports = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
59
- __proto__: null,
60
- isArray,
61
- isBoolean,
62
- isDefined,
63
- isElement,
64
- isFunction,
65
- isInfinite,
66
- isNaN,
67
- isNull,
68
- isNumber,
69
- isObject,
70
- isRegExp,
71
- isString,
72
- isSymbol,
73
- isUndefined
74
- }, Symbol.toStringTag, { value: "Module" }));
75
- exports.typeGuard = _exports;
76
- //# sourceMappingURL=type-guard.cjs.map
46
+ var createTypeGuard = (...types) => (value) => types.includes(getType(value));
47
+ /**
48
+ * Checks that a value is neither `null` nor `undefined`.
49
+ *
50
+ * @template T Value type without nullish branches.
51
+ * @param value Value to test.
52
+ * @returns `true` when the value is defined.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * isDefined(0); // true
57
+ * ```
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * isDefined(null); // false
62
+ * ```
63
+ */
64
+ var isDefined = (value) => value != null;
65
+ /**
66
+ * Checks whether a value is exactly `null`.
67
+ *
68
+ * @param value Value to test.
69
+ * @returns `true` when the value is `null`.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * isNull(null); // true
74
+ * ```
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * isNull(undefined); // false
79
+ * ```
80
+ */
81
+ var isNull = createTypeGuard(TYPE.Null);
82
+ /**
83
+ * Checks whether a value is exactly `undefined`.
84
+ *
85
+ * @param value Value to test.
86
+ * @returns `true` when the value is `undefined`.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * isUndefined(undefined); // true
91
+ * ```
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * isUndefined('value'); // false
96
+ * ```
97
+ */
98
+ var isUndefined = createTypeGuard(TYPE.Undefined);
99
+ /**
100
+ * Checks whether a value is a plain object.
101
+ *
102
+ * @param value Value to test.
103
+ * @returns `true` when the value matches `[object Object]`.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * isObject({ id: 1 }); // true
108
+ * ```
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * isObject([]); // false
113
+ * ```
114
+ */
115
+ var isObject = createTypeGuard(TYPE.Object);
116
+ /**
117
+ * Checks whether a value is an array.
118
+ *
119
+ * @param value Value to test.
120
+ * @returns `true` when the value is an array.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * isArray([1, 2, 3]); // true
125
+ * ```
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * isArray({ length: 1 }); // false
130
+ * ```
131
+ */
132
+ var isArray = createTypeGuard(TYPE.Array);
133
+ /**
134
+ * Checks whether a value is a string object or primitive string.
135
+ *
136
+ * @param value Value to test.
137
+ * @returns `true` when the value is a string.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * isString('hello'); // true
142
+ * ```
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * isString(123); // false
147
+ * ```
148
+ */
149
+ var isString = createTypeGuard(TYPE.String);
150
+ /**
151
+ * Checks whether a value is a finite number.
152
+ *
153
+ * Unlike `isNaN` and `isInfinite`, this guard only matches regular numeric values.
154
+ *
155
+ * @param value Value to test.
156
+ * @returns `true` when the value is a non-NaN finite number.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * isNumber(123); // true
161
+ * ```
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * isNumber(Number.NaN); // false
166
+ * ```
167
+ */
168
+ var isNumber = createTypeGuard(TYPE.Number);
169
+ /**
170
+ * Checks whether a value is a boolean.
171
+ *
172
+ * @param value Value to test.
173
+ * @returns `true` when the value is a boolean.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * isBoolean(true); // true
178
+ * ```
179
+ *
180
+ * @example
181
+ * ```ts
182
+ * isBoolean('true'); // false
183
+ * ```
184
+ */
185
+ var isBoolean = createTypeGuard(TYPE.Boolean);
186
+ /**
187
+ * Checks whether a value is a synchronous or asynchronous function.
188
+ *
189
+ * @param value Value to test.
190
+ * @returns `true` when the value is a function.
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * isFunction(() => {}); // true
195
+ * ```
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * isFunction(async () => {}); // true
200
+ * ```
201
+ */
202
+ var isFunction = createTypeGuard(TYPE.Function, TYPE.AsyncFunction);
203
+ /**
204
+ * Checks whether a value is a regular expression.
205
+ *
206
+ * @param value Value to test.
207
+ * @returns `true` when the value is a `RegExp`.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * isRegExp(/foo/); // true
212
+ * ```
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * isRegExp('foo'); // false
217
+ * ```
218
+ */
219
+ var isRegExp = createTypeGuard(TYPE.RegExp);
220
+ /**
221
+ * Checks whether a value looks like a DOM element or document node.
222
+ *
223
+ * @param value Value to test.
224
+ * @returns `true` when the value has an element-like node type.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * isElement(document.body); // true
229
+ * ```
230
+ *
231
+ * @example
232
+ * ```ts
233
+ * isElement({ nodeType: 3 }); // false
234
+ * ```
235
+ */
236
+ var isElement = createTypeGuard(TYPE.Element);
237
+ /**
238
+ * Checks whether a value is `NaN`.
239
+ *
240
+ * @param value Value to test.
241
+ * @returns `true` when the value is `NaN`.
242
+ *
243
+ * @example
244
+ * ```ts
245
+ * isNaN(Number.NaN); // true
246
+ * ```
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * isNaN(5); // false
251
+ * ```
252
+ */
253
+ var isNaN = createTypeGuard(TYPE.NaN);
254
+ /**
255
+ * Checks whether a value is positive or negative infinity.
256
+ *
257
+ * @param value Value to test.
258
+ * @returns `true` when the value is not finite.
259
+ *
260
+ * @example
261
+ * ```ts
262
+ * isInfinite(Infinity); // true
263
+ * ```
264
+ *
265
+ * @example
266
+ * ```ts
267
+ * isInfinite(10); // false
268
+ * ```
269
+ */
270
+ var isInfinite = createTypeGuard(TYPE.Infinite);
271
+ /**
272
+ * Checks whether a value is a symbol.
273
+ *
274
+ * @param value Value to test.
275
+ * @returns `true` when the value is a symbol.
276
+ *
277
+ * @example
278
+ * ```ts
279
+ * isSymbol(Symbol('id')); // true
280
+ * ```
281
+ *
282
+ * @example
283
+ * ```ts
284
+ * isSymbol('id'); // false
285
+ * ```
286
+ */
287
+ var isSymbol = createTypeGuard(TYPE.Symbol);
288
+ //#endregion
289
+ Object.defineProperty(exports, "typeGuard", {
290
+ enumerable: true,
291
+ get: function() {
292
+ return _exports_exports;
293
+ }
294
+ });
295
+
296
+ //# sourceMappingURL=type-guard.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-guard.cjs","sources":["../src/type-guard/_exports.ts"],"sourcesContent":["import type { AnyFunction, AnyObject, ValueOf } from 'yummies/types';\n\nconst TYPE = {\n Null: 'null',\n Undefined: 'undefined',\n NaN: 'nan',\n Object: '[object Object]',\n Array: '[object Array]',\n String: '[object String]',\n Number: '[object Number]',\n Boolean: '[object Boolean]',\n Function: '[object Function]',\n AsyncFunction: '[object AsyncFunction]',\n RegExp: '[object RegExp]',\n Symbol: '[object Symbol]',\n Infinite: 'infinite',\n Element: 'element',\n};\n\ntype Type = ValueOf<typeof TYPE>;\n\nfunction getType(value: unknown): Type {\n if (value === undefined) {\n return TYPE.Undefined;\n }\n if (value === null) {\n return TYPE.Null;\n }\n\n // handle DOM elements\n // @ts-expect-error\n if (value && (value.nodeType === 1 || value.nodeType === 9)) {\n return TYPE.Element;\n }\n\n const stringifiedValue = Object.prototype.toString.call(value);\n\n // handle NaN and Infinity\n if (stringifiedValue === TYPE.Number) {\n if (Number.isNaN(value as number)) {\n return TYPE.NaN;\n }\n if (!Number.isFinite(value as number)) {\n return TYPE.Infinite;\n }\n }\n\n return stringifiedValue as Type;\n}\n\nconst createTypeGuard =\n <T>(...types: Type[]) =>\n (value: unknown): value is T =>\n types.includes(getType(value));\n\n/**\n * Check if a value is not null or undefined\n * @param value the value to check\n * @returns boolean\n */\nexport const isDefined = <T>(value: T | undefined | null): value is T =>\n value != null;\n\n/**\n * Check if a value is null\n * @param value the value to check\n * @returns boolean\n */\nexport const isNull = createTypeGuard<null>(TYPE.Null);\n\n/**\n * Check if a value is undefined\n * @param value the value to check\n * @returns boolean\n */\nexport const isUndefined = createTypeGuard<undefined>(TYPE.Undefined);\n\n/**\n * Check if a value is an object\n * @param value the value to check\n * @returns boolean\n */\nexport const isObject = createTypeGuard<AnyObject>(TYPE.Object);\n\n/**\n * Check if a value is an array\n * @param value the value to check\n * @returns boolean\n */\nexport const isArray = createTypeGuard<unknown[]>(TYPE.Array);\n\n/**\n * Check if a value is a string\n * @param value the value to check\n * @returns boolean\n */\nexport const isString = createTypeGuard<string>(TYPE.String);\n\n/**\n * Check if a value is a number\n * @param value the value to check\n * @returns boolean\n */\nexport const isNumber = createTypeGuard<number>(TYPE.Number);\n\n/**\n * Check if a value is a boolean\n * @param value the value to check\n * @returns boolean\n */\nexport const isBoolean = createTypeGuard<boolean>(TYPE.Boolean);\n\n/**\n * Check if a value is a function\n * @param value the value to check\n * @returns boolean\n */\nexport const isFunction = createTypeGuard<AnyFunction>(\n TYPE.Function,\n TYPE.AsyncFunction,\n);\n\n/**\n * Check if a value is a regular expression\n * @param value the value to check\n * @returns boolean\n */\nexport const isRegExp = createTypeGuard<RegExp>(TYPE.RegExp);\n\n/**\n * Check if a value is a DOM element\n * @param value the value to check\n * @returns boolean\n */\nexport const isElement = createTypeGuard<HTMLElement>(TYPE.Element);\n\n/**\n * Check if a value is NaN\n * @param value the value to check\n * @returns boolean\n */\nexport const isNaN = createTypeGuard<number>(TYPE.NaN) as (\n value: unknown,\n) => boolean;\n\n/**\n * Check if a value is infinity\n * @param value the value to check\n * @returns boolean\n */\nexport const isInfinite = createTypeGuard<number>(TYPE.Infinite) as (\n value: unknown,\n) => boolean;\n\n/**\n * Check if a value is a symbol\n * @param value the value to check\n * @returns boolean\n */\nexport const isSymbol = createTypeGuard<symbol>(TYPE.Symbol);\n"],"names":[],"mappings":";;AAEA,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,WAAW;AAAA,EACX,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AACX;AAIA,SAAS,QAAQ,OAAsB;AACrC,MAAI,UAAU,QAAW;AACvB,WAAO,KAAK;AAAA,EACd;AACA,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK;AAAA,EACd;AAIA,MAAI,UAAU,MAAM,aAAa,KAAK,MAAM,aAAa,IAAI;AAC3D,WAAO,KAAK;AAAA,EACd;AAEA,QAAM,mBAAmB,OAAO,UAAU,SAAS,KAAK,KAAK;AAG7D,MAAI,qBAAqB,KAAK,QAAQ;AACpC,QAAI,OAAO,MAAM,KAAe,GAAG;AACjC,aAAO,KAAK;AAAA,IACd;AACA,QAAI,CAAC,OAAO,SAAS,KAAe,GAAG;AACrC,aAAO,KAAK;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,kBACJ,IAAO,UACP,CAAC,UACC,MAAM,SAAS,QAAQ,KAAK,CAAC;AAO1B,MAAM,YAAY,CAAI,UAC3B,SAAS;AAOJ,MAAM,SAAS,gBAAsB,KAAK,IAAI;AAO9C,MAAM,cAAc,gBAA2B,KAAK,SAAS;AAO7D,MAAM,WAAW,gBAA2B,KAAK,MAAM;AAOvD,MAAM,UAAU,gBAA2B,KAAK,KAAK;AAOrD,MAAM,WAAW,gBAAwB,KAAK,MAAM;AAOpD,MAAM,WAAW,gBAAwB,KAAK,MAAM;AAOpD,MAAM,YAAY,gBAAyB,KAAK,OAAO;AAOvD,MAAM,aAAa;AAAA,EACxB,KAAK;AAAA,EACL,KAAK;AACP;AAOO,MAAM,WAAW,gBAAwB,KAAK,MAAM;AAOpD,MAAM,YAAY,gBAA6B,KAAK,OAAO;AAO3D,MAAM,QAAQ,gBAAwB,KAAK,GAAG;AAS9C,MAAM,aAAa,gBAAwB,KAAK,QAAQ;AASxD,MAAM,WAAW,gBAAwB,KAAK,MAAM;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"type-guard.cjs","names":[],"sources":["../src/type-guard/_exports.ts"],"sourcesContent":["import type { AnyFunction, AnyObject, ValueOf } from 'yummies/types';\n\nconst TYPE = {\n Null: 'null',\n Undefined: 'undefined',\n NaN: 'nan',\n Object: '[object Object]',\n Array: '[object Array]',\n String: '[object String]',\n Number: '[object Number]',\n Boolean: '[object Boolean]',\n Function: '[object Function]',\n AsyncFunction: '[object AsyncFunction]',\n RegExp: '[object RegExp]',\n Symbol: '[object Symbol]',\n Infinite: 'infinite',\n Element: 'element',\n};\n\ntype Type = ValueOf<typeof TYPE>;\n\nfunction getType(value: unknown): Type {\n if (value === undefined) {\n return TYPE.Undefined;\n }\n if (value === null) {\n return TYPE.Null;\n }\n\n // handle DOM elements\n // @ts-expect-error\n if (value && (value.nodeType === 1 || value.nodeType === 9)) {\n return TYPE.Element;\n }\n\n const stringifiedValue = Object.prototype.toString.call(value);\n\n // handle NaN and Infinity\n if (stringifiedValue === TYPE.Number) {\n if (Number.isNaN(value as number)) {\n return TYPE.NaN;\n }\n if (!Number.isFinite(value as number)) {\n return TYPE.Infinite;\n }\n }\n\n return stringifiedValue as Type;\n}\n\nconst createTypeGuard =\n <T>(...types: Type[]) =>\n (value: unknown): value is T =>\n types.includes(getType(value));\n\n/**\n * Checks that a value is neither `null` nor `undefined`.\n *\n * @template T Value type without nullish branches.\n * @param value Value to test.\n * @returns `true` when the value is defined.\n *\n * @example\n * ```ts\n * isDefined(0); // true\n * ```\n *\n * @example\n * ```ts\n * isDefined(null); // false\n * ```\n */\nexport const isDefined = <T>(value: T | undefined | null): value is T =>\n value != null;\n\n/**\n * Checks whether a value is exactly `null`.\n *\n * @param value Value to test.\n * @returns `true` when the value is `null`.\n *\n * @example\n * ```ts\n * isNull(null); // true\n * ```\n *\n * @example\n * ```ts\n * isNull(undefined); // false\n * ```\n */\nexport const isNull = createTypeGuard<null>(TYPE.Null);\n\n/**\n * Checks whether a value is exactly `undefined`.\n *\n * @param value Value to test.\n * @returns `true` when the value is `undefined`.\n *\n * @example\n * ```ts\n * isUndefined(undefined); // true\n * ```\n *\n * @example\n * ```ts\n * isUndefined('value'); // false\n * ```\n */\nexport const isUndefined = createTypeGuard<undefined>(TYPE.Undefined);\n\n/**\n * Checks whether a value is a plain object.\n *\n * @param value Value to test.\n * @returns `true` when the value matches `[object Object]`.\n *\n * @example\n * ```ts\n * isObject({ id: 1 }); // true\n * ```\n *\n * @example\n * ```ts\n * isObject([]); // false\n * ```\n */\nexport const isObject = createTypeGuard<AnyObject>(TYPE.Object);\n\n/**\n * Checks whether a value is an array.\n *\n * @param value Value to test.\n * @returns `true` when the value is an array.\n *\n * @example\n * ```ts\n * isArray([1, 2, 3]); // true\n * ```\n *\n * @example\n * ```ts\n * isArray({ length: 1 }); // false\n * ```\n */\nexport const isArray = createTypeGuard<unknown[]>(TYPE.Array);\n\n/**\n * Checks whether a value is a string object or primitive string.\n *\n * @param value Value to test.\n * @returns `true` when the value is a string.\n *\n * @example\n * ```ts\n * isString('hello'); // true\n * ```\n *\n * @example\n * ```ts\n * isString(123); // false\n * ```\n */\nexport const isString = createTypeGuard<string>(TYPE.String);\n\n/**\n * Checks whether a value is a finite number.\n *\n * Unlike `isNaN` and `isInfinite`, this guard only matches regular numeric values.\n *\n * @param value Value to test.\n * @returns `true` when the value is a non-NaN finite number.\n *\n * @example\n * ```ts\n * isNumber(123); // true\n * ```\n *\n * @example\n * ```ts\n * isNumber(Number.NaN); // false\n * ```\n */\nexport const isNumber = createTypeGuard<number>(TYPE.Number);\n\n/**\n * Checks whether a value is a boolean.\n *\n * @param value Value to test.\n * @returns `true` when the value is a boolean.\n *\n * @example\n * ```ts\n * isBoolean(true); // true\n * ```\n *\n * @example\n * ```ts\n * isBoolean('true'); // false\n * ```\n */\nexport const isBoolean = createTypeGuard<boolean>(TYPE.Boolean);\n\n/**\n * Checks whether a value is a synchronous or asynchronous function.\n *\n * @param value Value to test.\n * @returns `true` when the value is a function.\n *\n * @example\n * ```ts\n * isFunction(() => {}); // true\n * ```\n *\n * @example\n * ```ts\n * isFunction(async () => {}); // true\n * ```\n */\nexport const isFunction = createTypeGuard<AnyFunction>(\n TYPE.Function,\n TYPE.AsyncFunction,\n);\n\n/**\n * Checks whether a value is a regular expression.\n *\n * @param value Value to test.\n * @returns `true` when the value is a `RegExp`.\n *\n * @example\n * ```ts\n * isRegExp(/foo/); // true\n * ```\n *\n * @example\n * ```ts\n * isRegExp('foo'); // false\n * ```\n */\nexport const isRegExp = createTypeGuard<RegExp>(TYPE.RegExp);\n\n/**\n * Checks whether a value looks like a DOM element or document node.\n *\n * @param value Value to test.\n * @returns `true` when the value has an element-like node type.\n *\n * @example\n * ```ts\n * isElement(document.body); // true\n * ```\n *\n * @example\n * ```ts\n * isElement({ nodeType: 3 }); // false\n * ```\n */\nexport const isElement = createTypeGuard<HTMLElement>(TYPE.Element);\n\n/**\n * Checks whether a value is `NaN`.\n *\n * @param value Value to test.\n * @returns `true` when the value is `NaN`.\n *\n * @example\n * ```ts\n * isNaN(Number.NaN); // true\n * ```\n *\n * @example\n * ```ts\n * isNaN(5); // false\n * ```\n */\nexport const isNaN = createTypeGuard<number>(TYPE.NaN) as (\n value: unknown,\n) => boolean;\n\n/**\n * Checks whether a value is positive or negative infinity.\n *\n * @param value Value to test.\n * @returns `true` when the value is not finite.\n *\n * @example\n * ```ts\n * isInfinite(Infinity); // true\n * ```\n *\n * @example\n * ```ts\n * isInfinite(10); // false\n * ```\n */\nexport const isInfinite = createTypeGuard<number>(TYPE.Infinite) as (\n value: unknown,\n) => boolean;\n\n/**\n * Checks whether a value is a symbol.\n *\n * @param value Value to test.\n * @returns `true` when the value is a symbol.\n *\n * @example\n * ```ts\n * isSymbol(Symbol('id')); // true\n * ```\n *\n * @example\n * ```ts\n * isSymbol('id'); // false\n * ```\n */\nexport const isSymbol = createTypeGuard<symbol>(TYPE.Symbol);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,IAAM,OAAO;CACX,MAAM;CACN,WAAW;CACX,KAAK;CACL,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,eAAe;CACf,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,SAAS;CACV;AAID,SAAS,QAAQ,OAAsB;AACrC,KAAI,UAAU,KAAA,EACZ,QAAO,KAAK;AAEd,KAAI,UAAU,KACZ,QAAO,KAAK;AAKd,KAAI,UAAU,MAAM,aAAa,KAAK,MAAM,aAAa,GACvD,QAAO,KAAK;CAGd,MAAM,mBAAmB,OAAO,UAAU,SAAS,KAAK,MAAM;AAG9D,KAAI,qBAAqB,KAAK,QAAQ;AACpC,MAAI,OAAO,MAAM,MAAgB,CAC/B,QAAO,KAAK;AAEd,MAAI,CAAC,OAAO,SAAS,MAAgB,CACnC,QAAO,KAAK;;AAIhB,QAAO;;AAGT,IAAM,mBACA,GAAG,WACN,UACC,MAAM,SAAS,QAAQ,MAAM,CAAC;;;;;;;;;;;;;;;;;;AAmBlC,IAAa,aAAgB,UAC3B,SAAS;;;;;;;;;;;;;;;;;AAkBX,IAAa,SAAS,gBAAsB,KAAK,KAAK;;;;;;;;;;;;;;;;;AAkBtD,IAAa,cAAc,gBAA2B,KAAK,UAAU;;;;;;;;;;;;;;;;;AAkBrE,IAAa,WAAW,gBAA2B,KAAK,OAAO;;;;;;;;;;;;;;;;;AAkB/D,IAAa,UAAU,gBAA2B,KAAK,MAAM;;;;;;;;;;;;;;;;;AAkB7D,IAAa,WAAW,gBAAwB,KAAK,OAAO;;;;;;;;;;;;;;;;;;;AAoB5D,IAAa,WAAW,gBAAwB,KAAK,OAAO;;;;;;;;;;;;;;;;;AAkB5D,IAAa,YAAY,gBAAyB,KAAK,QAAQ;;;;;;;;;;;;;;;;;AAkB/D,IAAa,aAAa,gBACxB,KAAK,UACL,KAAK,cACN;;;;;;;;;;;;;;;;;AAkBD,IAAa,WAAW,gBAAwB,KAAK,OAAO;;;;;;;;;;;;;;;;;AAkB5D,IAAa,YAAY,gBAA6B,KAAK,QAAQ;;;;;;;;;;;;;;;;;AAkBnE,IAAa,QAAQ,gBAAwB,KAAK,IAAI;;;;;;;;;;;;;;;;;AAoBtD,IAAa,aAAa,gBAAwB,KAAK,SAAS;;;;;;;;;;;;;;;;;AAoBhE,IAAa,WAAW,gBAAwB,KAAK,OAAO"}