@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/uppercase.js CHANGED
@@ -1,9 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uppercase = void 0;
1
4
  /**
2
5
  * Replacement for native `toUpperCase` tyescript ready (type narrowing ready)
3
6
  *
4
7
  * @category native
5
8
  */
6
- export var uppercase = function (str) {
9
+ var uppercase = function (str) {
7
10
  return (str || "").toUpperCase();
8
11
  };
9
- export default uppercase;
12
+ exports.uppercase = uppercase;
13
+ exports.default = exports.uppercase;
package/uppercase.mjs ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Replacement for native `toUpperCase` tyescript ready (type narrowing ready)
3
+ *
4
+ * @category native
5
+ */
6
+ export var uppercase = function (str) {
7
+ return (str || "").toUpperCase();
8
+ };
9
+ export default uppercase;
package/uuid.js CHANGED
@@ -1,13 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uuid = void 0;
1
4
  /**
2
5
  * Uuid, tiny custom helper instead of node's uuid/v4
3
6
  *
4
7
  * @category uid
5
8
  * @see https://stackoverflow.com/a/2117523/1938970
6
9
  */
7
- export var uuid = function () {
10
+ var uuid = function () {
8
11
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
9
12
  var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
10
13
  return v.toString(16);
11
14
  });
12
15
  };
13
- export default uuid;
16
+ exports.uuid = uuid;
17
+ exports.default = exports.uuid;
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uuid = void 0;
4
1
  /**
5
2
  * Uuid, tiny custom helper instead of node's uuid/v4
6
3
  *
7
4
  * @category uid
8
5
  * @see https://stackoverflow.com/a/2117523/1938970
9
6
  */
10
- var uuid = function () {
7
+ export var uuid = function () {
11
8
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
12
9
  var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
13
10
  return v.toString(16);
14
11
  });
15
12
  };
16
- exports.uuid = uuid;
17
- exports.default = exports.uuid;
13
+ export default uuid;
package/uuidNumeric.js CHANGED
@@ -1,6 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uuidNumeric = void 0;
1
4
  /**
2
5
  * @category uid
3
6
  * @see https://stackoverflow.com/a/18048162/1938970
4
7
  */
5
- export var uuidNumeric = function () { return new Date().valueOf(); };
6
- export default uuidNumeric;
8
+ var uuidNumeric = function () { return new Date().valueOf(); };
9
+ exports.uuidNumeric = uuidNumeric;
10
+ exports.default = exports.uuidNumeric;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @category uid
3
+ * @see https://stackoverflow.com/a/18048162/1938970
4
+ */
5
+ export var uuidNumeric = function () { return new Date().valueOf(); };
6
+ export default uuidNumeric;
package/wait.js CHANGED
@@ -1,9 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wait = void 0;
1
4
  /**
2
5
  * A promisified `setTimeout`
3
6
  *
4
7
  * @category async
5
8
  */
