@koine/utils 2.0.0-beta.1 → 2.0.0-beta.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 (331) hide show
  1. package/Defer.mjs +6 -5
  2. package/Emitter.d.ts +3 -1
  3. package/Emitter.mjs +16 -17
  4. package/README.md +6 -1
  5. package/accentSets.d.ts +3 -2
  6. package/accentSets.mjs +116 -31
  7. package/addOrReplaceAtIdx.d.ts +4 -0
  8. package/addOrReplaceAtIdx.mjs +13 -6
  9. package/areEqual.d.ts +1 -1
  10. package/areEqual.mjs +17 -23
  11. package/arrayOfAll.d.ts +1 -2
  12. package/arrayOfAll.mjs +2 -8
  13. package/arraySum.d.ts +2 -1
  14. package/arraySum.mjs +3 -5
  15. package/arrayToLookup.mjs +2 -4
  16. package/buildUrlQueryString.mjs +11 -14
  17. package/capitalize.d.ts +2 -1
  18. package/capitalize.mjs +5 -6
  19. package/changeUrlPath.mjs +2 -3
  20. package/chunkByChunks.d.ts +1 -1
  21. package/chunkByChunks.mjs +18 -21
  22. package/chunkBySize.mjs +3 -4
  23. package/clamp.mjs +1 -2
  24. package/clsx.d.ts +6 -2
  25. package/clsx.mjs +14 -15
  26. package/convertRange.d.ts +3 -1
  27. package/convertRange.mjs +5 -4
  28. package/cookie.d.ts +13 -1
  29. package/cookie.mjs +8 -3
  30. package/createPalette.d.ts +3 -1
  31. package/createPalette.mjs +17 -7
  32. package/debounce.mjs +9 -17
  33. package/debouncePromise.d.ts +22 -4
  34. package/debouncePromise.mjs +73 -3
  35. package/debounceRaf.d.ts +1 -1
  36. package/debounceRaf.mjs +6 -11
  37. package/decode.mjs +2 -3
  38. package/encode.mjs +2 -3
  39. package/ensureInt.mjs +1 -4
  40. package/env.mjs +0 -1
  41. package/errorToString.d.ts +2 -1
  42. package/errorToString.mjs +3 -5
  43. package/findDuplicatedIndexes.mjs +4 -5
  44. package/forin.d.ts +2 -1
  45. package/forin.mjs +4 -4
  46. package/gbToBytes.mjs +1 -2
  47. package/getEmptyArray.d.ts +0 -1
  48. package/getEmptyArray.mjs +4 -4
  49. package/getKeys.d.ts +2 -1
  50. package/getKeys.mjs +3 -3
  51. package/getMediaQueryWidthResolvers.d.ts +6 -0
  52. package/getMediaQueryWidthResolvers.mjs +49 -50
  53. package/getMediaQueryWidthTailwindScreens.d.ts +4 -0
  54. package/getMediaQueryWidthTailwindScreens.mjs +22 -15
  55. package/getNonce.mjs +1 -2
  56. package/getParamAmong.d.ts +3 -2
  57. package/getParamAmong.mjs +5 -6
  58. package/getParamAsInt.d.ts +2 -2
  59. package/getParamAsInt.mjs +4 -6
  60. package/getParamAsString.d.ts +1 -1
  61. package/getParamAsString.mjs +2 -3
  62. package/getType.d.ts +0 -3
  63. package/getType.mjs +2 -7
  64. package/getUrlHashParams.mjs +2 -4
  65. package/getUrlHashPathname.mjs +1 -3
  66. package/getUrlPathnameParts.mjs +2 -7
  67. package/getUrlQueryParams.d.ts +3 -4
  68. package/getUrlQueryParams.mjs +10 -22
  69. package/imgEmptyPixel.mjs +1 -2
  70. package/index.d.ts +5 -2
  71. package/index.mjs +2 -2
  72. package/invariant.mjs +6 -8
  73. package/isAnyObject.mjs +1 -2
  74. package/isArray.mjs +1 -2
  75. package/isBlob.mjs +1 -2
  76. package/isBoolean.mjs +1 -2
  77. package/isBrowser.mjs +1 -2
  78. package/isBrowserNow.mjs +1 -2
  79. package/isDate.mjs +1 -2
  80. package/isEmptyArray.mjs +1 -2
  81. package/isEmptyObject.mjs +1 -2
  82. package/isEmptyString.mjs +1 -2
  83. package/isError.mjs +1 -2
  84. package/isExternalUrl.mjs +4 -6
  85. package/isFile.mjs +1 -2
  86. package/isFloat.mjs +1 -2
  87. package/isFormData.mjs +1 -2
  88. package/isFullArray.mjs +1 -2
  89. package/isFullObject.mjs +1 -2
  90. package/isFullString.mjs +1 -2
  91. package/isFunction.mjs +1 -2
  92. package/isInt.mjs +1 -2
  93. package/isMap.mjs +1 -2
  94. package/isNaNValue.mjs +1 -2
  95. package/isNegativeNumber.mjs +1 -2
  96. package/isNull.mjs +1 -2
  97. package/isNullOrUndefined.mjs +1 -2
  98. package/isNumber.mjs +1 -2
  99. package/isObject.mjs +1 -2
  100. package/isObjectLike.mjs +1 -2
  101. package/isOneOf.mjs +1 -7
  102. package/isPlainObject.mjs +3 -6
  103. package/isPositiveNumber.mjs +1 -2
  104. package/isPrimitive.mjs +5 -11
  105. package/isPromise.mjs +1 -2
  106. package/isRegExp.mjs +1 -2
  107. package/isServer.mjs +1 -2
  108. package/isServerNow.mjs +1 -2
  109. package/isSet.mjs +1 -2
  110. package/isString.mjs +1 -2
  111. package/isSymbol.mjs +1 -2
  112. package/isType.mjs +3 -5
  113. package/isUndefined.mjs +1 -2
  114. package/isWeakMap.mjs +1 -2
  115. package/isWeakSet.mjs +1 -2
  116. package/kbToBytes.mjs +1 -2
  117. package/location.mjs +3 -1
  118. package/lowercase.mjs +1 -4
  119. package/mapListBy.mjs +2 -5
  120. package/matchSorter.mjs +110 -128
  121. package/mbToBytes.mjs +1 -2
  122. package/mergeObjects.d.ts +2 -2
  123. package/mergeObjects.mjs +13 -16
  124. package/mergeUrlQueryParams.d.ts +0 -1
  125. package/mergeUrlQueryParams.mjs +4 -9
  126. package/moveSortableArrayItemByKey.d.ts +1 -1
  127. package/moveSortableArrayItemByKey.mjs +9 -9
  128. package/noop.mjs +1 -2
  129. package/normaliseUrl.mjs +1 -3
  130. package/normaliseUrlPathname.mjs +1 -3
  131. package/objectOmit.d.ts +1 -1
  132. package/objectOmit.mjs +4 -6
  133. package/objectPick.d.ts +1 -1
  134. package/objectPick.mjs +5 -6
  135. package/package.json +7 -11
  136. package/parseCookie.mjs +11 -15
  137. package/parseURL.mjs +5 -6
  138. package/quaranteneProps.d.ts +1 -1
  139. package/quaranteneProps.mjs +7 -9
  140. package/randomInt.mjs +1 -2
  141. package/randomKey.mjs +3 -4
  142. package/readCookie.d.ts +5 -0
  143. package/readCookie.mjs +7 -8
  144. package/removeAccents.mjs +5 -8
  145. package/removeCookie.d.ts +0 -4
  146. package/removeCookie.mjs +6 -9
  147. package/removeDuplicates.mjs +0 -1
  148. package/removeDuplicatesByKey.mjs +5 -7
  149. package/removeDuplicatesComparing.mjs +3 -4
  150. package/removeIndexesFromArray.mjs +3 -4
  151. package/removeTrailingSlash.mjs +1 -3
  152. package/removeUrlQueryParams.d.ts +0 -1
  153. package/removeUrlQueryParams.mjs +5 -8
  154. package/render.d.ts +2 -1
  155. package/render.mjs +45 -99
  156. package/roundTo.mjs +15 -17
  157. package/serializeCookie.d.ts +1 -5
  158. package/serializeCookie.mjs +10 -20
  159. package/setCookie.d.ts +0 -4
  160. package/setCookie.mjs +13 -20
  161. package/shuffle.d.ts +7 -6
  162. package/shuffle.mjs +17 -16
  163. package/slugify.d.ts +2 -1
  164. package/slugify.mjs +15 -12
  165. package/split.d.ts +4 -0
  166. package/split.mjs +4 -1
  167. package/swapMap.d.ts +1 -1
  168. package/swapMap.mjs +4 -6
  169. package/throttle.d.ts +2 -1
  170. package/throttle.mjs +6 -12
  171. package/titleCase.d.ts +4 -3
  172. package/titleCase.mjs +5 -9
  173. package/toNumber.mjs +1 -2
  174. package/toRgba.mjs +3 -5
  175. package/transformToUrlPathname.mjs +2 -5
  176. package/truncate.d.ts +1 -1
  177. package/truncate.mjs +2 -9
  178. package/tryUntil.d.ts +4 -1
  179. package/tryUntil.mjs +11 -11
  180. package/types.mjs +2 -1
  181. package/typings.d.ts +1 -6
  182. package/uid.mjs +3 -5
  183. package/updateLinkParams.mjs +2 -3
  184. package/updateUrlQueryParams.d.ts +0 -1
  185. package/updateUrlQueryParams.mjs +3 -8
  186. package/uppercase.d.ts +1 -0
  187. package/uppercase.mjs +2 -4
  188. package/uuid.mjs +2 -5
  189. package/uuidNumeric.mjs +1 -2
  190. package/wait.mjs +1 -4
  191. package/without.mjs +1 -3
  192. package/Defer.js +0 -30
  193. package/Emitter.js +0 -42
  194. package/accentSets.js +0 -41
  195. package/addOrReplaceAtIdx.js +0 -23
  196. package/areEqual.js +0 -81
  197. package/arrayOfAll.js +0 -36
  198. package/arraySum.js +0 -13
  199. package/arrayToLookup.js +0 -17
  200. package/buildUrlQueryString.js +0 -36
  201. package/capitalize.js +0 -16
  202. package/changeUrlPath.js +0 -23
  203. package/chunkByChunks.js +0 -41
  204. package/chunkBySize.js +0 -16
  205. package/clamp.js +0 -14
  206. package/clsx.js +0 -53
  207. package/convertRange.js +0 -20
  208. package/cookie.js +0 -13
  209. package/createPalette.js +0 -26
  210. package/debounce.js +0 -33
  211. package/debouncePromise.js +0 -12
  212. package/debounceRaf.js +0 -31
  213. package/decode.js +0 -14
  214. package/encode.js +0 -14
  215. package/ensureInt.js +0 -13
  216. package/env.js +0 -3
  217. package/errorToString.js +0 -15
  218. package/findDuplicatedIndexes.js +0 -18
  219. package/forin.js +0 -15
  220. package/gbToBytes.js +0 -11
  221. package/getEmptyArray.js +0 -20
  222. package/getKeys.js +0 -12
  223. package/getMediaQueryWidthResolvers.js +0 -72
  224. package/getMediaQueryWidthTailwindScreens.js +0 -33
  225. package/getNonce.js +0 -13
  226. package/getParamAmong.js +0 -22
  227. package/getParamAsInt.js +0 -25
  228. package/getParamAsString.js +0 -19
  229. package/getType.js +0 -23
  230. package/getUrlHashParams.js +0 -20
  231. package/getUrlHashPathname.js +0 -17
  232. package/getUrlPathnameParts.js +0 -25
  233. package/getUrlQueryParams.js +0 -43
  234. package/imgEmptyPixel.js +0 -10
  235. package/index.js +0 -267
  236. package/invariant.js +0 -38
  237. package/isAnyObject.js +0 -15
  238. package/isArray.js +0 -15
  239. package/isBlob.js +0 -15
  240. package/isBoolean.js +0 -15
  241. package/isBrowser.js +0 -9
  242. package/isBrowserNow.js +0 -12
  243. package/isDate.js +0 -15
  244. package/isEmptyArray.js +0 -15
  245. package/isEmptyObject.js +0 -15
  246. package/isEmptyString.js +0 -13
  247. package/isError.js +0 -15
  248. package/isExternalUrl.js +0 -26
  249. package/isFile.js +0 -15
  250. package/isFloat.js +0 -15
  251. package/isFormData.js +0 -15
  252. package/isFullArray.js +0 -15
  253. package/isFullObject.js +0 -15
  254. package/isFullString.js +0 -15
  255. package/isFunction.js +0 -13
  256. package/isInt.js +0 -15
  257. package/isMap.js +0 -15
  258. package/isNaNValue.js +0 -15
  259. package/isNegativeNumber.js +0 -15
  260. package/isNull.js +0 -15
  261. package/isNullOrUndefined.js +0 -14
  262. package/isNumber.js +0 -17
  263. package/isObject.js +0 -15
  264. package/isObjectLike.js +0 -17
  265. package/isOneOf.js +0 -14
  266. package/isPlainObject.js +0 -18
  267. package/isPositiveNumber.js +0 -15
  268. package/isPrimitive.js +0 -25
  269. package/isPromise.js +0 -15
  270. package/isRegExp.js +0 -15
  271. package/isServer.js +0 -12
  272. package/isServerNow.js +0 -12
  273. package/isSet.js +0 -15
  274. package/isString.js +0 -15
  275. package/isSymbol.js +0 -15
  276. package/isType.js +0 -27
  277. package/isUndefined.js +0 -15
  278. package/isWeakMap.js +0 -15
  279. package/isWeakSet.js +0 -15
  280. package/kbToBytes.js +0 -11
  281. package/location.js +0 -2
  282. package/lowercase.js +0 -13
  283. package/mapListBy.js +0 -18
  284. package/matchSorter.js +0 -374
  285. package/mbToBytes.js +0 -11
  286. package/mergeObjects.js +0 -41
  287. package/mergeUrlQueryParams.js +0 -27
  288. package/moveSortableArrayItemByKey.js +0 -21
  289. package/noop.js +0 -11
  290. package/normaliseUrl.js +0 -20
  291. package/normaliseUrlPathname.js +0 -19
  292. package/objectOmit.js +0 -23
  293. package/objectPick.js +0 -19
  294. package/parseCookie.js +0 -52
  295. package/parseURL.js +0 -24
  296. package/quaranteneProps.js +0 -37
  297. package/randomInt.js +0 -13
  298. package/randomKey.js +0 -15
  299. package/readCookie.js +0 -38
  300. package/removeAccents.js +0 -19
  301. package/removeCookie.js +0 -19
  302. package/removeDuplicates.js +0 -13
  303. package/removeDuplicatesByKey.js +0 -24
  304. package/removeDuplicatesComparing.js +0 -14
  305. package/removeIndexesFromArray.js +0 -18
  306. package/removeTrailingSlash.js +0 -14
  307. package/removeUrlQueryParams.js +0 -26
  308. package/render.js +0 -169
  309. package/roundTo.js +0 -38
  310. package/serializeCookie.js +0 -108
  311. package/setCookie.js +0 -62
  312. package/shuffle.js +0 -36
  313. package/slugify.js +0 -27
  314. package/split.js +0 -8
  315. package/swapMap.js +0 -18
  316. package/throttle.js +0 -30
  317. package/titleCase.js +0 -15
  318. package/toNumber.js +0 -12
  319. package/toRgba.js +0 -20
  320. package/transformToUrlPathname.js +0 -21
  321. package/truncate.js +0 -17
  322. package/tryUntil.js +0 -31
  323. package/types.js +0 -2
  324. package/uid.js +0 -16
  325. package/updateLinkParams.js +0 -19
  326. package/updateUrlQueryParams.js +0 -23
  327. package/uppercase.js +0 -13
  328. package/uuid.js +0 -17
  329. package/uuidNumeric.js +0 -10
  330. package/wait.js +0 -13
  331. package/without.js +0 -56
