@koine/utils 2.0.0-beta.2 → 2.0.0-beta.4

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 (283) hide show
  1. package/Defer.js +23 -18
  2. package/Defer.mjs +6 -5
  3. package/Emitter.js +31 -20
  4. package/Emitter.mjs +13 -16
  5. package/README.md +5 -1
  6. package/accentSets.js +129 -37
  7. package/accentSets.mjs +113 -29
  8. package/addOrReplaceAtIdx.js +27 -10
  9. package/addOrReplaceAtIdx.mjs +9 -6
  10. package/areEqual.js +35 -41
  11. package/areEqual.mjs +16 -22
  12. package/arrayOfAll.js +20 -11
  13. package/arrayOfAll.mjs +1 -6
  14. package/arraySum.js +20 -9
  15. package/arraySum.mjs +1 -4
  16. package/arrayToLookup.js +21 -9
  17. package/arrayToLookup.mjs +2 -4
  18. package/buildUrlQueryString.js +32 -29
  19. package/buildUrlQueryString.mjs +11 -14
  20. package/capitalize.js +21 -9
  21. package/capitalize.mjs +3 -5
  22. package/changeUrlPath.js +23 -17
  23. package/changeUrlPath.mjs +2 -3
  24. package/chunkByChunks.js +35 -24
  25. package/chunkByChunks.mjs +17 -20
  26. package/chunkBySize.js +21 -8
  27. package/chunkBySize.mjs +3 -4
  28. package/clamp.js +19 -6
  29. package/clamp.mjs +1 -2
  30. package/clsx.js +29 -23
  31. package/clsx.mjs +11 -14
  32. package/convertRange.js +20 -7
  33. package/convertRange.mjs +2 -3
  34. package/cookie.js +13 -5
  35. package/cookie.mjs +3 -2
  36. package/createPalette.js +27 -19
  37. package/createPalette.mjs +9 -6
  38. package/debounce.js +27 -21
  39. package/debounce.mjs +9 -17
  40. package/debouncePromise.js +20 -11
  41. package/debouncePromise.mjs +1 -2
  42. package/debounceRaf.js +23 -14
  43. package/debounceRaf.mjs +5 -10
  44. package/decode.js +20 -7
  45. package/decode.mjs +2 -3
  46. package/encode.js +20 -7
  47. package/encode.mjs +2 -3
  48. package/ensureInt.js +20 -9
  49. package/ensureInt.mjs +1 -4
  50. package/env.js +1 -1
  51. package/env.mjs +0 -1
  52. package/errorToString.js +21 -14
  53. package/errorToString.mjs +1 -4
  54. package/findDuplicatedIndexes.js +22 -9
  55. package/findDuplicatedIndexes.mjs +4 -5
  56. package/forin.js +20 -7
  57. package/forin.mjs +2 -3
  58. package/gbToBytes.js +20 -7
  59. package/gbToBytes.mjs +1 -2
  60. package/getEmptyArray.js +25 -16
  61. package/getEmptyArray.mjs +4 -3
  62. package/getKeys.js +20 -6
  63. package/getKeys.mjs +1 -2
  64. package/getMediaQueryWidthResolvers.js +62 -53
  65. package/getMediaQueryWidthResolvers.mjs +44 -49
  66. package/getMediaQueryWidthTailwindScreens.js +36 -18
  67. package/getMediaQueryWidthTailwindScreens.mjs +18 -14
  68. package/getNonce.js +20 -10
  69. package/getNonce.mjs +1 -2
  70. package/getParamAmong.js +22 -19
  71. package/getParamAmong.mjs +2 -4
  72. package/getParamAsInt.js +22 -19
  73. package/getParamAsInt.mjs +2 -4
  74. package/getParamAsString.js +21 -16
  75. package/getParamAsString.mjs +1 -2
  76. package/getType.js +19 -12
  77. package/getType.mjs +2 -4
  78. package/getUrlHashParams.js +20 -13
  79. package/getUrlHashParams.mjs +2 -4
  80. package/getUrlHashPathname.js +20 -8
  81. package/getUrlHashPathname.mjs +1 -3
  82. package/getUrlPathnameParts.js +23 -23
  83. package/getUrlPathnameParts.mjs +2 -7
  84. package/getUrlQueryParams.js +26 -33
  85. package/getUrlQueryParams.mjs +7 -18
  86. package/imgEmptyPixel.js +20 -6
  87. package/imgEmptyPixel.mjs +1 -2
  88. package/index.js +531 -266
  89. package/index.mjs +2 -2
  90. package/invariant.js +24 -12
  91. package/invariant.mjs +6 -8
  92. package/isAnyObject.js +21 -12
  93. package/isAnyObject.mjs +1 -2
  94. package/isArray.js +21 -12
  95. package/isArray.mjs +1 -2
  96. package/isBlob.js +21 -12
  97. package/isBlob.mjs +1 -2
  98. package/isBoolean.js +21 -12
  99. package/isBoolean.mjs +1 -2
  100. package/isBrowser.js +20 -6
  101. package/isBrowser.mjs +1 -2
  102. package/isBrowserNow.js +21 -11
  103. package/isBrowserNow.mjs +1 -2
  104. package/isDate.js +21 -12
  105. package/isDate.mjs +1 -2
  106. package/isEmptyArray.js +21 -12
  107. package/isEmptyArray.mjs +1 -2
  108. package/isEmptyObject.js +21 -12
  109. package/isEmptyObject.mjs +1 -2
  110. package/isEmptyString.js +19 -6
  111. package/isEmptyString.mjs +1 -2
  112. package/isError.js +21 -12
  113. package/isError.mjs +1 -2
  114. package/isExternalUrl.js +24 -18
  115. package/isExternalUrl.mjs +4 -6
  116. package/isFile.js +21 -12
  117. package/isFile.mjs +1 -2
  118. package/isFloat.js +21 -12
  119. package/isFloat.mjs +1 -2
  120. package/isFormData.js +21 -12
  121. package/isFormData.mjs +1 -2
  122. package/isFullArray.js +21 -12
  123. package/isFullArray.mjs +1 -2
  124. package/isFullObject.js +21 -12
  125. package/isFullObject.mjs +1 -2
  126. package/isFullString.js +21 -12
  127. package/isFullString.mjs +1 -2
  128. package/isFunction.js +18 -9
  129. package/isFunction.mjs +1 -2
  130. package/isInt.js +21 -12
  131. package/isInt.mjs +1 -2
  132. package/isMap.js +21 -12
  133. package/isMap.mjs +1 -2
  134. package/isNaNValue.js +21 -12
  135. package/isNaNValue.mjs +1 -2
  136. package/isNegativeNumber.js +21 -12
  137. package/isNegativeNumber.mjs +1 -2
  138. package/isNull.js +21 -12
  139. package/isNull.mjs +1 -2
  140. package/isNullOrUndefined.js +23 -13
  141. package/isNullOrUndefined.mjs +1 -2
  142. package/isNumber.js +21 -14
  143. package/isNumber.mjs +1 -2
  144. package/isObject.js +21 -12
  145. package/isObject.mjs +1 -2
  146. package/isObjectLike.js +21 -14
  147. package/isObjectLike.mjs +1 -2
  148. package/isOneOf.js +19 -11
  149. package/isOneOf.mjs +1 -7
  150. package/isPlainObject.js +22 -15
  151. package/isPlainObject.mjs +3 -6
  152. package/isPositiveNumber.js +21 -12
  153. package/isPositiveNumber.mjs +1 -2
  154. package/isPrimitive.js +26 -22
  155. package/isPrimitive.mjs +5 -11
  156. package/isPromise.js +21 -12
  157. package/isPromise.mjs +1 -2
  158. package/isRegExp.js +21 -12
  159. package/isRegExp.mjs +1 -2
  160. package/isServer.js +22 -11
  161. package/isServer.mjs +1 -2
  162. package/isServerNow.js +21 -11
  163. package/isServerNow.mjs +1 -2
  164. package/isSet.js +21 -12
  165. package/isSet.mjs +1 -2
  166. package/isString.js +21 -12
  167. package/isString.mjs +1 -2
  168. package/isSymbol.js +21 -12
  169. package/isSymbol.mjs +1 -2
  170. package/isType.js +22 -17
  171. package/isType.mjs +3 -5
  172. package/isUndefined.js +21 -12
  173. package/isUndefined.mjs +1 -2
  174. package/isWeakMap.js +21 -12
  175. package/isWeakMap.mjs +1 -2
  176. package/isWeakSet.js +21 -12
  177. package/isWeakSet.mjs +1 -2
  178. package/kbToBytes.js +20 -7
  179. package/kbToBytes.mjs +1 -2
  180. package/location.js +6 -2
  181. package/location.mjs +3 -1
  182. package/lowercase.js +20 -9
  183. package/lowercase.mjs +1 -4
  184. package/mapListBy.js +21 -10
  185. package/mapListBy.mjs +2 -5
  186. package/matchSorter.js +132 -133
  187. package/matchSorter.mjs +108 -126
  188. package/mbToBytes.js +20 -7
  189. package/mbToBytes.mjs +1 -2
  190. package/mergeObjects.d.ts +1 -1
  191. package/mergeObjects.js +24 -26
  192. package/mergeObjects.mjs +12 -15
  193. package/mergeUrlQueryParams.js +25 -20
  194. package/mergeUrlQueryParams.mjs +4 -8
  195. package/moveSortableArrayItemByKey.js +26 -12
  196. package/moveSortableArrayItemByKey.mjs +8 -8
  197. package/noop.js +20 -7
  198. package/noop.mjs +1 -2
  199. package/normaliseUrl.js +22 -18
  200. package/normaliseUrl.mjs +1 -3
  201. package/normaliseUrlPathname.js +22 -17
  202. package/normaliseUrlPathname.mjs +1 -3
  203. package/objectOmit.js +21 -9
  204. package/objectOmit.mjs +3 -5
  205. package/objectPick.js +22 -9
  206. package/objectPick.mjs +4 -5
  207. package/package.json +11 -8
  208. package/parseCookie.js +29 -26
  209. package/parseCookie.mjs +11 -15
  210. package/parseURL.js +23 -10
  211. package/parseURL.mjs +5 -6
  212. package/quaranteneProps.js +24 -12
  213. package/quaranteneProps.mjs +6 -8
  214. package/randomInt.js +19 -6
  215. package/randomInt.mjs +1 -2
  216. package/randomKey.js +21 -8
  217. package/randomKey.mjs +3 -4
  218. package/readCookie.js +25 -12
  219. package/readCookie.mjs +7 -8
  220. package/removeAccents.js +24 -15
  221. package/removeAccents.mjs +5 -8
  222. package/removeCookie.js +26 -17
  223. package/removeCookie.mjs +6 -5
  224. package/removeDuplicates.js +1 -1
  225. package/removeDuplicates.mjs +0 -1
  226. package/removeDuplicatesByKey.js +24 -12
  227. package/removeDuplicatesByKey.mjs +5 -7
  228. package/removeDuplicatesComparing.js +22 -11
  229. package/removeDuplicatesComparing.mjs +3 -4
  230. package/removeIndexesFromArray.js +21 -8
  231. package/removeIndexesFromArray.mjs +3 -4
  232. package/removeTrailingSlash.js +20 -8
  233. package/removeTrailingSlash.mjs +1 -3
  234. package/removeUrlQueryParams.js +27 -20
  235. package/removeUrlQueryParams.mjs +5 -7
  236. package/render.js +61 -137
  237. package/render.mjs +43 -98
  238. package/roundTo.js +34 -22
  239. package/roundTo.mjs +15 -17
  240. package/serializeCookie.js +29 -35
  241. package/serializeCookie.mjs +9 -15
  242. package/setCookie.js +37 -31
  243. package/setCookie.mjs +13 -16
  244. package/shuffle.js +28 -14
  245. package/shuffle.mjs +10 -10
  246. package/slugify.js +33 -25
  247. package/slugify.mjs +13 -11
  248. package/split.js +18 -4
  249. package/swapMap.js +22 -10
  250. package/swapMap.mjs +3 -5
  251. package/throttle.d.ts +1 -0
  252. package/throttle.js +23 -15
  253. package/throttle.mjs +5 -11
  254. package/titleCase.js +20 -11
  255. package/titleCase.mjs +1 -6
  256. package/toNumber.js +20 -9
  257. package/toNumber.mjs +1 -2
  258. package/toRgba.js +22 -10
  259. package/toRgba.mjs +3 -5
  260. package/transformToUrlPathname.js +21 -18
  261. package/transformToUrlPathname.mjs +2 -5
  262. package/truncate.js +20 -13
  263. package/truncate.mjs +1 -8
  264. package/tryUntil.js +26 -15
  265. package/tryUntil.mjs +7 -10
  266. package/types.js +4 -1
  267. package/types.mjs +2 -1
  268. package/uid.js +21 -13
  269. package/uid.mjs +3 -5
  270. package/updateLinkParams.js +21 -14
  271. package/updateLinkParams.mjs +2 -3
  272. package/updateUrlQueryParams.js +26 -21
  273. package/updateUrlQueryParams.mjs +3 -7
  274. package/uppercase.js +20 -9
  275. package/uppercase.mjs +1 -4
  276. package/uuid.js +21 -10
  277. package/uuid.mjs +2 -5
  278. package/uuidNumeric.js +20 -7
  279. package/uuidNumeric.mjs +1 -2
  280. package/wait.js +20 -9
  281. package/wait.mjs +1 -4
  282. package/without.js +2 -3
  283. package/without.mjs +1 -3
