@choksheak/ts-utils 0.2.9 → 0.3.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 (315) hide show
  1. package/README.md +2 -0
  2. package/{arrayBuffer.js → arrayBuffer.cjs} +0 -1
  3. package/arrayBuffer.d.mts +10 -0
  4. package/arrayBuffer.d.ts +4 -2
  5. package/arrayBuffer.min.cjs +2 -0
  6. package/arrayBuffer.min.cjs.map +1 -0
  7. package/arrayBuffer.min.mjs +2 -0
  8. package/{arrayBuffer.js.map → arrayBuffer.min.mjs.map} +1 -1
  9. package/arrayBuffer.mjs +14 -0
  10. package/{assert.js → assert.cjs} +0 -1
  11. package/assert.d.mts +7 -0
  12. package/assert.d.ts +3 -1
  13. package/assert.min.cjs +2 -0
  14. package/assert.min.cjs.map +1 -0
  15. package/assert.min.mjs +2 -0
  16. package/{assert.js.map → assert.min.mjs.map} +1 -1
  17. package/assert.mjs +11 -0
  18. package/{average.js → average.cjs} +0 -1
  19. package/average.d.mts +7 -0
  20. package/average.d.ts +3 -1
  21. package/average.min.cjs +2 -0
  22. package/{average.js.map → average.min.cjs.map} +1 -1
  23. package/average.min.mjs +2 -0
  24. package/average.min.mjs.map +1 -0
  25. package/average.mjs +20 -0
  26. package/{base64Url.js → base64Url.cjs} +0 -1
  27. package/base64Url.d.mts +10 -0
  28. package/base64Url.d.ts +4 -2
  29. package/base64Url.min.cjs +2 -0
  30. package/base64Url.min.cjs.map +1 -0
  31. package/base64Url.min.mjs +2 -0
  32. package/{base64Url.js.map → base64Url.min.mjs.map} +1 -1
  33. package/base64Url.mjs +14 -0
  34. package/{dateTimeStr.js → dateTimeStr.cjs} +0 -1
  35. package/dateTimeStr.d.mts +85 -0
  36. package/dateTimeStr.d.ts +15 -13
  37. package/dateTimeStr.min.cjs +2 -0
  38. package/dateTimeStr.min.cjs.map +1 -0
  39. package/dateTimeStr.min.mjs +2 -0
  40. package/{dateTimeStr.js.map → dateTimeStr.min.mjs.map} +1 -1
  41. package/dateTimeStr.mjs +83 -0
  42. package/{duration.js → duration.cjs} +9 -11
  43. package/duration.d.mts +78 -0
  44. package/duration.d.ts +15 -13
  45. package/duration.min.cjs +2 -0
  46. package/duration.min.cjs.map +1 -0
  47. package/duration.min.mjs +2 -0
  48. package/duration.min.mjs.map +1 -0
  49. package/duration.mjs +154 -0
  50. package/{isEmpty.js → isEmpty.cjs} +0 -1
  51. package/isEmpty.d.mts +6 -0
  52. package/isEmpty.d.ts +3 -1
  53. package/isEmpty.min.cjs +2 -0
  54. package/isEmpty.min.cjs.map +1 -0
  55. package/isEmpty.min.mjs +2 -0
  56. package/{isEmpty.js.map → isEmpty.min.mjs.map} +1 -1
  57. package/isEmpty.mjs +22 -0
  58. package/iterators.cjs +34 -0
  59. package/iterators.d.mts +4 -0
  60. package/iterators.d.ts +4 -0
  61. package/iterators.min.cjs +2 -0
  62. package/iterators.min.cjs.map +1 -0
  63. package/iterators.min.mjs +2 -0
  64. package/iterators.min.mjs.map +1 -0
  65. package/iterators.mjs +9 -0
  66. package/kvStore.cjs +365 -0
  67. package/kvStore.d.mts +139 -0
  68. package/kvStore.d.ts +95 -50
  69. package/kvStore.min.cjs +2 -0
  70. package/kvStore.min.cjs.map +1 -0
  71. package/kvStore.min.mjs +2 -0
  72. package/kvStore.min.mjs.map +1 -0
  73. package/kvStore.mjs +333 -0
  74. package/localStore.cjs +267 -0
  75. package/localStore.d.mts +119 -0
  76. package/localStore.d.ts +119 -0
  77. package/localStore.min.cjs +2 -0
  78. package/localStore.min.cjs.map +1 -0
  79. package/localStore.min.mjs +2 -0
  80. package/localStore.min.mjs.map +1 -0
  81. package/localStore.mjs +235 -0
  82. package/{logging.js → logging.cjs} +0 -1
  83. package/logging.d.mts +4 -0
  84. package/logging.d.ts +4 -2
  85. package/logging.min.cjs +2 -0
  86. package/logging.min.cjs.map +1 -0
  87. package/logging.min.mjs +2 -0
  88. package/{logging.js.map → logging.min.mjs.map} +1 -1
  89. package/logging.mjs +21 -0
  90. package/{nonEmpty.js → nonEmpty.cjs} +0 -1
  91. package/nonEmpty.d.mts +10 -0
  92. package/nonEmpty.d.ts +3 -1
  93. package/nonEmpty.min.cjs +2 -0
  94. package/{nonEmpty.js.map → nonEmpty.min.cjs.map} +1 -1
  95. package/nonEmpty.min.mjs +2 -0
  96. package/nonEmpty.min.mjs.map +1 -0
  97. package/nonEmpty.mjs +30 -0
  98. package/{nonNil.js → nonNil.cjs} +0 -1
  99. package/{src/nonNil.ts → nonNil.d.mts} +3 -6
  100. package/nonNil.d.ts +3 -1
  101. package/nonNil.min.cjs +2 -0
  102. package/nonNil.min.cjs.map +1 -0
  103. package/nonNil.min.mjs +2 -0
  104. package/{nonNil.js.map → nonNil.min.mjs.map} +1 -1
  105. package/nonNil.mjs +10 -0
  106. package/package.json +447 -24
  107. package/{round.js → round.cjs} +0 -1
  108. package/{src/round.ts → round.d.mts} +4 -8
  109. package/round.d.ts +4 -2
  110. package/round.min.cjs +2 -0
  111. package/round.min.cjs.map +1 -0
  112. package/round.min.mjs +2 -0
  113. package/{round.js.map → round.min.mjs.map} +1 -1
  114. package/round.mjs +12 -0
  115. package/{safeBtoa.js → safeBtoa.cjs} +0 -1
  116. package/safeBtoa.d.mts +6 -0
  117. package/safeBtoa.d.ts +3 -1
  118. package/safeBtoa.min.cjs +2 -0
  119. package/safeBtoa.min.cjs.map +1 -0
  120. package/safeBtoa.min.mjs +2 -0
  121. package/{safeBtoa.js.map → safeBtoa.min.mjs.map} +1 -1
  122. package/safeBtoa.mjs +9 -0
  123. package/{safeParseFloat.js → safeParseFloat.cjs} +0 -1
  124. package/safeParseFloat.d.mts +6 -0
  125. package/safeParseFloat.d.ts +3 -1
  126. package/safeParseFloat.min.cjs +2 -0
  127. package/safeParseFloat.min.cjs.map +1 -0
  128. package/safeParseFloat.min.mjs +2 -0
  129. package/{safeParseFloat.js.map → safeParseFloat.min.mjs.map} +1 -1
  130. package/safeParseFloat.mjs +8 -0
  131. package/{safeParseInt.js → safeParseInt.cjs} +0 -1
  132. package/safeParseInt.d.mts +6 -0
  133. package/safeParseInt.d.ts +3 -1
  134. package/safeParseInt.min.cjs +2 -0
  135. package/safeParseInt.min.cjs.map +1 -0
  136. package/safeParseInt.min.mjs +2 -0
  137. package/{safeParseInt.js.map → safeParseInt.min.mjs.map} +1 -1
  138. package/safeParseInt.mjs +8 -0
  139. package/sha256.cjs +35 -0
  140. package/sha256.d.mts +6 -0
  141. package/sha256.d.ts +3 -1
  142. package/sha256.min.cjs +2 -0
  143. package/sha256.min.cjs.map +1 -0
  144. package/sha256.min.mjs +2 -0
  145. package/{sha256.js.map → sha256.min.mjs.map} +1 -1
  146. package/sha256.mjs +10 -0
  147. package/{sleep.js → sleep.cjs} +0 -1
  148. package/{src/sleep.ts → sleep.d.mts} +3 -3
  149. package/sleep.d.ts +3 -1
  150. package/sleep.min.cjs +2 -0
  151. package/sleep.min.cjs.map +1 -0
  152. package/sleep.min.mjs +2 -0
  153. package/{sleep.js.map → sleep.min.mjs.map} +1 -1
  154. package/sleep.mjs +7 -0
  155. package/storageAdapter.cjs +18 -0
  156. package/storageAdapter.d.mts +33 -0
  157. package/storageAdapter.d.ts +33 -0
  158. package/storageAdapter.min.cjs +2 -0
  159. package/storageAdapter.min.cjs.map +1 -0
  160. package/storageAdapter.min.mjs +1 -0
  161. package/storageAdapter.min.mjs.map +1 -0
  162. package/storageAdapter.mjs +0 -0
  163. package/{sum.js → sum.cjs} +0 -1
  164. package/sum.d.mts +7 -0
  165. package/sum.d.ts +3 -1
  166. package/sum.min.cjs +2 -0
  167. package/sum.min.cjs.map +1 -0
  168. package/sum.min.mjs +2 -0
  169. package/{sum.js.map → sum.min.mjs.map} +1 -1
  170. package/sum.mjs +13 -0
  171. package/{timeConstants.js → timeConstants.cjs} +0 -1
  172. package/timeConstants.d.mts +20 -0
  173. package/timeConstants.d.ts +16 -14
  174. package/timeConstants.min.cjs +2 -0
  175. package/timeConstants.min.cjs.map +1 -0
  176. package/timeConstants.min.mjs +2 -0
  177. package/{timeConstants.js.map → timeConstants.min.mjs.map} +1 -1
  178. package/timeConstants.mjs +31 -0
  179. package/{timer.js → timer.cjs} +6 -6
  180. package/timer.d.mts +13 -0
  181. package/timer.d.ts +4 -2
  182. package/timer.min.cjs +2 -0
  183. package/timer.min.cjs.map +1 -0
  184. package/timer.min.mjs +2 -0
  185. package/timer.min.mjs.map +1 -0
  186. package/timer.mjs +161 -0
  187. package/docs/.nojekyll +0 -1
  188. package/docs/assets/hierarchy.js +0 -1
  189. package/docs/assets/highlight.css +0 -22
  190. package/docs/assets/icons.js +0 -18
  191. package/docs/assets/icons.svg +0 -1
  192. package/docs/assets/main.js +0 -60
  193. package/docs/assets/navigation.js +0 -1
  194. package/docs/assets/search.js +0 -1
  195. package/docs/assets/style.css +0 -1640
  196. package/docs/classes/kvStore.KVStore.html +0 -26
  197. package/docs/classes/kvStore.KVStoreField.html +0 -7
  198. package/docs/classes/timer.Timer.html +0 -8
  199. package/docs/functions/arrayBuffer.arrayBufferToBase64.html +0 -2
  200. package/docs/functions/arrayBuffer.arrayBufferToHex.html +0 -2
  201. package/docs/functions/assert.assert.html +0 -3
  202. package/docs/functions/average.average.html +0 -3
  203. package/docs/functions/base64Url.base64ToBase64URL.html +0 -2
  204. package/docs/functions/base64Url.base64UrlToBase64.html +0 -2
  205. package/docs/functions/dateTimeStr.getDisplayDateTime.html +0 -3
  206. package/docs/functions/dateTimeStr.getLongMonthNameOneIndexed.html +0 -4
  207. package/docs/functions/dateTimeStr.getLongMonthNameZeroIndexed.html +0 -4
  208. package/docs/functions/dateTimeStr.getShortMonthNameOneIndexed.html +0 -4
  209. package/docs/functions/dateTimeStr.getShortMonthNameZeroIndexed.html +0 -4
  210. package/docs/functions/dateTimeStr.hhMm.html +0 -4
  211. package/docs/functions/dateTimeStr.hhMmSs.html +0 -4
  212. package/docs/functions/dateTimeStr.hhMmSsMs.html +0 -5
  213. package/docs/functions/dateTimeStr.toDate.html +0 -4
  214. package/docs/functions/dateTimeStr.tzShort.html +0 -4
  215. package/docs/functions/dateTimeStr.yyyyMm.html +0 -4
  216. package/docs/functions/dateTimeStr.yyyyMmDd.html +0 -4
  217. package/docs/functions/duration.durationOrMsToMs.html +0 -2
  218. package/docs/functions/duration.durationToMs.html +0 -2
  219. package/docs/functions/duration.elapsed.html +0 -2
  220. package/docs/functions/duration.formatDuration.html +0 -4
  221. package/docs/functions/duration.msToDuration.html +0 -5
  222. package/docs/functions/duration.readableDuration.html +0 -4
  223. package/docs/functions/isEmpty.isEmpty.html +0 -2
  224. package/docs/functions/kvStore.kvStoreItem.html +0 -2
  225. package/docs/functions/localStorageCache.storeItem.html +0 -15
  226. package/docs/functions/logging.capLength.html +0 -1
  227. package/docs/functions/logging.stringify.html +0 -1
  228. package/docs/functions/nonEmpty.nonEmpty.html +0 -5
  229. package/docs/functions/nonNil.nonNil.html +0 -5
  230. package/docs/functions/round.round.html +0 -5
  231. package/docs/functions/round.roundS.html +0 -3
  232. package/docs/functions/safeBtoa.safeBtoa.html +0 -2
  233. package/docs/functions/safeParseFloat.safeParseFloat.html +0 -2
  234. package/docs/functions/safeParseInt.safeParseInt.html +0 -2
  235. package/docs/functions/sha256.sha256.html +0 -2
  236. package/docs/functions/sleep.sleep.html +0 -3
  237. package/docs/functions/sum.sum.html +0 -3
  238. package/docs/functions/timer.timer.html +0 -2
  239. package/docs/hierarchy.html +0 -1
  240. package/docs/index.html +0 -4
  241. package/docs/modules/arrayBuffer.html +0 -1
  242. package/docs/modules/assert.html +0 -1
  243. package/docs/modules/average.html +0 -1
  244. package/docs/modules/base64Url.html +0 -1
  245. package/docs/modules/dateTimeStr.html +0 -1
  246. package/docs/modules/duration.html +0 -1
  247. package/docs/modules/isEmpty.html +0 -1
  248. package/docs/modules/kvStore.html +0 -1
  249. package/docs/modules/localStorageCache.html +0 -1
  250. package/docs/modules/logging.html +0 -1
  251. package/docs/modules/nonEmpty.html +0 -1
  252. package/docs/modules/nonNil.html +0 -1
  253. package/docs/modules/round.html +0 -1
  254. package/docs/modules/safeBtoa.html +0 -1
  255. package/docs/modules/safeParseFloat.html +0 -1
  256. package/docs/modules/safeParseInt.html +0 -1
  257. package/docs/modules/sha256.html +0 -1
  258. package/docs/modules/sleep.html +0 -1
  259. package/docs/modules/sum.html +0 -1
  260. package/docs/modules/timeConstants.html +0 -1
  261. package/docs/modules/timer.html +0 -1
  262. package/docs/modules.html +0 -1
  263. package/docs/types/dateTimeStr.AnyDateTime.html +0 -1
  264. package/docs/types/duration.Duration.html +0 -6
  265. package/docs/types/duration.DurationStyle.html +0 -6
  266. package/docs/types/duration.DurationSuffixMap.html +0 -6
  267. package/docs/types/duration.DurationSuffixType.html +0 -1
  268. package/docs/types/duration.DurationType.html +0 -2
  269. package/docs/types/localStorageCache.StoredItem.html +0 -4
  270. package/docs/variables/duration.DURATION_STYLE_SUFFIX_MAP.html +0 -1
  271. package/docs/variables/duration.DURATION_TYPE_SEQUENCE.html +0 -2
  272. package/docs/variables/kvStore.DEFAULT_EXPIRY_DELTA_MS.html +0 -2
  273. package/docs/variables/kvStore.GC_INTERVAL_MS.html +0 -2
  274. package/docs/variables/kvStore.MILLIS_PER_DAY.html +0 -2
  275. package/docs/variables/kvStore.kvStore.html +0 -3
  276. package/docs/variables/timeConstants.HOURS_PER_DAY.html +0 -1
  277. package/docs/variables/timeConstants.HOURS_PER_WEEK.html +0 -1
  278. package/docs/variables/timeConstants.MINUTES_PER_DAY.html +0 -1
  279. package/docs/variables/timeConstants.MINUTES_PER_HOUR.html +0 -1
  280. package/docs/variables/timeConstants.MINUTES_PER_WEEK.html +0 -1
  281. package/docs/variables/timeConstants.MS_PER_DAY.html +0 -1
  282. package/docs/variables/timeConstants.MS_PER_HOUR.html +0 -1
  283. package/docs/variables/timeConstants.MS_PER_MINUTE.html +0 -1
  284. package/docs/variables/timeConstants.MS_PER_SECOND.html +0 -3
  285. package/docs/variables/timeConstants.MS_PER_WEEK.html +0 -1
  286. package/docs/variables/timeConstants.SECONDS_PER_DAY.html +0 -1
  287. package/docs/variables/timeConstants.SECONDS_PER_HOUR.html +0 -1
  288. package/docs/variables/timeConstants.SECONDS_PER_MINUTE.html +0 -1
  289. package/docs/variables/timeConstants.SECONDS_PER_WEEK.html +0 -1
  290. package/duration.js.map +0 -1
  291. package/kvStore.js +0 -383
  292. package/kvStore.js.map +0 -1
  293. package/localStorageCache.d.ts +0 -55
  294. package/localStorageCache.js +0 -121
  295. package/localStorageCache.js.map +0 -1
  296. package/sha256.js +0 -58
  297. package/src/arrayBuffer.ts +0 -29
  298. package/src/assert.ts +0 -14
  299. package/src/average.ts +0 -13
  300. package/src/base64Url.ts +0 -20
  301. package/src/dateTimeStr.ts +0 -184
  302. package/src/duration.ts +0 -260
  303. package/src/isEmpty.ts +0 -32
  304. package/src/kvStore.ts +0 -444
  305. package/src/localStorageCache.ts +0 -121
  306. package/src/logging.ts +0 -26
  307. package/src/nonEmpty.ts +0 -18
  308. package/src/safeBtoa.ts +0 -15
  309. package/src/safeParseFloat.ts +0 -10
  310. package/src/safeParseInt.ts +0 -10
  311. package/src/sha256.ts +0 -13
  312. package/src/sum.ts +0 -17
  313. package/src/timeConstants.ts +0 -22
  314. package/src/timer.ts +0 -33
  315. package/timer.js.map +0 -1