package/isFloat.mjs CHANGED
@@ -3,8 +3,7 @@ import isNumber from "./isNumber";
3
3
  * Returns whether the payload is a float number
4
4
  *
5
5
  * @category is
6
- */
7
- export function isFloat(payload) {
6
+ */ export function isFloat(payload) {
8
7
  return isNumber(payload) && payload % 1 !== 0;
9
8
  }
10
9
  export default isFloat;
package/isFormData.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a FormData
4
4
  *
5
5
  * @category is
6
- */
7
- export function isFormData(payload) {
6
+ */ export function isFormData(payload) {
8
7
  return getType(payload) === "FormData";
9
8
  }
10
9
  export default isFormData;
package/isFullArray.mjs CHANGED
@@ -3,8 +3,7 @@ import isArray from "./isArray";
3
3
  * Returns whether the payload is a an array with at least 1 item
4
4
  *
5
5
  * @category is
6
- */
7
- export function isFullArray(payload) {
6
+ */ export function isFullArray(payload) {
8
7
  return isArray(payload) && payload.length > 0;
9
8
  }
10
9
  export default isFullArray;
package/isFullObject.mjs CHANGED
@@ -3,8 +3,7 @@ import isPlainObject from "./isPlainObject";
3
3
  * Returns whether the payload is a an empty object (excluding special classes or objects with other prototypes)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isFullObject(payload) {
6
+ */ export function isFullObject(payload) {
8
7
  return isPlainObject(payload) && Object.keys(payload).length > 0;
9
8
  }
10
9
  export default isFullObject;
package/isFullString.mjs CHANGED
@@ -3,8 +3,7 @@ import isString from "./isString";
3
3
  * Returns whether the payload is a string, BUT returns false for ''
4
4
  *
5
5
  * @category is
6
- */
7
- export function isFullString(payload) {
6
+ */ export function isFullString(payload) {
8
7
  return isString(payload) && payload !== "";
9
8
  }
10
9
  export default isFullString;
package/isFunction.mjs CHANGED
@@ -2,8 +2,7 @@
2
2
  * Returns whether the payload is a function (regular or async)
3
3
  *
4
4
  * @category is
5
- */
6
- export function isFunction(payload) {
5
+ */ export function isFunction(payload) {
7
6
  return typeof payload === "function";
8
7
  }
9
8
  export default isFunction;
package/isInt.mjs CHANGED
@@ -3,8 +3,7 @@ import isNumber from "./isNumber";
3
3
  * Returns whether the payload is an integer number
4
4
  *
5
5
  * @category is
6
- */
7
- export function isInt(payload) {
6
+ */ export function isInt(payload) {
8
7
  return isNumber(payload) && payload % 1 === 0;
9
8
  }
10
9
  export default isInt;
package/isMap.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a Map
4
4
  *
5
5
  * @category is
6
- */
7
- export function isMap(payload) {
6
+ */ export function isMap(payload) {
8
7
  return getType(payload) === "Map";
9
8
  }
10
9
  export default isMap;
package/isNaNValue.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is literally the value `NaN` (it's `NaN` and also a `number`)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isNaNValue(payload) {
6
+ */ export function isNaNValue(payload) {
8
7
  return getType(payload) === "Number" && isNaN(payload);
9
8
  }
10
9
  export default isNaNValue;
@@ -3,8 +3,7 @@ import isNumber from "./isNumber";
3
3
  * Returns whether the payload is a negative number (but not 0)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isNegativeNumber(payload) {
6
+ */ export function isNegativeNumber(payload) {
8
7
  return isNumber(payload) && payload < 0;
9
8
  }
10
9
  export default isNegativeNumber;
package/isNull.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is null
4
4
  *
5
5
  * @category is
6
- */
7
- export function isNull(payload) {
6
+ */ export function isNull(payload) {
8
7
  return getType(payload) === "Null";
9
8
  }
10
9
  export default isNull;
@@ -5,6 +5,5 @@ import isUndefined from "./isUndefined";
5
5
  * Returns true whether the payload is null or undefined
6
6
  *
7
7
  * @category is
8
- */
9
- export var isNullOrUndefined = isOneOf(isNull, isUndefined);
8
+ */ export const isNullOrUndefined = isOneOf(isNull, isUndefined);
10
9
  export default isNullOrUndefined;
package/isNumber.mjs CHANGED
@@ -5,8 +5,7 @@ import getType from "./getType";
5
5
  * This will return `false` for `NaN`!!
6
6
  *
7
7
  * @category is
8
- */
9
- export function isNumber(payload) {
8
+ */ export function isNumber(payload) {
10
9
  return getType(payload) === "Number" && !isNaN(payload);
11
10
  }
12
11
  export default isNumber;
package/isObject.mjs CHANGED
@@ -3,8 +3,7 @@ import isPlainObject from "./isPlainObject";
3
3
  * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isObject(payload) {
6
+ */ export function isObject(payload) {
8
7
  return isPlainObject(payload);
9
8
  }
10
9
  export default isObject;
package/isObjectLike.mjs CHANGED
@@ -5,8 +5,7 @@ import isAnyObject from "./isAnyObject";
5
5
  * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
6
6
  *
7
7
  * @category is
8
- */
9
- export function isObjectLike(payload) {
8
+ */ export function isObjectLike(payload) {
10
9
  return isAnyObject(payload);
11
10
  }
12
11
  export default isObjectLike;
package/isOneOf.mjs CHANGED
@@ -1,10 +1,4 @@
1
1
  export function isOneOf(a, b, c, d, e) {
2
- return function (value) {
3
- return a(value) ||
4
- b(value) ||
5
- (!!c && c(value)) ||
6
- (!!d && d(value)) ||
7
- (!!e && e(value));
8
- };
2
+ return (value)=>a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);
9
3
  }
10
4
  export default isOneOf;
package/isPlainObject.mjs CHANGED
@@ -3,11 +3,8 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isPlainObject(payload) {
8
- if (getType(payload) !== "Object")
9
- return false;
10
- return (payload.constructor === Object &&
11
- Object.getPrototypeOf(payload) === Object.prototype);
6
+ */ export function isPlainObject(payload) {
7
+ if (getType(payload) !== "Object") return false;
8
+ return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
12
9
  }
13
10
  export default isPlainObject;
@@ -3,8 +3,7 @@ import isNumber from "./isNumber";
3
3
  * Returns whether the payload is a positive number (but not 0)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isPositiveNumber(payload) {
6
+ */ export function isPositiveNumber(payload) {
8
7
  return isNumber(payload) && payload > 0;
9
8
  }
10
9
  export default isPositiveNumber;
package/isPrimitive.mjs CHANGED
@@ -1,20 +1,14 @@
1
- import isString from "./isString";
1
+ import isBoolean from "./isBoolean";
2
2
  import isNull from "./isNull";
3
3
  import isNumber from "./isNumber";
4
- import isUndefined from "./isUndefined";
5
- import isBoolean from "./isBoolean";
4
+ import isString from "./isString";
6
5
  import isSymbol from "./isSymbol";
6
+ import isUndefined from "./isUndefined";
7
7
  /**
8
8
  * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)
9
9
  *
10
10
  * @category is
11
- */
12
- export function isPrimitive(payload) {
13
- return (isBoolean(payload) ||
14
- isNull(payload) ||
15
- isUndefined(payload) ||
16
- isNumber(payload) ||
17
- isString(payload) ||
18
- isSymbol(payload));
11
+ */ export function isPrimitive(payload) {
12
+ return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
19
13
  }
20
14
  export default isPrimitive;
package/isPromise.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a Promise
4
4
  *
5
5
  * @category is
6
- */
7
- export function isPromise(payload) {
6
+ */ export function isPromise(payload) {
8
7
  return getType(payload) === "Promise";
9
8
  }
10
9
  export default isPromise;
package/isRegExp.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a regular expression (RegExp)
4
4
  *
5
5
  * @category is
6
- */
7
- export function isRegExp(payload) {
6
+ */ export function isRegExp(payload) {
8
7
  return getType(payload) === "RegExp";
9
8
  }
10
9
  export default isRegExp;
package/isServer.mjs CHANGED
@@ -2,7 +2,6 @@ import isBrowser from "./isBrowser";
2
2
  /**
3
3
  * @category ssr
4
4
  * @category is
5
- */
6
- export var isServer = !isBrowser;
5
+ */ export const isServer = !isBrowser;
7
6
  // export const isServer = typeof window === "undefined";
8
7
  export default isServer;
package/isServerNow.mjs CHANGED
@@ -2,6 +2,5 @@ import isUndefined from "./isUndefined";
2
2
  /**
3
3
  * @category ssr
4
4
  * @category is
5
- */
6
- export var isServerNow = function () { return isUndefined(window); };
5
+ */ export const isServerNow = ()=>isUndefined(window);
7
6
  export default isServerNow;
package/isSet.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a Set
4
4
  *
5
5
  * @category is
6
- */
7
- export function isSet(payload) {
6
+ */ export function isSet(payload) {
8
7
  return getType(payload) === "Set";
9
8
  }
10
9
  export default isSet;
package/isString.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a string
4
4
  *
5
5
  * @category is
6
- */
7
- export function isString(payload) {
6
+ */ export function isString(payload) {
8
7
  return getType(payload) === "String";
9
8
  }
10
9
  export default isString;
package/isSymbol.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a Symbol
4
4
  *
5
5
  * @category is
6
- */
7
- export function isSymbol(payload) {
6
+ */ export function isSymbol(payload) {
8
7
  return getType(payload) === "Symbol";
9
8
  }
10
9
  export default isSymbol;
package/isType.mjs CHANGED
@@ -6,8 +6,7 @@ import getType from "./getType";
6
6
  *
7
7
  * @category is
8
8
  * @throws {TypeError} Will throw type error if type is an invalid type
9
- */
10
- export function isType(payload, type) {
9
+ */ export function isType(payload, type) {
11
10
  if (!(type instanceof Function)) {
12
11
  throw new TypeError("Type must be a function");
13
12
  }
@@ -15,8 +14,7 @@ export function isType(payload, type) {
15
14
  throw new TypeError("Type is not a class");
16
15
  }
17
16
  // Classes usually have names (as functions usually have names)
18
- var name = type.name;
19
- return (getType(payload) === name ||
20
- Boolean(payload && payload.constructor === type));
17
+ const name = type.name;
18
+ return getType(payload) === name || Boolean(payload && payload.constructor === type);
21
19
  }
22
20
  export default isType;
package/isUndefined.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is undefined
4
4
  *
5
5
  * @category is
6
- */
7
- export function isUndefined(payload) {
6
+ */ export function isUndefined(payload) {
8
7
  return getType(payload) === "Undefined";
9
8
  }
10
9
  export default isUndefined;
package/isWeakMap.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a WeakMap
4
4
  *
5
5
  * @category is
6
- */
7
- export function isWeakMap(payload) {
6
+ */ export function isWeakMap(payload) {
8
7
  return getType(payload) === "WeakMap";
9
8
  }
10
9
  export default isWeakMap;
package/isWeakSet.mjs CHANGED
@@ -3,8 +3,7 @@ import getType from "./getType";
3
3
  * Returns whether the payload is a WeakSet
4
4
  *
5
5
  * @category is
6
- */
7
- export function isWeakSet(payload) {
6
+ */ export function isWeakSet(payload) {
8
7
  return getType(payload) === "WeakSet";
9
8
  }
10
9
  export default isWeakSet;
package/kbToBytes.mjs CHANGED
@@ -2,6 +2,5 @@
2
2
  * Kilobytes to bytes
3
3
  *
4
4
  * @category format
5
- */
6
- export var kbToBytes = function (bytes) { return bytes * 1000; };
5
+ */ export const kbToBytes = (bytes)=>bytes * 1000;
7
6
  export default kbToBytes;
package/location.mjs CHANGED
@@ -1 +1,3 @@
1
- export {};
1
+ /**
2
+ * @category location
3
+ */ export { };
package/lowercase.mjs CHANGED
@@ -2,8 +2,5 @@
2
2
  * Replacement for native `toLowercase` tyescript ready (type narrowing ready)
3
3
  *
4
4
  * @category native
5
- */
6
- export var lowercase = function (str) {
7
- return (str || "").toLowerCase();
8
- };
5
+ */ export const lowercase = (str)=>(str || "").toLowerCase();
9
6
  export default lowercase;
package/mapListBy.mjs CHANGED
@@ -2,11 +2,8 @@
2
2
  * Maps an array of objects into a map keyed with the given key
3
3
  *
4
4
  * @category array
5
- */
6
- export function mapListBy(array, key) {
7
- if (array === void 0) { array = []; }
8
- if (key === void 0) { key = ""; }
9
- return array.reduce(function (obj, item) {
5
+ */ export function mapListBy(array = [], key = "") {
6
+ return array.reduce((obj, item)=>{
10
7
  obj[item[key]] = item;
11
8
  return obj;
12
9
  }, {});