@koine/utils 1.1.9 → 1.1.11

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 (340) hide show
  1. package/Defer.js +6 -2
  2. package/{node/Defer.js → Defer.mjs} +2 -6
  3. package/Emitter.js +6 -2
  4. package/{node/Emitter.js → Emitter.mjs} +2 -6
  5. package/accentSets.js +5 -2
  6. package/{node/accentSets.js → accentSets.mjs} +2 -5
  7. package/addOrReplaceAtIdx.js +8 -4
  8. package/addOrReplaceAtIdx.mjs +19 -0
  9. package/areEqual.js +10 -6
  10. package/{node/areEqual.js → areEqual.mjs} +6 -10
  11. package/arrayOfAll.d.ts +0 -2
  12. package/arrayOfAll.js +6 -4
  13. package/{node/arrayOfAll.js → arrayOfAll.mjs} +2 -8
  14. package/arraySum.js +6 -2
  15. package/arraySum.mjs +9 -0
  16. package/arrayToLookup.js +6 -2
  17. package/{node/arrayToLookup.js → arrayToLookup.mjs} +2 -6
  18. package/buildUrlQueryString.js +12 -7
  19. package/{node/buildUrlQueryString.js → buildUrlQueryString.mjs} +7 -12
  20. package/capitalize.js +6 -2
  21. package/{node/capitalize.js → capitalize.mjs} +2 -6
  22. package/changeUrlPath.js +11 -6
  23. package/changeUrlPath.mjs +18 -0
  24. package/chunkByChunks.js +6 -2
  25. package/{node/chunkByChunks.js → chunkByChunks.mjs} +2 -6
  26. package/chunkBySize.js +6 -2
  27. package/{node/chunkBySize.js → chunkBySize.mjs} +2 -6
  28. package/clamp.js +6 -2
  29. package/{node/clamp.js → clamp.mjs} +2 -6
  30. package/clsx.js +6 -2
  31. package/{node/clsx.js → clsx.mjs} +2 -6
  32. package/convertRange.js +6 -2
  33. package/{node/convertRange.js → convertRange.mjs} +2 -6
  34. package/cookie.js +4 -1
  35. package/{node/cookie.js → cookie.mjs} +1 -4
  36. package/debounce.js +6 -2
  37. package/{node/debounce.js → debounce.mjs} +2 -6
  38. package/debouncePromise.js +6 -3
  39. package/debouncePromise.mjs +9 -0
  40. package/debounceRaf.js +6 -2
  41. package/{node/debounceRaf.js → debounceRaf.mjs} +2 -6
  42. package/decode.js +6 -2
  43. package/{node/decode.js → decode.mjs} +2 -6
  44. package/encode.js +6 -2
  45. package/{node/encode.js → encode.mjs} +2 -6
  46. package/ensureInt.js +6 -2
  47. package/ensureInt.mjs +9 -0
  48. package/{node/env.js → env.mjs} +0 -0
  49. package/findDuplicatedIndexes.js +6 -2
  50. package/{node/findDuplicatedIndexes.js → findDuplicatedIndexes.mjs} +2 -6
  51. package/forin.js +6 -2
  52. package/forin.mjs +11 -0
  53. package/gbToBytes.js +6 -2
  54. package/gbToBytes.mjs +7 -0
  55. package/getEmptyArray.js +9 -4
  56. package/getEmptyArray.mjs +15 -0
  57. package/getKeys.js +5 -2
  58. package/{node/getKeys.js → getKeys.mjs} +2 -5
  59. package/getMediaQueryWidthResolvers.js +8 -4
  60. package/{node/getMediaQueryWidthResolvers.js → getMediaQueryWidthResolvers.mjs} +4 -8
  61. package/getMediaQueryWidthTailwindScreens.js +8 -4
  62. package/{node/getMediaQueryWidthTailwindScreens.js → getMediaQueryWidthTailwindScreens.mjs} +4 -8
  63. package/getNonce.js +8 -4
  64. package/getNonce.mjs +9 -0
  65. package/getParamAmong.js +9 -4
  66. package/{node/getParamAmong.js → getParamAmong.mjs} +4 -9
  67. package/getParamAsInt.js +9 -4
  68. package/{node/getParamAsInt.js → getParamAsInt.mjs} +4 -9
  69. package/getParamAsString.js +9 -4
  70. package/getParamAsString.mjs +14 -0
  71. package/getType.js +6 -2
  72. package/{node/getType.js → getType.mjs} +2 -6
  73. package/getUrlHashParams.js +6 -2
  74. package/{node/getUrlHashParams.js → getUrlHashParams.mjs} +2 -6
  75. package/getUrlHashPathname.js +6 -2
  76. package/{node/getUrlHashPathname.js → getUrlHashPathname.mjs} +2 -6
  77. package/getUrlPathnameParts.js +9 -4
  78. package/{node/getUrlPathnameParts.js → getUrlPathnameParts.mjs} +4 -9
  79. package/getUrlQueryParams.js +9 -4
  80. package/{node/getUrlQueryParams.js → getUrlQueryParams.mjs} +4 -9
  81. package/imgEmptyPixel.js +5 -2
  82. package/imgEmptyPixel.mjs +7 -0
  83. package/index.js +132 -129
  84. package/index.mjs +131 -0
  85. package/invariant.js +6 -2
  86. package/{node/invariant.js → invariant.mjs} +2 -6
  87. package/isAnyObject.js +9 -4
  88. package/isAnyObject.mjs +10 -0
  89. package/isArray.js +9 -4
  90. package/isArray.mjs +10 -0
  91. package/isBlob.js +9 -4
  92. package/isBlob.mjs +10 -0
  93. package/isBoolean.js +9 -4
  94. package/isBoolean.mjs +10 -0
  95. package/isBrowser.js +5 -2
  96. package/isBrowser.mjs +8 -0
  97. package/isDate.js +9 -4
  98. package/isDate.mjs +10 -0
  99. package/isEmptyArray.js +9 -4
  100. package/isEmptyArray.mjs +10 -0
  101. package/isEmptyObject.js +9 -4
  102. package/isEmptyObject.mjs +10 -0
  103. package/isEmptyString.js +6 -2
  104. package/isEmptyString.mjs +9 -0
  105. package/isError.js +9 -4
  106. package/isError.mjs +10 -0
  107. package/isExternalUrl.js +9 -4
  108. package/{node/isExternalUrl.js → isExternalUrl.mjs} +4 -9
  109. package/isFile.js +9 -4
  110. package/isFile.mjs +10 -0
  111. package/isFloat.js +9 -4
  112. package/isFloat.mjs +10 -0
  113. package/isFormData.js +9 -4
  114. package/isFormData.mjs +10 -0
  115. package/isFullArray.js +9 -4
  116. package/isFullArray.mjs +10 -0
  117. package/isFullObject.js +9 -4
  118. package/isFullObject.mjs +10 -0
  119. package/isFullString.js +9 -4
  120. package/isFullString.mjs +10 -0
  121. package/isFunction.js +6 -2
  122. package/isFunction.mjs +9 -0
  123. package/isInt.js +9 -4
  124. package/isInt.mjs +10 -0
  125. package/isMap.js +9 -4
  126. package/isMap.mjs +10 -0
  127. package/isNaNValue.js +9 -4
  128. package/isNaNValue.mjs +10 -0
  129. package/isNegativeNumber.js +9 -4
  130. package/isNegativeNumber.mjs +10 -0
  131. package/isNull.js +9 -4
  132. package/isNull.mjs +10 -0
  133. package/isNullOrUndefined.js +9 -5
  134. package/isNullOrUndefined.mjs +10 -0
  135. package/isNumber.js +9 -4
  136. package/isNumber.mjs +12 -0
  137. package/isObject.js +9 -4
  138. package/isObject.mjs +10 -0
  139. package/isObjectLike.js +9 -4
  140. package/isObjectLike.mjs +12 -0
  141. package/isOneOf.js +6 -2
  142. package/isOneOf.mjs +10 -0
  143. package/isPlainObject.js +9 -4
  144. package/isPlainObject.mjs +13 -0
  145. package/isPositiveNumber.js +9 -4
  146. package/isPositiveNumber.mjs +10 -0
  147. package/isPrimitive.js +19 -14
  148. package/isPrimitive.mjs +20 -0
  149. package/isPromise.js +9 -4
  150. package/isPromise.mjs +10 -0
  151. package/isRegExp.js +9 -4
  152. package/isRegExp.mjs +10 -0
  153. package/isServer.js +7 -3
  154. package/isServer.mjs +9 -0
  155. package/isSet.js +9 -4
  156. package/isSet.mjs +10 -0
  157. package/isString.js +9 -4
  158. package/isString.mjs +10 -0
  159. package/isSymbol.js +9 -4
  160. package/isSymbol.mjs +10 -0
  161. package/isType.js +9 -4
  162. package/{node/isType.js → isType.mjs} +4 -9
  163. package/isUndefined.js +9 -4
  164. package/isUndefined.mjs +10 -0
  165. package/isWeakMap.js +9 -4
  166. package/isWeakMap.mjs +10 -0
  167. package/isWeakSet.js +9 -4
  168. package/isWeakSet.mjs +10 -0
  169. package/kbToBytes.js +6 -2
  170. package/kbToBytes.mjs +7 -0
  171. package/location.js +2 -1
  172. package/location.mjs +1 -0
  173. package/lowercase.js +6 -2
  174. package/lowercase.mjs +9 -0
  175. package/mapListBy.js +6 -2
  176. package/{node/mapListBy.js → mapListBy.mjs} +2 -6
  177. package/matchSorter.js +11 -7
  178. package/{node/matchSorter.js → matchSorter.mjs} +7 -11
  179. package/mbToBytes.js +6 -2
  180. package/mbToBytes.mjs +7 -0
  181. package/mergeObjects.js +11 -7
  182. package/{node/mergeObjects.js → mergeObjects.mjs} +7 -11
  183. package/mergeUrlQueryParams.js +9 -4
  184. package/{node/mergeUrlQueryParams.js → mergeUrlQueryParams.mjs} +4 -9
  185. package/moveSortableArrayItemByKey.js +8 -4
  186. package/{node/moveSortableArrayItemByKey.js → moveSortableArrayItemByKey.mjs} +4 -8
  187. package/noop.js +6 -2
  188. package/noop.mjs +7 -0
  189. package/normaliseUrl.js +9 -4
  190. package/normaliseUrl.mjs +15 -0
  191. package/normaliseUrlPathname.js +9 -4
  192. package/normaliseUrlPathname.mjs +14 -0
  193. package/objectOmit.js +6 -2
  194. package/{node/objectOmit.js → objectOmit.mjs} +2 -6
  195. package/objectPick.js +6 -2
  196. package/{node/objectPick.js → objectPick.mjs} +2 -6
  197. package/package.json +4 -3
  198. package/parseCookie.js +6 -2
  199. package/{node/parseCookie.js → parseCookie.mjs} +2 -6
  200. package/parseURL.js +6 -2
  201. package/{node/parseURL.js → parseURL.mjs} +2 -6
  202. package/quaranteneProps.js +6 -2
  203. package/{node/quaranteneProps.js → quaranteneProps.mjs} +2 -6
  204. package/randomInt.js +6 -2
  205. package/randomInt.mjs +9 -0
  206. package/randomKey.js +6 -2
  207. package/{node/randomKey.js → randomKey.mjs} +2 -6
  208. package/readCookie.js +6 -2
  209. package/{node/readCookie.js → readCookie.mjs} +2 -6
  210. package/removeAccents.js +8 -4
  211. package/removeAccents.mjs +15 -0
  212. package/removeCookie.js +10 -6
  213. package/removeCookie.mjs +15 -0
  214. package/{node/removeDuplicates.js → removeDuplicates.mjs} +0 -0
  215. package/removeDuplicatesByKey.js +6 -2
  216. package/{node/removeDuplicatesByKey.js → removeDuplicatesByKey.mjs} +2 -6
  217. package/removeDuplicatesComparing.js +10 -6
  218. package/removeDuplicatesComparing.mjs +10 -0
  219. package/removeIndexesFromArray.js +6 -2
  220. package/removeIndexesFromArray.mjs +14 -0
  221. package/removeTrailingSlash.js +6 -2
  222. package/removeTrailingSlash.mjs +10 -0
  223. package/removeUrlQueryParams.js +11 -6
  224. package/removeUrlQueryParams.mjs +21 -0
  225. package/roundTo.js +6 -2
  226. package/{node/roundTo.js → roundTo.mjs} +2 -6
  227. package/serializeCookie.js +8 -4
  228. package/{node/serializeCookie.js → serializeCookie.mjs} +4 -8
  229. package/setCookie.js +14 -10
  230. package/{node/setCookie.js → setCookie.mjs} +10 -14
  231. package/shuffle.js +8 -4
  232. package/{node/shuffle.js → shuffle.mjs} +4 -8
  233. package/slugify.js +9 -5
  234. package/{node/slugify.js → slugify.mjs} +5 -9
  235. package/swapMap.js +6 -2
  236. package/{node/swapMap.js → swapMap.mjs} +2 -6
  237. package/throttle.js +8 -4
  238. package/{node/throttle.js → throttle.mjs} +4 -8
  239. package/titleCase.js +6 -2
  240. package/{node/titleCase.js → titleCase.mjs} +2 -6
  241. package/toNumber.js +8 -4
  242. package/toNumber.mjs +8 -0
  243. package/toRgba.js +6 -2
  244. package/{node/toRgba.js → toRgba.mjs} +2 -6
  245. package/transformToUrlPathname.js +9 -4
  246. package/transformToUrlPathname.mjs +16 -0
  247. package/truncate.js +6 -2
  248. package/truncate.mjs +13 -0
  249. package/tryUntil.js +6 -2
  250. package/{node/tryUntil.js → tryUntil.mjs} +2 -6
  251. package/types.js +2 -1
  252. package/types.mjs +1 -0
  253. package/uid.js +6 -2
  254. package/{node/uid.js → uid.mjs} +2 -6
  255. package/updateLinkParams.js +9 -4
  256. package/updateLinkParams.mjs +14 -0
  257. package/updateUrlQueryParams.js +12 -7
  258. package/updateUrlQueryParams.mjs +18 -0
  259. package/uppercase.js +6 -2
  260. package/uppercase.mjs +9 -0
  261. package/uuid.js +6 -2
  262. package/{node/uuid.js → uuid.mjs} +2 -6
  263. package/uuidNumeric.js +6 -2
  264. package/uuidNumeric.mjs +6 -0
  265. package/wait.js +6 -2
  266. package/wait.mjs +9 -0
  267. package/node/addOrReplaceAtIdx.js +0 -23
  268. package/node/arraySum.js +0 -13
  269. package/node/changeUrlPath.js +0 -23
  270. package/node/debouncePromise.js +0 -12
  271. package/node/ensureInt.js +0 -13
  272. package/node/forin.js +0 -15
  273. package/node/gbToBytes.js +0 -11
  274. package/node/getEmptyArray.js +0 -20
  275. package/node/getNonce.js +0 -13
  276. package/node/getParamAsString.js +0 -19
  277. package/node/imgEmptyPixel.js +0 -10
  278. package/node/index.js +0 -134
  279. package/node/isAnyObject.js +0 -15
  280. package/node/isArray.js +0 -15
  281. package/node/isBlob.js +0 -15
  282. package/node/isBoolean.js +0 -15
  283. package/node/isBrowser.js +0 -11
  284. package/node/isDate.js +0 -15
  285. package/node/isEmptyArray.js +0 -15
  286. package/node/isEmptyObject.js +0 -15
  287. package/node/isEmptyString.js +0 -13
  288. package/node/isError.js +0 -15
  289. package/node/isFile.js +0 -15
  290. package/node/isFloat.js +0 -15
  291. package/node/isFormData.js +0 -15
  292. package/node/isFullArray.js +0 -15
  293. package/node/isFullObject.js +0 -15
  294. package/node/isFullString.js +0 -15
  295. package/node/isFunction.js +0 -13
  296. package/node/isInt.js +0 -15
  297. package/node/isMap.js +0 -15
  298. package/node/isNaNValue.js +0 -15
  299. package/node/isNegativeNumber.js +0 -15
  300. package/node/isNull.js +0 -15
  301. package/node/isNullOrUndefined.js +0 -14
  302. package/node/isNumber.js +0 -17
  303. package/node/isObject.js +0 -15
  304. package/node/isObjectLike.js +0 -17
  305. package/node/isOneOf.js +0 -14
  306. package/node/isPlainObject.js +0 -18
  307. package/node/isPositiveNumber.js +0 -15
  308. package/node/isPrimitive.js +0 -25
  309. package/node/isPromise.js +0 -15
  310. package/node/isRegExp.js +0 -15
  311. package/node/isServer.js +0 -13
  312. package/node/isSet.js +0 -15
  313. package/node/isString.js +0 -15
  314. package/node/isSymbol.js +0 -15
  315. package/node/isUndefined.js +0 -15
  316. package/node/isWeakMap.js +0 -15
  317. package/node/isWeakSet.js +0 -15
  318. package/node/kbToBytes.js +0 -11
  319. package/node/location.js +0 -2
  320. package/node/lowercase.js +0 -13
  321. package/node/mbToBytes.js +0 -11
  322. package/node/noop.js +0 -11
  323. package/node/normaliseUrl.js +0 -20
  324. package/node/normaliseUrlPathname.js +0 -19
  325. package/node/randomInt.js +0 -13
  326. package/node/removeAccents.js +0 -19
  327. package/node/removeCookie.js +0 -19
  328. package/node/removeDuplicatesComparing.js +0 -14
  329. package/node/removeIndexesFromArray.js +0 -18
  330. package/node/removeTrailingSlash.js +0 -14
  331. package/node/removeUrlQueryParams.js +0 -26
  332. package/node/toNumber.js +0 -12
  333. package/node/transformToUrlPathname.js +0 -21
  334. package/node/truncate.js +0 -17
  335. package/node/types.js +0 -2
  336. package/node/updateLinkParams.js +0 -19
  337. package/node/updateUrlQueryParams.js +0 -23
  338. package/node/uppercase.js +0 -13
  339. package/node/uuidNumeric.js +0 -10
  340. package/node/wait.js +0 -13