6
- export var wait = function (milliseconds) {
9
+ var wait = function (milliseconds) {
7
10
  return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
8
11
  };
9
- export default wait;
12
+ exports.wait = wait;
13
+ exports.default = exports.wait;
package/wait.mjs ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A promisified `setTimeout`
3
+ *
4
+ * @category async
5
+ */
6
+ export var wait = function (milliseconds) {
7
+ return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
8
+ };
9
+ export default wait;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addOrReplaceAtIdx = void 0;
4
- var tslib_1 = require("tslib");
5
- /**
6
- * @category array
7
- */
8
- function addOrReplaceAtIdx(list, newItem, newIdx) {
9
- if (list.length === 0) {
10
- return [newItem];
11
- }
12
- if (typeof newIdx === "undefined" || list.length - 1 < newIdx) {
13
- return tslib_1.__spreadArray(tslib_1.__spreadArray([], list, true), [newItem], false);
14
- }
15
- return list.map(function (item, idx) {
16
- if (idx === newIdx) {
17
- return newItem;
18
- }
19
- return item;
20
- });
21
- }
22
- exports.addOrReplaceAtIdx = addOrReplaceAtIdx;
23
- exports.default = addOrReplaceAtIdx;
package/node/arraySum.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.arraySum = void 0;
4
- /**
5
- * Sum array of numbers
6
- *
7
- * @category array | math
8
- */
9
- var arraySum = function (numbers) {
10
- return numbers.reduce(function (sum, current) { return sum + current; }, 0);
11
- };
12
- exports.arraySum = arraySum;
13
- exports.default = exports.arraySum;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.changeUrlPath = void 0;
4
- var tslib_1 = require("tslib");
5
- var isBrowser_1 = tslib_1.__importDefault(require("./isBrowser"));
6
- var normaliseUrlPathname_1 = tslib_1.__importDefault(require("./normaliseUrlPathname"));
7
- /**
8
- * Change URL path, ensures initial and ending slashes and normalise eventual
9
- * consecutive slashes, it uses `history`.
10
- *
11
- * @category location
12
- * @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
13
- * @returns {string} The new cleaned pathname
14
- */
15
- function changeUrlPath(pathname, state, replace) {
16
- var path = (0, normaliseUrlPathname_1.default)("/".concat(pathname, "/"));
17
- if (isBrowser_1.default) {
18
- history[replace ? "replaceState" : "pushState"](state, "", path);
19
- }
20
- return path;
21
- }
22
- exports.changeUrlPath = changeUrlPath;
23
- exports.default = changeUrlPath;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debouncePromise = void 0;
4
- var ts_debounce_1 = require("ts-debounce");
5
- /**
6
- * Debounce function (with `Promise`)
7
- *
8
- * @category function
9
- * @borrows [chodorowicz/ts-debounce](https://github.com/chodorowicz/ts-debounce)
10
- */
11
- exports.debouncePromise = ts_debounce_1.debounce;
12
- exports.default = exports.debouncePromise;
package/node/ensureInt.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureInt = void 0;
4
- /**
5
- * Ensure input to be an integer
6
- *
7
- * @category cast
8
- */
9
- var ensureInt = function (input) {
10
- return typeof input === "string" ? parseInt(input, 10) : Math.round(input);
11
- };
12
- exports.ensureInt = ensureInt;
13
- exports.default = exports.ensureInt;
package/node/forin.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forin = void 0;
4
- /**
5
- * To easily get typed native `for in`
6
- *
7
- * @category objects
8
- */
9
- function forin(object, cb) {
10
- for (var key in object) {
11
- cb(key, object[key]);
12
- }
13
- }
14
- exports.forin = forin;
15
- exports.default = forin;
package/node/gbToBytes.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gbToBytes = void 0;
4
- /**
5
- * Gigabytes to bytes
6
- *
7
- * @category format
8
- */
9
- var gbToBytes = function (bytes) { return bytes * 1000 * 1000 * 1000; };
10
- exports.gbToBytes = gbToBytes;
11
- exports.default = exports.gbToBytes;
@@ -1,20 +0,0 @@
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"));
6
- /**
7
- *
8
- * Returns an array of undefined values of the desired length, useful to build
9
- * skeleton UIs.
10
- *
11
- * @category array
12
- */
13
- function getEmptyArray /* <T extends undefined | null = undefined> */(length) {
14
- if (!(0, isNumber_1.default)(length)) {
15
- length = parseInt(length, 10);
16
- }
17
- return Array.from({ length: length });
18
- }
19
- exports.getEmptyArray = getEmptyArray;
20
- exports.default = getEmptyArray;
package/node/getNonce.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNonce = void 0;
4
- var isUndefined_1 = require("./isUndefined");
5
- /**
6
- * @category security
7
- * @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
8
- */
9
- function getNonce() {
10
- return (0, isUndefined_1.isUndefined)(__webpack_nonce__) ? null : __webpack_nonce__;
11
- }
12
- exports.getNonce = getNonce;
13
- exports.default = getNonce;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParamAsString = void 0;
4
- var tslib_1 = require("tslib");
5
- var isArray_1 = tslib_1.__importDefault(require("./isArray"));
6
- /**
7
- * Get query parameter as `string` treating the `ParsedUrlQuery` result of
8
- * [`querystring`](https://nodejs.org/api/querystring.html) (used in next.js
9
- * router and elsewhere)
10
- *
11
- * @category location
12
- *
13
- * @param {string} [raw] - The _raw_ query parameter
14
- */
15
- function getParamAsString(raw) {
16
- return ((0, isArray_1.default)(raw) ? raw[0] : raw) || "";
17
- }
18
- exports.getParamAsString = getParamAsString;
19
- exports.default = getParamAsString;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.imgEmptyPixel = void 0;
4
- /**
5
- * Empty img pixel as a string to inline
6
- *
7
- * @category img
8
- */
9
- exports.imgEmptyPixel = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";
10
- exports.default = exports.imgEmptyPixel;
package/node/index.js DELETED
@@ -1,134 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./accentSets"), exports);
5
- tslib_1.__exportStar(require("./addOrReplaceAtIdx"), exports);
6
- tslib_1.__exportStar(require("./areEqual"), exports);
7
- tslib_1.__exportStar(require("./arrayOfAll"), exports);
8
- tslib_1.__exportStar(require("./arraySum"), exports);
9
- tslib_1.__exportStar(require("./arrayToLookup"), exports);
10
- tslib_1.__exportStar(require("./buildUrlQueryString"), exports);
11
- tslib_1.__exportStar(require("./capitalize"), exports);
12
- tslib_1.__exportStar(require("./changeUrlPath"), exports);
13
- tslib_1.__exportStar(require("./chunkByChunks"), exports);
14
- tslib_1.__exportStar(require("./chunkBySize"), exports);
15
- tslib_1.__exportStar(require("./clamp"), exports);
16
- tslib_1.__exportStar(require("./clsx"), exports);
17
- tslib_1.__exportStar(require("./convertRange"), exports);
18
- tslib_1.__exportStar(require("./cookie"), exports);
19
- tslib_1.__exportStar(require("./debounce"), exports);
20
- tslib_1.__exportStar(require("./debounceRaf"), exports);
21
- tslib_1.__exportStar(require("./debouncePromise"), exports);
22
- tslib_1.__exportStar(require("./decode"), exports);
23
- tslib_1.__exportStar(require("./Defer"), exports);
24
- tslib_1.__exportStar(require("./Emitter"), exports);
25
- tslib_1.__exportStar(require("./encode"), exports);
26
- tslib_1.__exportStar(require("./ensureInt"), exports);
27
- // export * from "./env"
28
- tslib_1.__exportStar(require("./findDuplicatedIndexes"), exports);
29
- tslib_1.__exportStar(require("./forin"), exports);
30
- tslib_1.__exportStar(require("./gbToBytes"), exports);
31
- tslib_1.__exportStar(require("./getEmptyArray"), exports);
32
- tslib_1.__exportStar(require("./getKeys"), exports);
33
- tslib_1.__exportStar(require("./getMediaQueryWidthResolvers"), exports);
34
- tslib_1.__exportStar(require("./getMediaQueryWidthTailwindScreens"), exports);
35
- tslib_1.__exportStar(require("./getNonce"), exports);
36
- tslib_1.__exportStar(require("./getParamAmong"), exports);
37
- tslib_1.__exportStar(require("./getParamAsInt"), exports);
38
- tslib_1.__exportStar(require("./getParamAsString"), exports);
39
- tslib_1.__exportStar(require("./getType"), exports);
40
- tslib_1.__exportStar(require("./getUrlHashParams"), exports);
41
- tslib_1.__exportStar(require("./getUrlHashPathname"), exports);
42
- tslib_1.__exportStar(require("./getUrlPathnameParts"), exports);
43
- tslib_1.__exportStar(require("./getUrlQueryParams"), exports);
44
- tslib_1.__exportStar(require("./imgEmptyPixel"), exports);
45
- tslib_1.__exportStar(require("./isAnyObject"), exports);
46
- tslib_1.__exportStar(require("./isArray"), exports);
47
- tslib_1.__exportStar(require("./isBlob"), exports);
48
- tslib_1.__exportStar(require("./isBoolean"), exports);
49
- tslib_1.__exportStar(require("./isBrowser"), exports);
50
- tslib_1.__exportStar(require("./isDate"), exports);
51
- tslib_1.__exportStar(require("./isEmptyArray"), exports);
52
- tslib_1.__exportStar(require("./isEmptyObject"), exports);
53
- tslib_1.__exportStar(require("./isEmptyString"), exports);
54
- tslib_1.__exportStar(require("./isError"), exports);
55
- tslib_1.__exportStar(require("./isExternalUrl"), exports);
56
- tslib_1.__exportStar(require("./isFile"), exports);
57
- tslib_1.__exportStar(require("./isFloat"), exports);
58
- tslib_1.__exportStar(require("./isFormData"), exports);
59
- tslib_1.__exportStar(require("./isFullArray"), exports);
60
- tslib_1.__exportStar(require("./isFullObject"), exports);
61
- tslib_1.__exportStar(require("./isFullString"), exports);
62
- tslib_1.__exportStar(require("./isFunction"), exports);
63
- tslib_1.__exportStar(require("./isInt"), exports);
64
- tslib_1.__exportStar(require("./isMap"), exports);
65
- tslib_1.__exportStar(require("./isNaNValue"), exports);
66
- tslib_1.__exportStar(require("./isNegativeNumber"), exports);
67
- tslib_1.__exportStar(require("./isNullOrUndefined"), exports);
68
- tslib_1.__exportStar(require("./isNull"), exports);
69
- tslib_1.__exportStar(require("./isNumber"), exports);
70
- tslib_1.__exportStar(require("./isObjectLike"), exports);
71
- tslib_1.__exportStar(require("./isObject"), exports);
72
- tslib_1.__exportStar(require("./isOneOf"), exports);
73
- tslib_1.__exportStar(require("./isPlainObject"), exports);
74
- tslib_1.__exportStar(require("./isPositiveNumber"), exports);
75
- tslib_1.__exportStar(require("./isPrimitive"), exports);
76
- tslib_1.__exportStar(require("./isPromise"), exports);
77
- tslib_1.__exportStar(require("./isRegExp"), exports);
78
- tslib_1.__exportStar(require("./isServer"), exports);
79
- tslib_1.__exportStar(require("./isSet"), exports);
80
- tslib_1.__exportStar(require("./isString"), exports);
81
- tslib_1.__exportStar(require("./isSymbol"), exports);
82
- tslib_1.__exportStar(require("./isType"), exports);
83
- tslib_1.__exportStar(require("./isUndefined"), exports);
84
- tslib_1.__exportStar(require("./isWeakMap"), exports);
85
- tslib_1.__exportStar(require("./isWeakSet"), exports);
86
- tslib_1.__exportStar(require("./kbToBytes"), exports);
87
- tslib_1.__exportStar(require("./location"), exports);
88
- tslib_1.__exportStar(require("./lowercase"), exports);
89
- tslib_1.__exportStar(require("./mapListBy"), exports);
90
- tslib_1.__exportStar(require("./matchSorter"), exports);
91
- tslib_1.__exportStar(require("./mbToBytes"), exports);
92
- tslib_1.__exportStar(require("./mergeObjects"), exports);
93
- tslib_1.__exportStar(require("./mergeUrlQueryParams"), exports);
94
- tslib_1.__exportStar(require("./moveSortableArrayItemByKey"), exports);
95
- tslib_1.__exportStar(require("./noop"), exports);
96
- tslib_1.__exportStar(require("./normaliseUrlPathname"), exports);
97
- tslib_1.__exportStar(require("./normaliseUrl"), exports);
98
- tslib_1.__exportStar(require("./objectPick"), exports);
99
- tslib_1.__exportStar(require("./objectOmit"), exports);
100
- tslib_1.__exportStar(require("./parseCookie"), exports);
101
- tslib_1.__exportStar(require("./parseURL"), exports);
102
- tslib_1.__exportStar(require("./quaranteneProps"), exports);
103
- tslib_1.__exportStar(require("./randomInt"), exports);
104
- tslib_1.__exportStar(require("./randomKey"), exports);
105
- tslib_1.__exportStar(require("./readCookie"), exports);
106
- tslib_1.__exportStar(require("./removeAccents"), exports);
107
- tslib_1.__exportStar(require("./removeCookie"), exports);
108
- // export * from "./removeDuplicates";
109
- tslib_1.__exportStar(require("./removeDuplicatesByKey"), exports);
110
- tslib_1.__exportStar(require("./removeDuplicatesComparing"), exports);
111
- tslib_1.__exportStar(require("./removeIndexesFromArray"), exports);
112
- tslib_1.__exportStar(require("./removeTrailingSlash"), exports);
113
- tslib_1.__exportStar(require("./removeUrlQueryParams"), exports);
114
- tslib_1.__exportStar(require("./roundTo"), exports);
115
- tslib_1.__exportStar(require("./serializeCookie"), exports);
116
- tslib_1.__exportStar(require("./setCookie"), exports);
117
- tslib_1.__exportStar(require("./shuffle"), exports);
118
- tslib_1.__exportStar(require("./slugify"), exports);
119
- tslib_1.__exportStar(require("./swapMap"), exports);
120
- tslib_1.__exportStar(require("./throttle"), exports);
121
- tslib_1.__exportStar(require("./titleCase"), exports);
122
- tslib_1.__exportStar(require("./toNumber"), exports);
123
- tslib_1.__exportStar(require("./toRgba"), exports);
124
- tslib_1.__exportStar(require("./transformToUrlPathname"), exports);
125
- tslib_1.__exportStar(require("./truncate"), exports);
126
- tslib_1.__exportStar(require("./tryUntil"), exports);
127
- tslib_1.__exportStar(require("./uid"), exports);
128
- tslib_1.__exportStar(require("./updateLinkParams"), exports);
129
- tslib_1.__exportStar(require("./updateUrlQueryParams"), exports);
130
- tslib_1.__exportStar(require("./uppercase"), exports);
131
- tslib_1.__exportStar(require("./uuid"), exports);
132
- tslib_1.__exportStar(require("./uuidNumeric"), exports);
133
- tslib_1.__exportStar(require("./wait"), exports);
134
- tslib_1.__exportStar(require("./types"), exports);
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAnyObject = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)
8
- *
9
- * @category is
10
- */
11
- function isAnyObject(payload) {
12
- return (0, getType_1.default)(payload) === "Object";
13
- }
14
- exports.isAnyObject = isAnyObject;
15
- exports.default = isAnyObject;
package/node/isArray.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isArray = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is an array
8
- *
9
- * @category is
10
- */
11
- function isArray(payload) {
12
- return (0, getType_1.default)(payload) === "Array";
13
- }
14
- exports.isArray = isArray;
15
- exports.default = isArray;
package/node/isBlob.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBlob = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is a Blob
8
- *
9
- * @category is
10
- */
11
- function isBlob(payload) {
12
- return (0, getType_1.default)(payload) === "Blob";
13
- }
14
- exports.isBlob = isBlob;
15
- exports.default = isBlob;
package/node/isBoolean.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBoolean = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is a boolean
8
- *
9
- * @category is
10
- */
11
- function isBoolean(payload) {
12
- return (0, getType_1.default)(payload) === "Boolean";
13
- }
14
- exports.isBoolean = isBoolean;
15
- exports.default = isBoolean;
package/node/isBrowser.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // import { isUndefined } from "./is";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.isBrowser = void 0;
5
- /**
6
- * @category ssr
7
- * @category is
8
- */
9
- exports.isBrowser = typeof window !== "undefined";
10
- // export const isBrowser = () => !isUndefined(window);
11
- exports.default = exports.isBrowser;
package/node/isDate.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDate = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is a Date, and that the date is valid
8
- *
9
- * @category is
10
- */
11
- function isDate(payload) {
12
- return (0, getType_1.default)(payload) === "Date" && !isNaN(payload);
13
- }
14
- exports.isDate = isDate;
15
- exports.default = isDate;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmptyArray = void 0;
4
- var tslib_1 = require("tslib");
5
- var isArray_1 = tslib_1.__importDefault(require("./isArray"));
6
- /**
7
- * Returns whether the payload is a an empty array
8
- *
9
- * @category is
10
- */
11
- function isEmptyArray(payload) {
12
- return (0, isArray_1.default)(payload) && payload.length === 0;
13
- }
14
- exports.isEmptyArray = isEmptyArray;
15
- exports.default = isEmptyArray;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmptyObject = void 0;
4
- var tslib_1 = require("tslib");
5
- var isPlainObject_1 = tslib_1.__importDefault(require("./isPlainObject"));
6
- /**
7
- * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
8
- *
9
- * @category is
10
- */
11
- function isEmptyObject(payload) {
12
- return (0, isPlainObject_1.default)(payload) && Object.keys(payload).length === 0;
13
- }
14
- exports.isEmptyObject = isEmptyObject;
15
- exports.default = isEmptyObject;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmptyString = void 0;
4
- /**
5
- * Returns whether the payload is ''
6
- *
7
- * @category is
8
- */
9
- function isEmptyString(payload) {
10
- return payload === "";
11
- }
12
- exports.isEmptyString = isEmptyString;
13
- exports.default = isEmptyString;
package/node/isError.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isError = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is an Error
8
- *
9
- * @category is
10
- */
11
- function isError(payload) {
12
- return (0, getType_1.default)(payload) === "Error";
13
- }
14
- exports.isError = isError;
15
- exports.default = isError;
package/node/isFile.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFile = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is a File
8
- *
9
- * @category is
10
- */
11
- function isFile(payload) {
12
- return (0, getType_1.default)(payload) === "File";
13
- }
14
- exports.isFile = isFile;
15
- exports.default = isFile;
package/node/isFloat.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFloat = void 0;
4
- var tslib_1 = require("tslib");
5
- var isNumber_1 = tslib_1.__importDefault(require("./isNumber"));
6
- /**
7
- * Returns whether the payload is a float number
8
- *
9
- * @category is
10
- */
11
- function isFloat(payload) {
12
- return (0, isNumber_1.default)(payload) && payload % 1 !== 0;
13
- }
14
- exports.isFloat = isFloat;
15
- exports.default = isFloat;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFormData = void 0;
4
- var tslib_1 = require("tslib");
5
- var getType_1 = tslib_1.__importDefault(require("./getType"));
6
- /**
7
- * Returns whether the payload is a FormData
8
- *
9
- * @category is
10
- */
11
- function isFormData(payload) {
12
- return (0, getType_1.default)(payload) === "FormData";
13
- }
14
- exports.isFormData = isFormData;
15
- exports.default = isFormData;