package/logging.mjs ADDED
@@ -0,0 +1,21 @@
1
+ // src/logging.ts
2
+ function stringify(u) {
3
+ if (typeof u === "string") {
4
+ return u;
5
+ }
6
+ if (u !== null && typeof u === "object" && u.toString !== Object.prototype.toString) {
7
+ return u.toString();
8
+ }
9
+ return JSON.stringify(u);
10
+ }
11
+ function capLength(u, maxLength = 400) {
12
+ const s = stringify(u);
13
+ if (s.length <= maxLength) {
14
+ return s;
15
+ }
16
+ return s.slice(0, maxLength) + ` ... (${s.length - maxLength} more)`;
17
+ }
18
+ export {
19
+ capLength,
20
+ stringify
21
+ };
@@ -55,4 +55,3 @@ function nonEmpty(t, varName = "value") {
55
55
  0 && (module.exports = {
56
56
  nonEmpty
57
57
  });
58
- //# sourceMappingURL=nonEmpty.js.map
package/nonEmpty.d.mts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Type asserts that `t` is truthy.
3
+ * Throws an error if `t` is null or undefined.
4
+ *
5
+ * @param varName The variable name to include in the error to throw when t is
6
+ * empty. Defaults to 'value'.
7
+ */
8
+ declare function nonEmpty<T>(t: T | null | undefined | "" | 0 | -0 | 0n | false | typeof NaN, varName?: string): T;
9
+
10
+ export { nonEmpty };
package/nonEmpty.d.ts CHANGED
@@ -5,4 +5,6 @@
5
5
  * @param varName The variable name to include in the error to throw when t is
6
6
  * empty. Defaults to 'value'.
7
7
  */
8
- export declare function nonEmpty<T>(t: T | null | undefined | "" | 0 | -0 | 0n | false | typeof NaN, varName?: string): T;
8
+ declare function nonEmpty<T>(t: T | null | undefined | "" | 0 | -0 | 0n | false | typeof NaN, varName?: string): T;
9
+
10
+ export { nonEmpty };
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(n,e)=>{for(var o in e)t(n,o,{get:e[o],enumerable:!0})},a=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!p.call(n,r)&&r!==o&&t(n,r,{get:()=>e[r],enumerable:!(i=u(e,r))||i.enumerable});return n};var m=n=>a(t({},"__esModule",{value:!0}),n);var E={};s(E,{nonEmpty:()=>y});module.exports=m(E);function f(n){if(!n)return!0;if(typeof n!="object")return!1;if("length"in n)return n.length===0;if("size"in n)return n.size===0;for(let e in n)return!1;return!0}function y(n,e="value"){if(f(n))throw new Error(`Empty ${e}: ${n}`);return n}0&&(module.exports={nonEmpty});
2
+ //# sourceMappingURL=nonEmpty.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/nonEmpty.ts","../src/isEmpty.ts"],"sourcesContent":["import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n","/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,SAAS,QAAQ,GAAqB;AAE3C,MAAI,CAAC,GAAG;AACN,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,MAAM,UAAU;AACzB,WAAO;AAAA,EACT;AAGA,MAAI,YAAY,GAAG;AACjB,WAAO,EAAE,WAAW;AAAA,EACtB;AAGA,MAAI,UAAU,GAAG;AACf,WAAO,EAAE,SAAS;AAAA,EACpB;AAIA,aAAW,KAAK,GAAG;AACjB,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADtBO,SAAS,SACd,GACA,UAAU,SACP;AACH,MAAI,QAAQ,CAAC,GAAG;AACd,UAAM,IAAI,MAAM,SAAS,OAAO,KAAK,CAAC,EAAE;AAAA,EAC1C;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/nonEmpty.ts","../src/isEmpty.ts"],"sourcesContent":["import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n","/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GCGO,SAASI,EAAQC,EAAqB,CAE3C,GAAI,CAACA,EACH,MAAO,GAIT,GAAI,OAAOA,GAAM,SACf,MAAO,GAIT,GAAI,WAAYA,EACd,OAAOA,EAAE,SAAW,EAItB,GAAI,SAAUA,EACZ,OAAOA,EAAE,OAAS,EAKpB,QAAWC,KAAKD,EACd,MAAO,GAGT,MAAO,EACT,CDtBO,SAASE,EACdC,EACAC,EAAU,QACP,CACH,GAAIC,EAAQF,CAAC,EACX,MAAM,IAAI,MAAM,SAASC,CAAO,KAAKD,CAAC,EAAE,EAE1C,OAAOA,CACT","names":["nonEmpty_exports","__export","nonEmpty","__toCommonJS","isEmpty","t","k","nonEmpty","t","varName","isEmpty"]}
@@ -0,0 +1,2 @@
1
+ function r(n){if(!n)return!0;if(typeof n!="object")return!1;if("length"in n)return n.length===0;if("size"in n)return n.size===0;for(let e in n)return!1;return!0}function i(n,e="value"){if(r(n))throw new Error(`Empty ${e}: ${n}`);return n}export{i as nonEmpty};
2
+ //# sourceMappingURL=nonEmpty.min.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/isEmpty.ts","../src/nonEmpty.ts"],"sourcesContent":["/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n","import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n"],"mappings":"AAGO,SAASA,EAAQC,EAAqB,CAE3C,GAAI,CAACA,EACH,MAAO,GAIT,GAAI,OAAOA,GAAM,SACf,MAAO,GAIT,GAAI,WAAYA,EACd,OAAOA,EAAE,SAAW,EAItB,GAAI,SAAUA,EACZ,OAAOA,EAAE,OAAS,EAKpB,QAAWC,KAAKD,EACd,MAAO,GAGT,MAAO,EACT,CCtBO,SAASE,EACdC,EACAC,EAAU,QACP,CACH,GAAIC,EAAQF,CAAC,EACX,MAAM,IAAI,MAAM,SAASC,CAAO,KAAKD,CAAC,EAAE,EAE1C,OAAOA,CACT","names":["isEmpty","t","k","nonEmpty","t","varName","isEmpty"]}
package/nonEmpty.mjs ADDED
@@ -0,0 +1,30 @@
1
+ // src/isEmpty.ts
2
+ function isEmpty(t) {
3
+ if (!t) {
4
+ return true;
5
+ }
6
+ if (typeof t !== "object") {
7
+ return false;
8
+ }
9
+ if ("length" in t) {
10
+ return t.length === 0;
11
+ }
12
+ if ("size" in t) {
13
+ return t.size === 0;
14
+ }
15
+ for (const k in t) {
16
+ return false;
17
+ }
18
+ return true;
19
+ }
20
+
21
+ // src/nonEmpty.ts
22
+ function nonEmpty(t, varName = "value") {
23
+ if (isEmpty(t)) {
24
+ throw new Error(`Empty ${varName}: ${t}`);
25
+ }
26
+ return t;
27
+ }
28
+ export {
29
+ nonEmpty
30
+ };
@@ -33,4 +33,3 @@ function nonNil(t, varName = "value") {
33
33
  0 && (module.exports = {
34
34
  nonNil
35
35
  });
36
- //# sourceMappingURL=nonNil.js.map
@@ -5,9 +5,6 @@
5
5
  * @param varName The variable name to include in the error to throw when t is
6
6
  * nil. Defaults to 'value'.
7
7
  */
8
- export function nonNil<T>(t: T | null | undefined, varName = "value"): T {
9
- if (t === null || t === undefined) {
10
- throw new Error(`Missing ${varName}: ${t}`);
11
- }
12
- return t;
13
- }
8
+ declare function nonNil<T>(t: T | null | undefined, varName?: string): T;
9
+
10
+ export { nonNil };
package/nonNil.d.ts CHANGED
@@ -5,4 +5,6 @@
5
5
  * @param varName The variable name to include in the error to throw when t is
6
6
  * nil. Defaults to 'value'.
7
7
  */
8
- export declare function nonNil<T>(t: T | null | undefined, varName?: string): T;
8
+ declare function nonNil<T>(t: T | null | undefined, varName?: string): T;
9
+
10
+ export { nonNil };
package/nonNil.min.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=(n,e)=>{for(var r in e)u(n,r,{get:e[r],enumerable:!0})},s=(n,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!f.call(n,i)&&i!==r&&u(n,i,{get:()=>e[i],enumerable:!(l=o(e,i))||l.enumerable});return n};var w=n=>s(u({},"__esModule",{value:!0}),n);var a={};T(a,{nonNil:()=>$});module.exports=w(a);function $(n,e="value"){if(n==null)throw new Error(`Missing ${e}: ${n}`);return n}0&&(module.exports={nonNil});
2
+ //# sourceMappingURL=nonNil.min.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAOO,SAASE,EAAUE,EAAyBC,EAAU,QAAY,CACvE,GAAID,GAAM,KACR,MAAM,IAAI,MAAM,WAAWC,CAAO,KAAKD,CAAC,EAAE,EAE5C,OAAOA,CACT","names":["nonNil_exports","__export","nonNil","__toCommonJS","t","varName"]}
package/nonNil.min.mjs ADDED
@@ -0,0 +1,2 @@
1
+ function i(n,e="value"){if(n==null)throw new Error(`Missing ${e}: ${n}`);return n}export{i as nonNil};
2
+ //# sourceMappingURL=nonNil.min.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,OAAU,GAAyB,UAAU,SAAY;AACvE,MAAI,MAAM,QAAQ,MAAM,QAAW;AACjC,UAAM,IAAI,MAAM,WAAW,OAAO,KAAK,CAAC,EAAE;AAAA,EAC5C;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":"AAOO,SAASA,EAAUC,EAAyBC,EAAU,QAAY,CACvE,GAAID,GAAM,KACR,MAAM,IAAI,MAAM,WAAWC,CAAO,KAAKD,CAAC,EAAE,EAE5C,OAAOA,CACT","names":["nonNil","t","varName"]}
package/nonNil.mjs ADDED
@@ -0,0 +1,10 @@
1
+ // src/nonNil.ts
2
+ function nonNil(t, varName = "value") {
3
+ if (t === null || t === void 0) {
4
+ throw new Error(`Missing ${varName}: ${t}`);
5
+ }
6
+ return t;
7
+ }
8
+ export {
9
+ nonNil
10
+ };
package/package.json CHANGED
@@ -1,38 +1,461 @@
1
1
  {
2
2
  "name": "@choksheak/ts-utils",
3
3
  "license": "The Unlicense",
4
- "version": "0.2.9",
4
+ "version": "0.3.1",
5
5
  "description": "Random Typescript utilities with support for full tree-shaking",
6
6
  "private": false,
7
7
  "scripts": {
8
- "lint": "eslint src/**",
9
- "format": "prettier --write \"**/*.ts\"",
10
- "test": "npm run clean && jest",
11
- "test:watch": "npm run clean && jest --watch",
8
+ "lint": "eslint .",
9
+ "fix": "eslint . --fix",
10
+ "tsc": "npx tsc",
11
+ "ft": "npm run fix && npm run tsc",
12
+ "test": "vitest run",
13
+ "test:watch": "vitest",
14
+ "ci": "npm run lint && npm run tsc && npm run build && npm run test",
15
+ "ls": "lint-staged",
16
+ "docs": "rm -rf docs && typedoc `find src -name '*.ts' ! -name '*.test.ts'` --out docs --name 'Chok’s Typescript Utilities'",
12
17
  "clean": "rm -rf dist",
13
- "ci": "npm run lint && npm run format && npm run test",
14
18
  "build": "tsup src/*",
15
19
  "gen-types": "tsc --emitDeclarationOnly --declaration",
16
- "docs": "rm -rf docs && typedoc `find src -name '*.ts' ! -name '*.test.ts'` --out docs --name 'Chok’s Typescript Utilities'",
17
- "pub": "scripts/publish.sh"
20
+ "gen-exports": "tsx scripts/gen-exports.ts",
21
+ "bump": "tsx scripts/bump-version.ts",
22
+ "bump:patch": "tsx scripts/bump-version.ts --patch",
23
+ "bump:minor": "tsx scripts/bump-version.ts --minor",
24
+ "bump:major": "tsx scripts/bump-version.ts --major",
25
+ "pkg": "scripts/package.sh",
26
+ "pub": "npm publish dist/ --access=public",
27
+ "commit": "scripts/commit-release.sh",
28
+ "release": "npm run ci && npm run bump && npm i && npm run pkg && npm run pub && npm run commit",
29
+ "postinstall": "simple-git-hooks"
30
+ },
31
+ "simple-git-hooks": {
32
+ "pre-commit": "npx lint-staged"
33
+ },
34
+ "lint-staged": {
35
+ "*.{ts,tsx,js,jsx}": [
36
+ "echo Using `eslint --fix` will revert changes without printing errors!",
37
+ "npm run lint"
38
+ ],
39
+ "*.{ts,tsx}": [
40
+ "echo `tsc-files --noEmit` cannot read *.module.css files",
41
+ "bash -c 'npx tsc'"
42
+ ]
18
43
  },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/choksheak/ts-utils.git"
47
+ },
48
+ "keywords": [
49
+ "chok",
50
+ "TS",
51
+ "utils",
52
+ "typescript",
53
+ "library"
54
+ ],
55
+ "author": "ChokSheak Lau",
56
+ "type": "commonjs",
57
+ "homepage": "https://github.com/choksheak/ts-utils#readme",
19
58
  "devDependencies": {
20
- "@eslint/js": "^9.14.0",
21
- "@jest/globals": "^29.7.0",
22
- "@types/jest": "^27.5.2",
23
- "@types/node": "^16.18.97",
24
- "eslint": "^9.14.0",
59
+ "@eslint/compat": "^1.4.0",
60
+ "@eslint/js": "^9.38.0",
61
+ "@swc/core": "^1.14.0",
62
+ "@types/jest": "^30.0.0",
63
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
64
+ "@typescript-eslint/parser": "^8.46.2",
65
+ "eslint": "^9.38.0",
66
+ "eslint-config": "^0.3.0",
67
+ "eslint-config-prettier": "^10.1.8",
68
+ "eslint-plugin-import": "^2.32.0",
69
+ "eslint-plugin-prettier": "^5.5.4",
70
+ "eslint-plugin-simple-import-sort": "^12.1.1",
25
71
  "fake-indexeddb": "^6.0.0",
26
- "globals": "^15.12.0",
27
- "jest": "^29.7.0",
72
+ "globals": "^16.4.0",
28
73
  "jest-environment-jsdom": "^29.7.0",
29
- "jest-localstorage-mock": "^2.4.26",
30
- "prettier": "^3.3.3",
31
- "ts-jest": "^29.2.5",
32
- "ts-node": "^10.9.2",
33
- "tsup": "^8.3.5",
34
- "typedoc": "^0.28.3",
35
- "typescript": "^5.4.5",
36
- "typescript-eslint": "^8.13.0"
74
+ "jiti": "^2.6.1",
75
+ "lint-staged": "^16.2.6",
76
+ "mock-local-storage": "^1.1.24",
77
+ "prettier": "^3.6.2",
78
+ "simple-git-hooks": "^2.13.1",
79
+ "tsup": "^8.5.0",
80
+ "tsx": "^4.20.6",
81
+ "typedoc": "^0.28.14",
82
+ "typescript": "^5.9.3",
83
+ "typescript-eslint": "^8.46.2",
84
+ "vitest": "^4.0.3"
85
+ },
86
+ "exports": {
87
+ "./package.json": "./package.json",
88
+ "./arrayBuffer": {
89
+ "types": "./arrayBuffer.d.ts",
90
+ "import": {
91
+ "production": "./arrayBuffer.min.mjs",
92
+ "development": "./arrayBuffer.mjs",
93
+ "default": "./arrayBuffer.mjs"
94
+ },
95
+ "require": {
96
+ "production": "./arrayBuffer.min.cjs",
97
+ "development": "./arrayBuffer.cjs",
98
+ "default": "./arrayBuffer.cjs"
99
+ }
100
+ },
101
+ "./assert": {
102
+ "types": "./assert.d.ts",
103
+ "import": {
104
+ "production": "./assert.min.mjs",
105
+ "development": "./assert.mjs",
106
+ "default": "./assert.mjs"
107
+ },
108
+ "require": {
109
+ "production": "./assert.min.cjs",
110
+ "development": "./assert.cjs",
111
+ "default": "./assert.cjs"
112
+ }
113
+ },
114
+ "./average": {
115
+ "types": "./average.d.ts",
116
+ "import": {
117
+ "production": "./average.min.mjs",
118
+ "development": "./average.mjs",
119
+ "default": "./average.mjs"
120
+ },
121
+ "require": {
122
+ "production": "./average.min.cjs",
123
+ "development": "./average.cjs",
124
+ "default": "./average.cjs"
125
+ }
126
+ },
127
+ "./base64Url": {
128
+ "types": "./base64Url.d.ts",
129
+ "import": {
130
+ "production": "./base64Url.min.mjs",
131
+ "development": "./base64Url.mjs",
132
+ "default": "./base64Url.mjs"
133
+ },
134
+ "require": {
135
+ "production": "./base64Url.min.cjs",
136
+ "development": "./base64Url.cjs",
137
+ "default": "./base64Url.cjs"
138
+ }
139
+ },
140
+ "./dateTimeStr": {
141
+ "types": "./dateTimeStr.d.ts",
142
+ "import": {
143
+ "production": "./dateTimeStr.min.mjs",
144
+ "development": "./dateTimeStr.mjs",
145
+ "default": "./dateTimeStr.mjs"
146
+ },
147
+ "require": {
148
+ "production": "./dateTimeStr.min.cjs",
149
+ "development": "./dateTimeStr.cjs",
150
+ "default": "./dateTimeStr.cjs"
151
+ }
152
+ },
153
+ "./duration": {
154
+ "types": "./duration.d.ts",
155
+ "import": {
156
+ "production": "./duration.min.mjs",
157
+ "development": "./duration.mjs",
158
+ "default": "./duration.mjs"
159
+ },
160
+ "require": {
161
+ "production": "./duration.min.cjs",
162
+ "development": "./duration.cjs",
163
+ "default": "./duration.cjs"
164
+ }
165
+ },
166
+ "./isEmpty": {
167
+ "types": "./isEmpty.d.ts",
168
+ "import": {
169
+ "production": "./isEmpty.min.mjs",
170
+ "development": "./isEmpty.mjs",
171
+ "default": "./isEmpty.mjs"
172
+ },
173
+ "require": {
174
+ "production": "./isEmpty.min.cjs",
175
+ "development": "./isEmpty.cjs",
176
+ "default": "./isEmpty.cjs"
177
+ }
178
+ },
179
+ "./iterators": {
180
+ "types": "./iterators.d.ts",
181
+ "import": {
182
+ "production": "./iterators.min.mjs",
183
+ "development": "./iterators.mjs",
184
+ "default": "./iterators.mjs"
185
+ },
186
+ "require": {
187
+ "production": "./iterators.min.cjs",
188
+ "development": "./iterators.cjs",
189
+ "default": "./iterators.cjs"
190
+ }
191
+ },
192
+ "./kvStore": {
193
+ "types": "./kvStore.d.ts",
194
+ "import": {
195
+ "production": "./kvStore.min.mjs",
196
+ "development": "./kvStore.mjs",
197
+ "default": "./kvStore.mjs"
198
+ },
199
+ "require": {
200
+ "production": "./kvStore.min.cjs",
201
+ "development": "./kvStore.cjs",
202
+ "default": "./kvStore.cjs"
203
+ }
204
+ },
205
+ "./localStore": {
206
+ "types": "./localStore.d.ts",
207
+ "import": {
208
+ "production": "./localStore.min.mjs",
209
+ "development": "./localStore.mjs",
210
+ "default": "./localStore.mjs"
211
+ },
212
+ "require": {
213
+ "production": "./localStore.min.cjs",
214
+ "development": "./localStore.cjs",
215
+ "default": "./localStore.cjs"
216
+ }
217
+ },
218
+ "./logging": {
219
+ "types": "./logging.d.ts",
220
+ "import": {
221
+ "production": "./logging.min.mjs",
222
+ "development": "./logging.mjs",
223
+ "default": "./logging.mjs"
224
+ },
225
+ "require": {
226
+ "production": "./logging.min.cjs",
227
+ "development": "./logging.cjs",
228
+ "default": "./logging.cjs"
229
+ }
230
+ },
231
+ "./nonEmpty": {
232
+ "types": "./nonEmpty.d.ts",
233
+ "import": {
234
+ "production": "./nonEmpty.min.mjs",
235
+ "development": "./nonEmpty.mjs",
236
+ "default": "./nonEmpty.mjs"
237
+ },
238
+ "require": {
239
+ "production": "./nonEmpty.min.cjs",
240
+ "development": "./nonEmpty.cjs",
241
+ "default": "./nonEmpty.cjs"
242
+ }
243
+ },
244
+ "./nonNil": {
245
+ "types": "./nonNil.d.ts",
246
+ "import": {
247
+ "production": "./nonNil.min.mjs",
248
+ "development": "./nonNil.mjs",
249
+ "default": "./nonNil.mjs"
250
+ },
251
+ "require": {
252
+ "production": "./nonNil.min.cjs",
253
+ "development": "./nonNil.cjs",
254
+ "default": "./nonNil.cjs"
255
+ }
256
+ },
257
+ "./round": {
258
+ "types": "./round.d.ts",
259
+ "import": {
260
+ "production": "./round.min.mjs",
261
+ "development": "./round.mjs",
262
+ "default": "./round.mjs"
263
+ },
264
+ "require": {
265
+ "production": "./round.min.cjs",
266
+ "development": "./round.cjs",
267
+ "default": "./round.cjs"
268
+ }
269
+ },
270
+ "./safeBtoa": {
271
+ "types": "./safeBtoa.d.ts",
272
+ "import": {
273
+ "production": "./safeBtoa.min.mjs",
274
+ "development": "./safeBtoa.mjs",
275
+ "default": "./safeBtoa.mjs"
276
+ },
277
+ "require": {
278
+ "production": "./safeBtoa.min.cjs",
279
+ "development": "./safeBtoa.cjs",
280
+ "default": "./safeBtoa.cjs"
281
+ }
282
+ },
283
+ "./safeParseFloat": {
284
+ "types": "./safeParseFloat.d.ts",
285
+ "import": {
286
+ "production": "./safeParseFloat.min.mjs",
287
+ "development": "./safeParseFloat.mjs",
288
+ "default": "./safeParseFloat.mjs"
289
+ },
290
+ "require": {
291
+ "production": "./safeParseFloat.min.cjs",
292
+ "development": "./safeParseFloat.cjs",
293
+ "default": "./safeParseFloat.cjs"
294
+ }
295
+ },
296
+ "./safeParseInt": {
297
+ "types": "./safeParseInt.d.ts",
298
+ "import": {
299
+ "production": "./safeParseInt.min.mjs",
300
+ "development": "./safeParseInt.mjs",
301
+ "default": "./safeParseInt.mjs"
302
+ },
303
+ "require": {
304
+ "production": "./safeParseInt.min.cjs",
305
+ "development": "./safeParseInt.cjs",
306
+ "default": "./safeParseInt.cjs"
307
+ }
308
+ },
309
+ "./sha256": {
310
+ "types": "./sha256.d.ts",
311
+ "import": {
312
+ "production": "./sha256.min.mjs",
313
+ "development": "./sha256.mjs",
314
+ "default": "./sha256.mjs"
315
+ },
316
+ "require": {
317
+ "production": "./sha256.min.cjs",
318
+ "development": "./sha256.cjs",
319
+ "default": "./sha256.cjs"
320
+ }
321
+ },
322
+ "./sleep": {
323
+ "types": "./sleep.d.ts",
324
+ "import": {
325
+ "production": "./sleep.min.mjs",
326
+ "development": "./sleep.mjs",
327
+ "default": "./sleep.mjs"
328
+ },
329
+ "require": {
330
+ "production": "./sleep.min.cjs",
331
+ "development": "./sleep.cjs",
332
+ "default": "./sleep.cjs"
333
+ }
334
+ },
335
+ "./storageAdapter": {
336
+ "types": "./storageAdapter.d.ts",
337
+ "import": {
338
+ "production": "./storageAdapter.min.mjs",
339
+ "development": "./storageAdapter.mjs",
340
+ "default": "./storageAdapter.mjs"
341
+ },
342
+ "require": {
343
+ "production": "./storageAdapter.min.cjs",
344
+ "development": "./storageAdapter.cjs",
345
+ "default": "./storageAdapter.cjs"
346
+ }
347
+ },
348
+ "./sum": {
349
+ "types": "./sum.d.ts",
350
+ "import": {
351
+ "production": "./sum.min.mjs",
352
+ "development": "./sum.mjs",
353
+ "default": "./sum.mjs"
354
+ },
355
+ "require": {
356
+ "production": "./sum.min.cjs",
357
+ "development": "./sum.cjs",
358
+ "default": "./sum.cjs"
359
+ }
360
+ },
361
+ "./timeConstants": {
362
+ "types": "./timeConstants.d.ts",
363
+ "import": {
364
+ "production": "./timeConstants.min.mjs",
365
+ "development": "./timeConstants.mjs",
366
+ "default": "./timeConstants.mjs"
367
+ },
368
+ "require": {
369
+ "production": "./timeConstants.min.cjs",
370
+ "development": "./timeConstants.cjs",
371
+ "default": "./timeConstants.cjs"
372
+ }
373
+ },
374
+ "./timer": {
375
+ "types": "./timer.d.ts",
376
+ "import": {
377
+ "production": "./timer.min.mjs",
378
+ "development": "./timer.mjs",
379
+ "default": "./timer.mjs"
380
+ },
381
+ "require": {
382
+ "production": "./timer.min.cjs",
383
+ "development": "./timer.cjs",
384
+ "default": "./timer.cjs"
385
+ }
386
+ }
387
+ },
388
+ "typesVersions": {
389
+ "*": {
390
+ "arrayBuffer": [
391
+ "./arrayBuffer.d.ts"
392
+ ],
393
+ "assert": [
394
+ "./assert.d.ts"
395
+ ],
396
+ "average": [
397
+ "./average.d.ts"
398
+ ],
399
+ "base64Url": [
400
+ "./base64Url.d.ts"
401
+ ],
402
+ "dateTimeStr": [
403
+ "./dateTimeStr.d.ts"
404
+ ],
405
+ "duration": [
406
+ "./duration.d.ts"
407
+ ],
408
+ "isEmpty": [
409
+ "./isEmpty.d.ts"
410
+ ],
411
+ "iterators": [
412
+ "./iterators.d.ts"
413
+ ],
414
+ "kvStore": [
415
+ "./kvStore.d.ts"
416
+ ],
417
+ "localStore": [
418
+ "./localStore.d.ts"
419
+ ],
420
+ "logging": [
421
+ "./logging.d.ts"
422
+ ],
423
+ "nonEmpty": [
424
+ "./nonEmpty.d.ts"
425
+ ],
426
+ "nonNil": [
427
+ "./nonNil.d.ts"
428
+ ],
429
+ "round": [
430
+ "./round.d.ts"
431
+ ],
432
+ "safeBtoa": [
433
+ "./safeBtoa.d.ts"
434
+ ],
435
+ "safeParseFloat": [
436
+ "./safeParseFloat.d.ts"
437
+ ],
438
+ "safeParseInt": [
439
+ "./safeParseInt.d.ts"
440
+ ],
441
+ "sha256": [
442
+ "./sha256.d.ts"
443
+ ],
444
+ "sleep": [
445
+ "./sleep.d.ts"
446
+ ],
447
+ "storageAdapter": [
448
+ "./storageAdapter.d.ts"
449
+ ],
450
+ "sum": [
451
+ "./sum.d.ts"
452
+ ],
453
+ "timeConstants": [
454
+ "./timeConstants.d.ts"
455
+ ],
456
+ "timer": [
457
+ "./timer.d.ts"
458
+ ]
459
+ }
37
460
  }
38
- }
461
+ }
@@ -36,4 +36,3 @@ function roundS(n, numDecimalPlaces = 0) {
36
36
  round,
37
37
  roundS
38
38
  });
39
- //# sourceMappingURL=round.js.map