package/clamp.js CHANGED
@@ -1,10 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clamp = void 0;
1
4
  /**
2
5
  * Returns a number whose value is limited to the given range.
3
6
  *
4
7
  * @category math
5
8
  * @see https://stackoverflow.com/a/11409944/1938970
6
9
  */
7
- export function clamp(num, min, max) {
10
+ function clamp(num, min, max) {
8
11
  return Math.min(Math.max(num, min), max);
9
12
  }
10
- export default clamp;
13
+ exports.clamp = clamp;
14
+ exports.default = clamp;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clamp = void 0;
4
1
  /**
5
2
  * Returns a number whose value is limited to the given range.
6
3
  *
7
4
  * @category math
8
5
  * @see https://stackoverflow.com/a/11409944/1938970
9
6
  */
10
- function clamp(num, min, max) {
7
+ export function clamp(num, min, max) {
11
8
  return Math.min(Math.max(num, min), max);
12
9
  }
13
- exports.clamp = clamp;
14
- exports.default = clamp;
10
+ export default clamp;
package/clsx.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clsx = void 0;
1
4
  // import _clsx from "clsx";
2
5
  // export const clsx = _clsx;
3
6
  function toVal(mix) {
@@ -33,7 +36,7 @@ function toVal(mix) {
33
36
  * @borrows [lukeed/clsx](https://github.com/lukeed/clsx)
34
37
  * @license [MIT: Luke Edwards](https://github.com/lukeed/clsx/blob/master/license)
35
38
  */
36
- export var clsx = function () {
39
+ var clsx = function () {
37
40
  var i = 0, tmp, x, str = "";
38
41
  while (i < arguments.length) {
39
42
  // eslint-disable-next-line prefer-rest-params
@@ -46,4 +49,5 @@ export var clsx = function () {
46
49
  }
47
50
  return str;
48
51
  };
49
- export default clsx;
52
+ exports.clsx = clsx;
53
+ exports.default = exports.clsx;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clsx = void 0;
4
1
  // import _clsx from "clsx";
5
2
  // export const clsx = _clsx;
6
3
  function toVal(mix) {
@@ -36,7 +33,7 @@ function toVal(mix) {
36
33
  * @borrows [lukeed/clsx](https://github.com/lukeed/clsx)
37
34
  * @license [MIT: Luke Edwards](https://github.com/lukeed/clsx/blob/master/license)
38
35
  */
39
- var clsx = function () {
36
+ export var clsx = function () {
40
37
  var i = 0, tmp, x, str = "";
41
38
  while (i < arguments.length) {
42
39
  // eslint-disable-next-line prefer-rest-params
@@ -49,5 +46,4 @@ var clsx = function () {
49
46
  }
50
47
  return str;
51
48
  };
52
- exports.clsx = clsx;
53
- exports.default = exports.clsx;
49
+ export default clsx;
package/convertRange.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertRange = void 0;
1
4
  /**
2
5
  * Convert range of a number
3
6
  *
@@ -10,7 +13,8 @@
10
13
  * @category math
11
14
  * @see https://stackoverflow.com/a/14224813
12
15
  */
13
- export function convertRange(num, r1, r2) {
16
+ function convertRange(num, r1, r2) {
14
17
  return ((num - r1[0]) * (r2[1] - r2[0])) / (r1[1] - r1[0]) + r2[0];
15
18
  }
16
- export default convertRange;
19
+ exports.convertRange = convertRange;
20
+ exports.default = convertRange;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertRange = void 0;
4
1
  /**
5
2
  * Convert range of a number
6
3
  *
@@ -13,8 +10,7 @@ exports.convertRange = void 0;
13
10
  * @category math
14
11
  * @see https://stackoverflow.com/a/14224813
15
12
  */
16
- function convertRange(num, r1, r2) {
13
+ export function convertRange(num, r1, r2) {
17
14
  return ((num - r1[0]) * (r2[1] - r2[0])) / (r1[1] - r1[0]) + r2[0];
18
15
  }
19
- exports.convertRange = convertRange;
20
- exports.default = convertRange;
16
+ export default convertRange;
package/cookie.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * @file
3
4
  *
@@ -7,4 +8,6 @@
7
8
  * - [js-cookie](https://github.com/js-cookie/js-cookie)
8
9
  * - [cookie](https://github.com/jshttp/cookie)
9
10
  */
10
- export var defaultAttributesClient = { path: "/" };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.defaultAttributesClient = void 0;
13
+ exports.defaultAttributesClient = { path: "/" };
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * @file
4
3
  *
@@ -8,6 +7,4 @@
8
7
  * - [js-cookie](https://github.com/js-cookie/js-cookie)
9
8
  * - [cookie](https://github.com/jshttp/cookie)
10
9
  */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.defaultAttributesClient = void 0;
13
- exports.defaultAttributesClient = { path: "/" };
10
+ export var defaultAttributesClient = { path: "/" };
package/debounce.js CHANGED
@@ -1,10 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debounce = void 0;
1
4
  /**
2
5
  * Debounce function (with `setTimeout`)
3
6
  *
4
7
  * @category function
5
8
  * @borrows [davidwalsh/debounce](https://davidwalsh.name/javascript-debounce-function)
6
9
  */
7
- export function debounce(fn, wait, immediate) {
10
+ function debounce(fn, wait, immediate) {
8
11
  var timeout;
9
12
  return function () {
10
13
  var args = [];
@@ -26,4 +29,5 @@ export function debounce(fn, wait, immediate) {
26
29
  fn.apply(context, args);
27
30
  };
28
31
  }
29
- export default debounce;
32
+ exports.debounce = debounce;
33
+ exports.default = debounce;
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debounce = void 0;
4
1
  /**
5
2
  * Debounce function (with `setTimeout`)
6
3
  *
7
4
  * @category function
8
5
  * @borrows [davidwalsh/debounce](https://davidwalsh.name/javascript-debounce-function)
9
6
  */
10
- function debounce(fn, wait, immediate) {
7
+ export function debounce(fn, wait, immediate) {
11
8
  var timeout;
12
9
  return function () {
13
10
  var args = [];
@@ -29,5 +26,4 @@ function debounce(fn, wait, immediate) {
29
26
  fn.apply(context, args);
30
27
  };
31
28
  }
32
- exports.debounce = debounce;
33
- exports.default = debounce;
29
+ export default debounce;
@@ -1,9 +1,12 @@
1
- import { debounce as tsDebounce } from "ts-debounce";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debouncePromise = void 0;
4
+ var ts_debounce_1 = require("ts-debounce");
2
5
  /**
3
6
  * Debounce function (with `Promise`)
4
7
  *
5
8
  * @category function
6
9
  * @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
7
10
  */
8
- export var debouncePromise = tsDebounce;
9
- export default debouncePromise;
11
+ exports.debouncePromise = ts_debounce_1.debounce;
12
+ exports.default = exports.debouncePromise;
@@ -0,0 +1,9 @@
1
+ import { debounce as tsDebounce } from "ts-debounce";
2
+ /**
3
+ * Debounce function (with `Promise`)
4
+ *
5
+ * @category function
6
+ * @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
7
+ */
8
+ export var debouncePromise = tsDebounce;
9
+ export default debouncePromise;
package/debounceRaf.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debounceRaf = void 0;
1
4
  /**
2
5
  * Debounce function (with `requestAnimationFrame`)
3
6
  *
@@ -5,7 +8,7 @@
5
8
  * @category function
6
9
  * @borrows [vanillajstoolkit/debounce](https://vanillajstoolkit.com/helpers/debounce/)
7
10
  */
8
- export function debounceRaf(fn) {
11
+ function debounceRaf(fn) {
9
12
  var timeout;
10
13
  return function () {
11
14
  var args = [];
@@ -24,4 +27,5 @@ export function debounceRaf(fn) {
24
27
  });
25
28
  };
26
29
  }
27
- export default debounceRaf;
30
+ exports.debounceRaf = debounceRaf;
31
+ exports.default = debounceRaf;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debounceRaf = void 0;
4
1
  /**
5
2
  * Debounce function (with `requestAnimationFrame`)
6
3
  *
@@ -8,7 +5,7 @@ exports.debounceRaf = void 0;
8
5
  * @category function
9
6
  * @borrows [vanillajstoolkit/debounce](https://vanillajstoolkit.com/helpers/debounce/)
10
7
  */
11
- function debounceRaf(fn) {
8
+ export function debounceRaf(fn) {
12
9
  var timeout;
13
10
  return function () {
14
11
  var args = [];
@@ -27,5 +24,4 @@ function debounceRaf(fn) {
27
24
  });
28
25
  };
29
26
  }
30
- exports.debounceRaf = debounceRaf;
31
- exports.default = debounceRaf;
27
+ export default debounceRaf;
package/decode.js CHANGED
@@ -1,10 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decode = void 0;
1
4
  /**
2
5
  * @category security
3
6
  * @see https://stackoverflow.com/a/22405578/9122820
4
7
  */
5
- export function decode(str) {
8
+ function decode(str) {
6
9
  return str.replace(/.{3}/g, function (c) {
7
10
  return String.fromCharCode(parseInt(c, 10));
8
11
  });
9
12
  }
10
- export default decode;
13
+ exports.decode = decode;
14
+ exports.default = decode;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = void 0;
4
1
  /**
5
2
  * @category security
6
3
  * @see https://stackoverflow.com/a/22405578/9122820
7
4
  */
8
- function decode(str) {
5
+ export function decode(str) {
9
6
  return str.replace(/.{3}/g, function (c) {
10
7
  return String.fromCharCode(parseInt(c, 10));
11
8
  });
12
9
  }
13
- exports.decode = decode;
14
- exports.default = decode;
10
+ export default decode;
package/encode.js CHANGED
@@ -1,10 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encode = void 0;
1
4
  /**
2
5
  * @category security
3
6
  * @see https://stackoverflow.com/a/22405578/9122820
4
7
  */
5
- export function encode(str) {
8
+ function encode(str) {
6
9
  return str.replace(/./g, function (c) {
7
10
  return ("00" + c.charCodeAt(0)).slice(-3);
8
11
  });
9
12
  }
10
- export default encode;
13
+ exports.encode = encode;
14
+ exports.default = encode;
@@ -1,14 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encode = void 0;
4
1
  /**
5
2
  * @category security
6
3
  * @see https://stackoverflow.com/a/22405578/9122820
7
4
  */
8
- function encode(str) {
5
+ export function encode(str) {
9
6
  return str.replace(/./g, function (c) {
10
7
  return ("00" + c.charCodeAt(0)).slice(-3);
11
8
  });
12
9
  }
13
- exports.encode = encode;
14
- exports.default = encode;
10
+ export default encode;
package/ensureInt.js CHANGED
@@ -1,9 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureInt = void 0;
1
4
  /**
2
5
  * Ensure input to be an integer
3
6
  *
4
7
  * @category cast
5
8
  */
6
- export var ensureInt = function (input) {
9
+ var ensureInt = function (input) {
7
10
  return typeof input === "string" ? parseInt(input, 10) : Math.round(input);
8
11
  };
9
- export default ensureInt;
12
+ exports.ensureInt = ensureInt;
13
+ exports.default = exports.ensureInt;
package/ensureInt.mjs ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Ensure input to be an integer
3
+ *
4
+ * @category cast
5
+ */
6
+ export var ensureInt = function (input) {
7
+ return typeof input === "string" ? parseInt(input, 10) : Math.round(input);
8
+ };
9
+ export default ensureInt;
File without changes
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findDuplicatedIndexes = void 0;
1
4
  /**
2
5
  * @category array
3
6
  */
4
- export function findDuplicatedIndexes(arr) {
7
+ function findDuplicatedIndexes(arr) {
5
8
  var indexes = {};
6
9
  for (var i = 0; i < arr.length; i++) {
7
10
  var idxInArray = arr.indexOf(arr[i]);
@@ -11,4 +14,5 @@ export function findDuplicatedIndexes(arr) {
11
14
  }
12
15
  return indexes;
13
16
  }
14
- export default findDuplicatedIndexes;
17
+ exports.findDuplicatedIndexes = findDuplicatedIndexes;
18
+ exports.default = findDuplicatedIndexes;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findDuplicatedIndexes = void 0;
4
1
  /**
5
2
  * @category array
6
3
  */
7
- function findDuplicatedIndexes(arr) {
4
+ export function findDuplicatedIndexes(arr) {
8
5
  var indexes = {};
9
6
  for (var i = 0; i < arr.length; i++) {
10
7
  var idxInArray = arr.indexOf(arr[i]);
@@ -14,5 +11,4 @@ function findDuplicatedIndexes(arr) {
14
11
  }
15
12
  return indexes;
16
13
  }
17
- exports.findDuplicatedIndexes = findDuplicatedIndexes;
18
- exports.default = findDuplicatedIndexes;
14
+ export default findDuplicatedIndexes;
package/forin.js CHANGED
@@ -1,11 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.forin = void 0;
1
4
  /**
2
5
  * To easily get typed native `for in`
3
6
  *
4
7
  * @category objects
5
8
  */
6
- export function forin(object, cb) {
9
+ function forin(object, cb) {
7
10
  for (var key in object) {
8
11
  cb(key, object[key]);
9
12
  }
10
13
  }
11
- export default forin;
14
+ exports.forin = forin;
15
+ exports.default = forin;
package/forin.mjs ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * To easily get typed native `for in`
3
+ *
4
+ * @category objects
5
+ */
6
+ export function forin(object, cb) {
7
+ for (var key in object) {
8
+ cb(key, object[key]);
9
+ }
10
+ }
11
+ export default forin;
package/gbToBytes.js CHANGED
@@ -1,7 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gbToBytes = void 0;
1
4
  /**
2
5
  * Gigabytes to bytes
3
6
  *
4
7
  * @category format
5
8
  */
6
- export var gbToBytes = function (bytes) { return bytes * 1000 * 1000 * 1000; };
7
- export default gbToBytes;
9
+ var gbToBytes = function (bytes) { return bytes * 1000 * 1000 * 1000; };
10
+ exports.gbToBytes = gbToBytes;
11
+ exports.default = exports.gbToBytes;
package/gbToBytes.mjs ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gigabytes to bytes
3
+ *
4
+ * @category format
5
+ */
6
+ export var gbToBytes = function (bytes) { return bytes * 1000 * 1000 * 1000; };
7
+ export default gbToBytes;
package/getEmptyArray.js CHANGED
@@ -1,4 +1,8 @@
1
- import isNumber from "./isNumber";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEmptyArray = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isNumber_1 = tslib_1.__importDefault(require("./isNumber"));
2
6
  /**
3
7
  *
4
8
  * Returns an array of undefined values of the desired length, useful to build
@@ -6,10 +10,11 @@ import isNumber from "./isNumber";
6
10
  *
7
11
  * @category array
8
12
  */
9
- export function getEmptyArray /* <T extends undefined | null = undefined> */(length) {
10
- if (!isNumber(length)) {
13
+ function getEmptyArray /* <T extends undefined | null = undefined> */(length) {
14
+ if (!(0, isNumber_1.default)(length)) {
11
15
  length = parseInt(length, 10);
12
16
  }
13
17
  return Array.from({ length: length });
14
18
  }
15
- export default getEmptyArray;
19
+ exports.getEmptyArray = getEmptyArray;
20
+ exports.default = getEmptyArray;
@@ -0,0 +1,15 @@
1
+ import isNumber from "./isNumber";
2
+ /**
3
+ *
4
+ * Returns an array of undefined values of the desired length, useful to build
5
+ * skeleton UIs.
6
+ *
7
+ * @category array
8
+ */
9
+ export function getEmptyArray /* <T extends undefined | null = undefined> */(length) {
10
+ if (!isNumber(length)) {
11
+ length = parseInt(length, 10);
12
+ }
13
+ return Array.from({ length: length });
14
+ }
15
+ export default getEmptyArray;
package/getKeys.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getKeys = void 0;
1
4
  /**
2
5
  * Type safe replacement for `Object.keys(myObject)` to iterate over a record
3
6
  * without loosing the key's types in simple `string`s.
@@ -5,5 +8,5 @@
5
8
  * @category objects
6
9
  * @see https://stackoverflow.com/a/59459000/1938970
7
10
  */
8
- export var getKeys = Object.keys;
9
- export default getKeys;
11
+ exports.getKeys = Object.keys;
12
+ exports.default = exports.getKeys;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getKeys = void 0;
4
1
  /**
5
2
  * Type safe replacement for `Object.keys(myObject)` to iterate over a record
6
3
  * without loosing the key's types in simple `string`s.
@@ -8,5 +5,5 @@ exports.getKeys = void 0;
8
5
  * @category objects
9
6
  * @see https://stackoverflow.com/a/59459000/1938970
10
7
  */
11
- exports.getKeys = Object.keys;
12
- exports.default = exports.getKeys;
8
+ export var getKeys = Object.keys;
9
+ export default getKeys;
@@ -1,6 +1,9 @@
1
- import { __assign } from "tslib";
2
- export function getMediaQueryWidthResolvers(customBreakpoints) {
3
- var breakpoints = __assign({ xs: 0 }, customBreakpoints);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMediaQueryWidthResolvers = void 0;
4
+ var tslib_1 = require("tslib");
5
+ function getMediaQueryWidthResolvers(customBreakpoints) {
6
+ var breakpoints = tslib_1.__assign({ xs: 0 }, customBreakpoints);
4
7
  var sortedBreakpointsNames = Object.keys(breakpoints).map(function (key) {
5
8
  var br = key;
6
9
  return [br, breakpoints[br]];
@@ -65,4 +68,5 @@ export function getMediaQueryWidthResolvers(customBreakpoints) {
65
68
  only: only,
66
69
  };
67
70
  }
68
- export default getMediaQueryWidthResolvers;
71
+ exports.getMediaQueryWidthResolvers = getMediaQueryWidthResolvers;
72
+ exports.default = getMediaQueryWidthResolvers;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMediaQueryWidthResolvers = void 0;
4
- var tslib_1 = require("tslib");
5
- function getMediaQueryWidthResolvers(customBreakpoints) {
6
- var breakpoints = tslib_1.__assign({ xs: 0 }, customBreakpoints);
1
+ import { __assign } from "tslib";
2
+ export function getMediaQueryWidthResolvers(customBreakpoints) {
3
+ var breakpoints = __assign({ xs: 0 }, customBreakpoints);
7
4
  var sortedBreakpointsNames = Object.keys(breakpoints).map(function (key) {
8
5
  var br = key;
9
6
  return [br, breakpoints[br]];
@@ -68,5 +65,4 @@ function getMediaQueryWidthResolvers(customBreakpoints) {
68
65
  only: only,
69
66
  };
70
67
  }
71
- exports.getMediaQueryWidthResolvers = getMediaQueryWidthResolvers;
72
- exports.default = getMediaQueryWidthResolvers;
68
+ export default getMediaQueryWidthResolvers;
@@ -1,6 +1,9 @@
1
- import { getMediaQueryWidthResolvers, } from "./getMediaQueryWidthResolvers";
2
- export function getMediaQueryWidthTailwindScreens(breakpoints) {
3
- var mqWidthResolvers = getMediaQueryWidthResolvers(breakpoints);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMediaQueryWidthTailwindScreens = void 0;
4
+ var getMediaQueryWidthResolvers_1 = require("./getMediaQueryWidthResolvers");
5
+ function getMediaQueryWidthTailwindScreens(breakpoints) {
6
+ var mqWidthResolvers = (0, getMediaQueryWidthResolvers_1.getMediaQueryWidthResolvers)(breakpoints);
4
7
  // Object.keys(breakpoints).reduce((screens, br) => {
5
8
  var screens = Object.keys(breakpoints).reduce(function (output, br, idx) {
6
9
  var brNext = Object.keys(breakpoints)[idx + 1];
@@ -26,4 +29,5 @@ export function getMediaQueryWidthTailwindScreens(breakpoints) {
26
29
  }, {});
27
30
  return screens;
28
31
  }
29
- export default getMediaQueryWidthTailwindScreens;
32
+ exports.getMediaQueryWidthTailwindScreens = getMediaQueryWidthTailwindScreens;
33
+ exports.default = getMediaQueryWidthTailwindScreens;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMediaQueryWidthTailwindScreens = void 0;
4
- var getMediaQueryWidthResolvers_1 = require("./getMediaQueryWidthResolvers");
5
- function getMediaQueryWidthTailwindScreens(breakpoints) {
6
- var mqWidthResolvers = (0, getMediaQueryWidthResolvers_1.getMediaQueryWidthResolvers)(breakpoints);
1
+ import { getMediaQueryWidthResolvers, } from "./getMediaQueryWidthResolvers";
2
+ export function getMediaQueryWidthTailwindScreens(breakpoints) {
3
+ var mqWidthResolvers = getMediaQueryWidthResolvers(breakpoints);
7
4
  // Object.keys(breakpoints).reduce((screens, br) => {
8
5
  var screens = Object.keys(breakpoints).reduce(function (output, br, idx) {
9
6
  var brNext = Object.keys(breakpoints)[idx + 1];
@@ -29,5 +26,4 @@ function getMediaQueryWidthTailwindScreens(breakpoints) {
29
26
  }, {});
30
27
  return screens;
31
28
  }
32
- exports.getMediaQueryWidthTailwindScreens = getMediaQueryWidthTailwindScreens;
33
- exports.default = getMediaQueryWidthTailwindScreens;
29
+ export default getMediaQueryWidthTailwindScreens;
package/getNonce.js CHANGED
@@ -1,9 +1,13 @@
1
- import { isUndefined } from "./isUndefined";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNonce = void 0;
4
+ var isUndefined_1 = require("./isUndefined");
2
5
  /**
3
6
  * @category security
4
7
  * @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
5
8
  */
6
- export function getNonce() {
7
- return isUndefined(__webpack_nonce__) ? null : __webpack_nonce__;
9
+ function getNonce() {
10
+ return (0, isUndefined_1.isUndefined)(__webpack_nonce__) ? null : __webpack_nonce__;
8
11
  }
9
- export default getNonce;
12
+ exports.getNonce = getNonce;
13
+ exports.default = getNonce;
package/getNonce.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { isUndefined } from "./isUndefined";
2
+ /**
3
+ * @category security
4
+ * @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
5
+ */
6
+ export function getNonce() {
7
+ return isUndefined(__webpack_nonce__) ? null : __webpack_nonce__;
8
+ }
9
+ export default getNonce;