@@ -1,68 +1,63 @@
1
- import { __assign } from "tslib";
2
1
  export function getMediaQueryWidthResolvers(customBreakpoints) {
3
- var breakpoints = __assign({ xs: 0 }, customBreakpoints);
4
- var sortedBreakpointsNames = Object.keys(breakpoints).map(function (key) {
5
- var br = key;
6
- return [br, breakpoints[br]];
7
- })
8
- .sort(function (a, b) { return a[1] - b[1]; })
9
- .map(function (item) { return item[0]; });
10
- var getNextBreakpoint = function (breakpoint) {
11
- var index = sortedBreakpointsNames.indexOf(breakpoint);
2
+ const breakpoints = {
3
+ xs: 0,
4
+ ...customBreakpoints
5
+ };
6
+ const sortedBreakpointsNames = Object.keys(breakpoints).map((key)=>{
7
+ const br = key;
8
+ return [
9
+ br,
10
+ breakpoints[br]
11
+ ];
12
+ }).sort((a, b)=>a[1] - b[1]).map((item)=>item[0]);
13
+ const getNextBreakpoint = (breakpoint)=>{
14
+ const index = sortedBreakpointsNames.indexOf(breakpoint);
12
15
  return sortedBreakpointsNames[index + 1];
13
16
  };
14
17
  /**
15
- * It behaves the same as `(min-width: ${value}px)`
16
- * where value is the given breakpoint value.
17
- * For ease of use this can be used both as a function `min("md")` and as an
18
- * object literal `min.md`.
19
- */
20
- var min = function (br) { return "(min-width: ".concat(breakpoints[br], "px)"); };
18
+ * It behaves the same as `(min-width: ${value}px)`
19
+ * where value is the given breakpoint value.
20
+ * For ease of use this can be used both as a function `min("md")` and as an
21
+ * object literal `min.md`.
22
+ */ const min = (br)=>`(min-width: ${breakpoints[br]}px)`;
21
23
  /**
22
- * It behaves the same as `(max-width: ${value}px)`
23
- * where value is the given breakpoint value.
24
- * For ease of use this can be used both as a function `max("md")` and as an
25
- * object literal `max.md`.
26
- */
27
- var max = function (br) { return "(max-width: ".concat(breakpoints[br] - 0.02, "px)"); };
24
+ * It behaves the same as `(max-width: ${value}px)`
25
+ * where value is the given breakpoint value.
26
+ * For ease of use this can be used both as a function `max("md")` and as an
27
+ * object literal `max.md`.
28
+ */ const max = (br)=>`(max-width: ${breakpoints[br] - 0.02}px)`;
28
29
  /**
29
- * It behaves the same as `min`
30
- * @inheritdoc {max}
31
- */
32
- var up = min;
30
+ * It behaves the same as `min`
31
+ * @inheritdoc {max}
32
+ */ const up = min;
33
33
  /**
34
- * It behaves similarly to `max` but you will use the "next" breakpoint,
35
- * specifying CSS that will apply from the given breakpoint and down.
36
- */
37
- var down = function (br) {
38
- var brNext = getNextBreakpoint(br);
34
+ * It behaves similarly to `max` but you will use the "next" breakpoint,
35
+ * specifying CSS that will apply from the given breakpoint and down.
36
+ */ const down = (br)=>{
37
+ const brNext = getNextBreakpoint(br);
39
38
  // TODO: if br does not exists otherwise throw Error
40
- return brNext && "(max-width: ".concat(breakpoints[brNext] - 0.02, "px)");
39
+ return brNext && `(max-width: ${breakpoints[brNext] - 0.02}px)`;
41
40
  };
42
41
  /**
43
- * Media query between the two given breakpoints
44
- */
45
- var between = function (br1, br2) {
42
+ * Media query between the two given breakpoints
43
+ */ const between = (br1, br2)=>{
46
44
  br2 = br2 || getNextBreakpoint(br1);
47
- return br2
48
- ? "(min-width: ".concat(breakpoints[br1], "px) and (max-width: ").concat(breakpoints[br2] - 0.02, "px)")
49
- : min(br1);
45
+ return br2 ? `(min-width: ${breakpoints[br1]}px) and (max-width: ${breakpoints[br2] - 0.02}px)` : min(br1);
50
46
  };
51
47
  /**
52
- * Media query to apply from the given breakpoint until the next, just for its
53
- * full range
54
- */
55
- var only = function (br) {
56
- var brNext = getNextBreakpoint(br);
48
+ * Media query to apply from the given breakpoint until the next, just for its
49
+ * full range
50
+ */ const only = (br)=>{
51
+ const brNext = getNextBreakpoint(br);
57
52
  return brNext ? between(br, brNext) : min(br);
58
53
  };
59
54
  return {
60
- max: max,
61
- min: min,
62
- down: down,
63
- up: up,
64
- between: between,
65
- only: only,
55
+ max,
56
+ min,
57
+ down,
58
+ up,
59
+ between,
60
+ only
66
61
  };
67
62
  }
68
63
  export default getMediaQueryWidthResolvers;
@@ -1,27 +1,46 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMediaQueryWidthTailwindScreens = void 0;
4
- var getMediaQueryWidthResolvers_1 = require("./getMediaQueryWidthResolvers");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getMediaQueryWidthTailwindScreens: function() {
13
+ return getMediaQueryWidthTailwindScreens;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _getMediaQueryWidthResolvers = require("./getMediaQueryWidthResolvers");
5
20
  function getMediaQueryWidthTailwindScreens(breakpoints) {
6
- var mqWidthResolvers = (0, getMediaQueryWidthResolvers_1.getMediaQueryWidthResolvers)(breakpoints);
21
+ const mqWidthResolvers = (0, _getMediaQueryWidthResolvers.getMediaQueryWidthResolvers)(breakpoints);
7
22
  // Object.keys(breakpoints).reduce((screens, br) => {
8
- var screens = Object.keys(breakpoints).reduce(function (output, br, idx) {
9
- var brNext = Object.keys(breakpoints)[idx + 1];
10
- for (var resolverName in mqWidthResolvers) {
23
+ const screens = Object.keys(breakpoints).reduce((output, br, idx)=>{
24
+ const brNext = Object.keys(breakpoints)[idx + 1];
25
+ for(const resolverName in mqWidthResolvers){
11
26
  // this line is just for typescript..
12
- var resolver = resolverName;
13
- var resolverFn = mqWidthResolvers[resolver];
14
- var raw = resolverFn(br);
27
+ const resolver = resolverName;
28
+ const resolverFn = mqWidthResolvers[resolver];
29
+ const raw = resolverFn(br);
15
30
  if (raw) {
16
31
  if (resolverName === "min") {
17
- output["@".concat(br)] = { raw: raw };
32
+ output[`@${br}`] = {
33
+ raw
34
+ };
18
35
  }
19
36
  if (resolverName === "between") {
20
- if (brNext)
21
- output["@".concat(resolverName, "-").concat(br, "_").concat(brNext)] = { raw: raw };
22
- }
23
- else {
24
- output["@".concat(resolverName, "-").concat(br)] = { raw: raw };
37
+ if (brNext) output[`@${resolverName}-${br}_${brNext}`] = {
38
+ raw
39
+ };
40
+ } else {
41
+ output[`@${resolverName}-${br}`] = {
42
+ raw
43
+ };
25
44
  }
26
45
  }
27
46
  }
@@ -29,5 +48,4 @@ function getMediaQueryWidthTailwindScreens(breakpoints) {
29
48
  }, {});
30
49
  return screens;
31
50
  }
32
- exports.getMediaQueryWidthTailwindScreens = getMediaQueryWidthTailwindScreens;
33
- exports.default = getMediaQueryWidthTailwindScreens;
51
+ const _default = getMediaQueryWidthTailwindScreens;
@@ -1,24 +1,28 @@
1
- import { getMediaQueryWidthResolvers, } from "./getMediaQueryWidthResolvers";
1
+ import { getMediaQueryWidthResolvers } from "./getMediaQueryWidthResolvers";
2
2
  export function getMediaQueryWidthTailwindScreens(breakpoints) {
3
- var mqWidthResolvers = getMediaQueryWidthResolvers(breakpoints);
3
+ const mqWidthResolvers = getMediaQueryWidthResolvers(breakpoints);
4
4
  // Object.keys(breakpoints).reduce((screens, br) => {
5
- var screens = Object.keys(breakpoints).reduce(function (output, br, idx) {
6
- var brNext = Object.keys(breakpoints)[idx + 1];
7
- for (var resolverName in mqWidthResolvers) {
5
+ const screens = Object.keys(breakpoints).reduce((output, br, idx)=>{
6
+ const brNext = Object.keys(breakpoints)[idx + 1];
7
+ for(const resolverName in mqWidthResolvers){
8
8
  // this line is just for typescript..
9
- var resolver = resolverName;
10
- var resolverFn = mqWidthResolvers[resolver];
11
- var raw = resolverFn(br);
9
+ const resolver = resolverName;
10
+ const resolverFn = mqWidthResolvers[resolver];
11
+ const raw = resolverFn(br);
12
12
  if (raw) {
13
13
  if (resolverName === "min") {
14
- output["@".concat(br)] = { raw: raw };
14
+ output[`@${br}`] = {
15
+ raw
16
+ };
15
17
  }
16
18
  if (resolverName === "between") {
17
- if (brNext)
18
- output["@".concat(resolverName, "-").concat(br, "_").concat(brNext)] = { raw: raw };
19
- }
20
- else {
21
- output["@".concat(resolverName, "-").concat(br)] = { raw: raw };
19
+ if (brNext) output[`@${resolverName}-${br}_${brNext}`] = {
20
+ raw
21
+ };
22
+ } else {
23
+ output[`@${resolverName}-${br}`] = {
24
+ raw
25
+ };
22
26
  }
23
27
  }
24
28
  }
package/getNonce.js CHANGED
@@ -1,13 +1,23 @@
1
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
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getNonce: function() {
13
+ return getNonce;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _isUndefined = require("./isUndefined");
9
20
  function getNonce() {
10
- return (0, isUndefined_1.isUndefined)(__webpack_nonce__) ? null : __webpack_nonce__;
21
+ return (0, _isUndefined.isUndefined)(__webpack_nonce__) ? null : __webpack_nonce__;
11
22
  }
12
- exports.getNonce = getNonce;
13
- exports.default = getNonce;
23
+ const _default = getNonce;
package/getNonce.mjs CHANGED
@@ -2,8 +2,7 @@ import { isUndefined } from "./isUndefined";
2
2
  /**
3
3
  * @category security
4
4
  * @see https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/nonce.ts
5
- */
6
- export function getNonce() {
5
+ */ export function getNonce() {
7
6
  return isUndefined(__webpack_nonce__) ? null : __webpack_nonce__;
8
7
  }
9
8
  export default getNonce;
package/getParamAmong.js CHANGED
@@ -1,22 +1,25 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParamAmong = void 0;
4
- var tslib_1 = require("tslib");
5
- var getParamAsString_1 = tslib_1.__importDefault(require("./getParamAsString"));
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
- * @param {string[]} [allowedValues=[]] - The list of values (as strings) that the parameter can have, if not one of them `null` is returned
15
- */
16
- function getParamAmong(raw, allowedValues) {
17
- if (allowedValues === void 0) { allowedValues = []; }
18
- var string = (0, getParamAsString_1.default)(raw);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getParamAmong: function() {
13
+ return getParamAmong;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _getParamAsString = /*#__PURE__*/ _interop_require_default._(require("./getParamAsString"));
21
+ function getParamAmong(raw, allowedValues = []) {
22
+ const string = (0, _getParamAsString.default)(raw);
19
23
  return allowedValues.includes(string) ? string : null;
20
24
  }
21
- exports.getParamAmong = getParamAmong;
22
- exports.default = getParamAmong;
25
+ const _default = getParamAmong;
package/getParamAmong.mjs CHANGED
@@ -8,10 +8,8 @@ import getParamAsString from "./getParamAsString";
8
8
  *
9
9
  * @param {string} [raw] - The _raw_ query parameter
10
10
  * @param {string[]} [allowedValues=[]] - The list of values (as strings) that the parameter can have, if not one of them `null` is returned
11
- */
12
- export function getParamAmong(raw, allowedValues) {
13
- if (allowedValues === void 0) { allowedValues = []; }
14
- var string = getParamAsString(raw);
11
+ */ export function getParamAmong(raw, allowedValues = []) {
12
+ const string = getParamAsString(raw);
15
13
  return allowedValues.includes(string) ? string : null;
16
14
  }
17
15
  export default getParamAmong;
package/getParamAsInt.js CHANGED
@@ -1,25 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParamAsInt = void 0;
4
- var tslib_1 = require("tslib");
5
- var getParamAsString_1 = tslib_1.__importDefault(require("./getParamAsString"));
6
- /**
7
- * Get query parameter as `int`eger 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
- * @param {number} [fallback] - Fallback number, we return `null` if not provided
15
- */
16
- function getParamAsInt(raw, fallback) {
17
- if (fallback === void 0) { fallback = null; }
18
- var string = (0, getParamAsString_1.default)(raw);
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getParamAsInt: function() {
13
+ return getParamAsInt;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _getParamAsString = /*#__PURE__*/ _interop_require_default._(require("./getParamAsString"));
21
+ function getParamAsInt(raw, fallback = null) {
22
+ const string = (0, _getParamAsString.default)(raw);
19
23
  if (string) {
20
24
  return parseInt(string, 10);
21
25
  }
22
26
  return fallback;
23
27
  }
24
- exports.getParamAsInt = getParamAsInt;
25
- exports.default = getParamAsInt;
28
+ const _default = getParamAsInt;
package/getParamAsInt.mjs CHANGED
@@ -8,10 +8,8 @@ import getParamAsString from "./getParamAsString";
8
8
  *
9
9
  * @param {string} [raw] - The _raw_ query parameter
10
10
  * @param {number} [fallback] - Fallback number, we return `null` if not provided
11
- */
12
- export function getParamAsInt(raw, fallback) {
13
- if (fallback === void 0) { fallback = null; }
14
- var string = getParamAsString(raw);
11
+ */ export function getParamAsInt(raw, fallback = null) {
12
+ const string = getParamAsString(raw);
15
13
  if (string) {
16
14
  return parseInt(string, 10);
17
15
  }
@@ -1,19 +1,24 @@
1
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
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getParamAsString: function() {
13
+ return getParamAsString;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _isArray = /*#__PURE__*/ _interop_require_default._(require("./isArray"));
15
21
  function getParamAsString(raw) {
16
- return ((0, isArray_1.default)(raw) ? raw[0] : raw) || "";
22
+ return ((0, _isArray.default)(raw) ? raw[0] : raw) || "";
17
23
  }
18
- exports.getParamAsString = getParamAsString;
19
- exports.default = getParamAsString;
24
+ const _default = getParamAsString;
@@ -7,8 +7,7 @@ import isArray from "./isArray";
7
7
  * @category location
8
8
  *
9
9
  * @param {string} [raw] - The _raw_ query parameter
10
- */
11
- export function getParamAsString(raw) {
10
+ */ export function getParamAsString(raw) {
12
11
  return (isArray(raw) ? raw[0] : raw) || "";
13
12
  }
14
13
  export default getParamAsString;
package/getType.js CHANGED
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * @file
4
3
  *
@@ -7,17 +6,25 @@
7
6
  * - `isFormData`
8
7
  * - `isInt`
9
8
  * - `isFloat`
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getType = void 0;
13
- /**
14
- * Returns the object type of the given payload
15
- *
16
- * @param {*} payload
17
- * @returns {string}
18
- */
9
+ */ "use strict";
10
+ Object.defineProperty(exports, "__esModule", {
11
+ value: true
12
+ });
13
+ function _export(target, all) {
14
+ for(var name in all)Object.defineProperty(target, name, {
15
+ enumerable: true,
16
+ get: all[name]
17
+ });
18
+ }
19
+ _export(exports, {
20
+ getType: function() {
21
+ return getType;
22
+ },
23
+ default: function() {
24
+ return _default;
25
+ }
26
+ });
19
27
  function getType(payload) {
20
28
  return Object.prototype.toString.call(payload).slice(8, -1);
21
29
  }
22
- exports.getType = getType;
23
- exports.default = getType;
30
+ const _default = getType;
package/getType.mjs CHANGED
@@ -6,14 +6,12 @@
6
6
  * - `isFormData`
7
7
  * - `isInt`
8
8
  * - `isFloat`
9
- */
10
- /**
9
+ */ /**
11
10
  * Returns the object type of the given payload
12
11
  *
13
12
  * @param {*} payload
14
13
  * @returns {string}
15
- */
16
- export function getType(payload) {
14
+ */ export function getType(payload) {
17
15
  return Object.prototype.toString.call(payload).slice(8, -1);
18
16
  }
19
17
  export default getType;
@@ -1,20 +1,27 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUrlHashParams = void 0;
4
- /**
5
- * It returns the "query params" as an object extracting it from the given `hash`
6
- * string or, if not provided, failling back reading the `location.hash`
7
- *
8
- * @category location
9
- */
10
- function getUrlHashParams(hash) {
11
- if (hash === void 0) { hash = ""; }
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getUrlHashParams: function() {
13
+ return getUrlHashParams;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ function getUrlHashParams(hash = "") {
12
20
  hash = hash || location.hash;
13
- var hashParts = hash.split("?");
21
+ const hashParts = hash.split("?");
14
22
  if (hashParts.length >= 1) {
15
23
  return Object.fromEntries(new URLSearchParams(hashParts[1]));
16
24
  }
17
25
  return {};
18
26
  }
19
- exports.getUrlHashParams = getUrlHashParams;
20
- exports.default = getUrlHashParams;
27
+ const _default = getUrlHashParams;
@@ -3,11 +3,9 @@
3
3
  * string or, if not provided, failling back reading the `location.hash`
4
4
  *
5
5
  * @category location
6
- */
7
- export function getUrlHashParams(hash) {
8
- if (hash === void 0) { hash = ""; }
6
+ */ export function getUrlHashParams(hash = "") {
9
7
  hash = hash || location.hash;
10
- var hashParts = hash.split("?");
8
+ const hashParts = hash.split("?");
11
9
  if (hashParts.length >= 1) {
12
10
  return Object.fromEntries(new URLSearchParams(hashParts[1]));
13
11
  }
@@ -1,17 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUrlHashPathname = void 0;
4
1
  /**
5
2
  * It returns the "pathname" cleaned up from the `#` and the initial slashes
6
3
  * extracting it from the given `hash` string or, if not provided, failling
7
4
  * back reading the `location.hash`
8
5
  *
9
6
  * @category location
10
- */
11
- function getUrlHashPathname(hash) {
12
- if (hash === void 0) { hash = ""; }
7
+ */ "use strict";
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
11
+ function _export(target, all) {
12
+ for(var name in all)Object.defineProperty(target, name, {
13
+ enumerable: true,
14
+ get: all[name]
15
+ });
16
+ }
17
+ _export(exports, {
18
+ getUrlHashPathname: function() {
19
+ return getUrlHashPathname;
20
+ },
21
+ default: function() {
22
+ return _default;
23
+ }
24
+ });
25
+ function getUrlHashPathname(hash = "") {
13
26
  hash = hash || location.hash;
14
27
  return hash.split("?")[0].replace(/^#\//, "");
15
28
  }
16
- exports.getUrlHashPathname = getUrlHashPathname;
17
- exports.default = getUrlHashPathname;
29
+ const _default = getUrlHashPathname;
@@ -4,9 +4,7 @@
4
4
  * back reading the `location.hash`
5
5
  *
6
6
  * @category location
7
- */
8
- export function getUrlHashPathname(hash) {
9
- if (hash === void 0) { hash = ""; }
7
+ */ export function getUrlHashPathname(hash = "") {
10
8
  hash = hash || location.hash;
11
9
  return hash.split("?")[0].replace(/^#\//, "");
12
10
  }