@splendidlabz/utils 1.11.2 → 1.11.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 (228) hide show
  1. package/dist/cjs/dom/accessibility.cjs +2 -0
  2. package/dist/cjs/dom/actions/index.cjs +392 -7
  3. package/dist/cjs/dom/actions/masonry.cjs +97 -6
  4. package/dist/cjs/dom/actions/prefer-horizontal-scroll.cjs +58 -14
  5. package/dist/cjs/dom/actions/sticky.cjs +126 -6
  6. package/dist/cjs/dom/bounding-box.cjs +2 -0
  7. package/dist/cjs/dom/clipboard.cjs +2 -0
  8. package/dist/cjs/dom/cookie.cjs +3 -1
  9. package/dist/cjs/dom/css-vars.cjs +13 -3
  10. package/dist/cjs/dom/events.cjs +2 -0
  11. package/dist/cjs/dom/focusable.cjs +2 -0
  12. package/dist/cjs/dom/font-size.cjs +15 -3
  13. package/dist/cjs/dom/get-element.cjs +3 -1
  14. package/dist/cjs/dom/hash.cjs +2 -0
  15. package/dist/cjs/dom/index.cjs +1249 -47
  16. package/dist/cjs/dom/keyboard.cjs +2 -0
  17. package/dist/cjs/dom/local-store.cjs +3 -1
  18. package/dist/cjs/dom/media.cjs +2 -0
  19. package/dist/cjs/dom/observers/index.cjs +235 -9
  20. package/dist/cjs/dom/observers/intersection-observer.cjs +38 -6
  21. package/dist/cjs/dom/observers/mutation-observer.cjs +38 -6
  22. package/dist/cjs/dom/observers/observer.cjs +12 -2
  23. package/dist/cjs/dom/observers/resize-observer.cjs +38 -6
  24. package/dist/cjs/dom/observers/scroll-observer.cjs +62 -3
  25. package/dist/cjs/dom/pkce.cjs +13 -3
  26. package/dist/cjs/dom/query-params.cjs +3 -1
  27. package/dist/cjs/dom/random-string.cjs +2 -0
  28. package/dist/cjs/dom/sanitize.cjs +27 -3
  29. package/dist/cjs/dom/session-store.cjs +3 -1
  30. package/dist/cjs/dom/spam-prevention.cjs +2 -0
  31. package/dist/cjs/dom/trap-focus.cjs +131 -9
  32. package/dist/cjs/dom/ui/aria-current.cjs +2 -0
  33. package/dist/cjs/dom/ui/inconsistent-button-fix.cjs +2 -0
  34. package/dist/cjs/dom/ui/index.cjs +87 -9
  35. package/dist/cjs/dom/ui/scroll-container.cjs +2 -0
  36. package/dist/cjs/dom/ui/traverse-and-scramble.cjs +2 -0
  37. package/dist/cjs/lib/arrays/index.cjs +121 -13
  38. package/dist/cjs/lib/arrays/item-position.cjs +2 -0
  39. package/dist/cjs/lib/arrays/join.cjs +10 -2
  40. package/dist/cjs/lib/arrays/shuffle.cjs +2 -0
  41. package/dist/cjs/lib/arrays/sort.cjs +11 -3
  42. package/dist/cjs/lib/arrays/split-array.cjs +2 -0
  43. package/dist/cjs/lib/arrays/unique.cjs +2 -0
  44. package/dist/cjs/lib/auth/index.cjs +35 -3
  45. package/dist/cjs/lib/auth/route-manager.cjs +2 -0
  46. package/dist/cjs/lib/checks.cjs +2 -0
  47. package/dist/cjs/lib/date/days.cjs +3 -1
  48. package/dist/cjs/lib/date/index.cjs +190 -7
  49. package/dist/cjs/lib/date/months.cjs +3 -1
  50. package/dist/cjs/lib/date/time.cjs +14 -2
  51. package/dist/cjs/lib/form/form-data.cjs +2 -0
  52. package/dist/cjs/lib/form/index.cjs +104 -5
  53. package/dist/cjs/lib/form/sanitize.cjs +2 -0
  54. package/dist/cjs/lib/functions/callback.cjs +2 -0
  55. package/dist/cjs/lib/functions/debounce.cjs +2 -0
  56. package/dist/cjs/lib/functions/env.cjs +2 -0
  57. package/dist/cjs/lib/functions/functional.cjs +2 -0
  58. package/dist/cjs/lib/functions/index.cjs +124 -11
  59. package/dist/cjs/lib/functions/throttle.cjs +2 -0
  60. package/dist/cjs/lib/functions/timeout.cjs +2 -0
  61. package/dist/cjs/lib/hash.cjs +2 -0
  62. package/dist/cjs/lib/index.cjs +1160 -29
  63. package/dist/cjs/lib/numbers/index.cjs +17 -4
  64. package/dist/cjs/lib/numbers/math.cjs +2 -0
  65. package/dist/cjs/lib/objects/camelcase-keys.cjs +45 -4
  66. package/dist/cjs/lib/objects/empty.cjs +2 -0
  67. package/dist/cjs/lib/objects/equal.cjs +2 -0
  68. package/dist/cjs/lib/objects/extend.cjs +117 -6
  69. package/dist/cjs/lib/objects/flatten.cjs +11 -3
  70. package/dist/cjs/lib/objects/index.cjs +360 -27
  71. package/dist/cjs/lib/objects/json.cjs +2 -0
  72. package/dist/cjs/lib/objects/loop.cjs +2 -0
  73. package/dist/cjs/lib/objects/mix/mix.cjs +5 -3
  74. package/dist/cjs/lib/objects/nested-property.cjs +2 -0
  75. package/dist/cjs/lib/objects/normalize-object.cjs +78 -4
  76. package/dist/cjs/lib/objects/omit-empty.cjs +2 -0
  77. package/dist/cjs/lib/objects/size.cjs +2 -0
  78. package/dist/cjs/lib/objects/split.cjs +2 -0
  79. package/dist/cjs/lib/promises/index.cjs +51 -3
  80. package/dist/cjs/lib/promises/reject.cjs +19 -2
  81. package/dist/cjs/lib/sse.cjs +29 -4
  82. package/dist/cjs/lib/strings/convert-case/convert-case.cjs +2 -0
  83. package/dist/cjs/lib/strings/index.cjs +179 -11
  84. package/dist/cjs/lib/strings/markdown.cjs +3 -1
  85. package/dist/cjs/lib/strings/name.cjs +2 -0
  86. package/dist/cjs/lib/strings/pluralize.cjs +3 -1
  87. package/dist/cjs/lib/strings/query-string.cjs +2 -0
  88. package/dist/cjs/lib/style/index.cjs +31 -2
  89. package/dist/cjs/lib/symbols/index.cjs +22 -3
  90. package/dist/cjs/lib/symbols/symbols.cjs +2 -0
  91. package/dist/cjs/node/context.cjs +0 -0
  92. package/dist/cjs/node/dirname.cjs +4 -2
  93. package/dist/cjs/node/file-cache.cjs +45 -3
  94. package/dist/cjs/node/file.cjs +4 -2
  95. package/dist/cjs/node/hash.cjs +3 -1
  96. package/dist/cjs/node/index.cjs +278 -15
  97. package/dist/cjs/node/pkce.cjs +20 -8
  98. package/dist/cjs/node/random-string.cjs +3 -1
  99. package/dist/cjs/node/sanitize.cjs +27 -3
  100. package/dist/cjs/node/uuid.cjs +2 -0
  101. package/dist/esm/node/context.js +0 -0
  102. package/dist/esm/node/file-cache.js +1 -1
  103. package/dist/esm/node/pkce.js +3 -2
  104. package/dist/types/node/context.d.cts +2 -0
  105. package/dist/types/node/index.d.cts +1 -1
  106. package/dist/types/node/pkce.d.cts +7 -1
  107. package/package.json +5 -2
  108. package/CHANGELOG.md +0 -231
  109. package/eslint.config.js +0 -2
  110. package/src/dom/accessibility.js +0 -58
  111. package/src/dom/actions/index.js +0 -3
  112. package/src/dom/actions/masonry.js +0 -43
  113. package/src/dom/actions/prefer-horizontal-scroll.js +0 -121
  114. package/src/dom/actions/sticky.js +0 -85
  115. package/src/dom/bounding-box.js +0 -82
  116. package/src/dom/clipboard.js +0 -14
  117. package/src/dom/cookie.js +0 -32
  118. package/src/dom/css-vars.js +0 -19
  119. package/src/dom/events.js +0 -71
  120. package/src/dom/focusable.js +0 -165
  121. package/src/dom/font-size.js +0 -40
  122. package/src/dom/get-element.js +0 -176
  123. package/src/dom/hash.js +0 -9
  124. package/src/dom/index.js +0 -23
  125. package/src/dom/keyboard.js +0 -44
  126. package/src/dom/local-store.js +0 -66
  127. package/src/dom/media.js +0 -30
  128. package/src/dom/observers/index.js +0 -4
  129. package/src/dom/observers/intersection-observer.js +0 -43
  130. package/src/dom/observers/mutation-observer.js +0 -51
  131. package/src/dom/observers/observer.js +0 -18
  132. package/src/dom/observers/resize-observer.js +0 -66
  133. package/src/dom/observers/scroll-observer.js +0 -146
  134. package/src/dom/pkce.js +0 -34
  135. package/src/dom/query-params.js +0 -14
  136. package/src/dom/random-string.js +0 -18
  137. package/src/dom/random-string.test.js +0 -13
  138. package/src/dom/sanitize.js +0 -16
  139. package/src/dom/session-store.js +0 -29
  140. package/src/dom/spam-prevention.js +0 -40
  141. package/src/dom/trap-focus.js +0 -70
  142. package/src/dom/ui/aria-current.js +0 -20
  143. package/src/dom/ui/inconsistent-button-fix.js +0 -20
  144. package/src/dom/ui/index.js +0 -4
  145. package/src/dom/ui/scroll-container.js +0 -25
  146. package/src/dom/ui/traverse-and-scramble.js +0 -61
  147. package/src/lib/arrays/index.js +0 -6
  148. package/src/lib/arrays/item-position.js +0 -23
  149. package/src/lib/arrays/join.js +0 -20
  150. package/src/lib/arrays/shuffle.js +0 -21
  151. package/src/lib/arrays/sort.js +0 -88
  152. package/src/lib/arrays/sort.spec.js +0 -123
  153. package/src/lib/arrays/split-array.js +0 -15
  154. package/src/lib/arrays/unique.js +0 -3
  155. package/src/lib/auth/index.js +0 -1
  156. package/src/lib/auth/route-manager.js +0 -45
  157. package/src/lib/checks.js +0 -57
  158. package/src/lib/date/days.js +0 -9
  159. package/src/lib/date/index.js +0 -3
  160. package/src/lib/date/months.js +0 -74
  161. package/src/lib/date/time.js +0 -83
  162. package/src/lib/form/form-data.js +0 -73
  163. package/src/lib/form/index.js +0 -2
  164. package/src/lib/form/sanitize.js +0 -80
  165. package/src/lib/form/sanitize.spec.js +0 -126
  166. package/src/lib/functions/callback.js +0 -8
  167. package/src/lib/functions/debounce.js +0 -18
  168. package/src/lib/functions/env.js +0 -5
  169. package/src/lib/functions/functional.js +0 -113
  170. package/src/lib/functions/functional.test.js +0 -196
  171. package/src/lib/functions/index.js +0 -5
  172. package/src/lib/functions/throttle.js +0 -11
  173. package/src/lib/functions/timeout.js +0 -15
  174. package/src/lib/hash.js +0 -18
  175. package/src/lib/hash.spec.js +0 -163
  176. package/src/lib/index.js +0 -14
  177. package/src/lib/numbers/index.js +0 -12
  178. package/src/lib/numbers/math.js +0 -9
  179. package/src/lib/numbers/split-unit.test.js +0 -45
  180. package/src/lib/objects/camelcase-keys.js +0 -17
  181. package/src/lib/objects/camelcase-keys.test.js +0 -72
  182. package/src/lib/objects/empty.js +0 -10
  183. package/src/lib/objects/equal.js +0 -9
  184. package/src/lib/objects/extend.js +0 -16
  185. package/src/lib/objects/extend.test.js +0 -35
  186. package/src/lib/objects/flatten.js +0 -19
  187. package/src/lib/objects/index.js +0 -13
  188. package/src/lib/objects/json.js +0 -7
  189. package/src/lib/objects/loop.js +0 -11
  190. package/src/lib/objects/loop.test.js +0 -31
  191. package/src/lib/objects/mix/mix.js +0 -191
  192. package/src/lib/objects/mix/mix.md +0 -78
  193. package/src/lib/objects/mix/mix.test.js +0 -445
  194. package/src/lib/objects/nested-property.js +0 -41
  195. package/src/lib/objects/normalize-object.js +0 -10
  196. package/src/lib/objects/omit-empty.js +0 -23
  197. package/src/lib/objects/omit-empty.test.js +0 -85
  198. package/src/lib/objects/size.js +0 -41
  199. package/src/lib/objects/split.js +0 -19
  200. package/src/lib/promises/index.js +0 -1
  201. package/src/lib/promises/reject.js +0 -17
  202. package/src/lib/sse.js +0 -61
  203. package/src/lib/strings/convert-case/convert-case.js +0 -86
  204. package/src/lib/strings/convert-case/convert-case.md +0 -44
  205. package/src/lib/strings/convert-case/convert-case.test.js +0 -50
  206. package/src/lib/strings/index.js +0 -5
  207. package/src/lib/strings/markdown.js +0 -71
  208. package/src/lib/strings/name.js +0 -24
  209. package/src/lib/strings/name.test.js +0 -67
  210. package/src/lib/strings/pluralize.js +0 -2
  211. package/src/lib/strings/query-string.js +0 -18
  212. package/src/lib/style/index.js +0 -13
  213. package/src/lib/symbols/index.js +0 -1
  214. package/src/lib/symbols/symbols.js +0 -9
  215. package/src/node/dirname.js +0 -17
  216. package/src/node/file-cache.js +0 -184
  217. package/src/node/file.js +0 -13
  218. package/src/node/hash.js +0 -5
  219. package/src/node/index.js +0 -7
  220. package/src/node/pkce.js +0 -33
  221. package/src/node/random-string.js +0 -10
  222. package/src/node/random-string.test.js +0 -15
  223. package/src/node/sanitize.js +0 -13
  224. package/src/node/sanitize.spec.js +0 -142
  225. package/src/node/uuid.js +0 -5
  226. package/tsconfig.json +0 -23
  227. package/tsup.config.js +0 -38
  228. package/tsup.config.mjs +0 -45
@@ -14,14 +14,26 @@ var __copyProps = (to, from, except, desc) => {
14
14
  }
15
15
  return to;
16
16
  };
17
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/numbers/index.js
19
20
  var numbers_exports = {};
20
21
  __export(numbers_exports, {
21
- splitUnit: () => splitUnit
22
+ splitUnit: () => splitUnit,
23
+ toDegrees: () => toDegrees,
24
+ toRadians: () => toRadians
22
25
  });
23
26
  module.exports = __toCommonJS(numbers_exports);
24
- __reExport(numbers_exports, require("./math.js"), module.exports);
27
+
28
+ // src/lib/numbers/math.js
29
+ function toDegrees(angle) {
30
+ return angle * (180 / Math.PI);
31
+ }
32
+ function toRadians(angle) {
33
+ return angle * (Math.PI / 180);
34
+ }
35
+
36
+ // src/lib/numbers/index.js
25
37
  function splitUnit(string) {
26
38
  if (typeof string === "number") return [string, null];
27
39
  const regex = /(-?\d*\.?\d+)\s*([a-z]+)/i;
@@ -32,5 +44,6 @@ function splitUnit(string) {
32
44
  // Annotate the CommonJS export names for ESM import in node:
33
45
  0 && (module.exports = {
34
46
  splitUnit,
35
- ...require("./math.js")
47
+ toDegrees,
48
+ toRadians
36
49
  });
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/numbers/math.js
18
20
  var math_exports = {};
19
21
  __export(math_exports, {
20
22
  toDegrees: () => toDegrees,
@@ -15,20 +15,61 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/objects/camelcase-keys.js
18
20
  var camelcase_keys_exports = {};
19
21
  __export(camelcase_keys_exports, {
20
22
  camelCaseKeys: () => camelCaseKeys
21
23
  });
22
24
  module.exports = __toCommonJS(camelcase_keys_exports);
23
- var import_loop = require("./loop.js");
24
- var import_convert_case = require("../strings/convert-case/convert-case.js");
25
+
26
+ // src/lib/objects/loop.js
27
+ function objectForEach(object, callback) {
28
+ Object.entries(object).forEach(([key, value]) => {
29
+ callback({ key, value });
30
+ });
31
+ }
32
+
33
+ // src/lib/strings/convert-case/convert-case.js
34
+ function toKebab(string) {
35
+ if (!string) return "";
36
+ return string.split("").map((letter, index) => {
37
+ const previousLetter = string[index - 1] || "";
38
+ const currentLetter = letter;
39
+ if (isDigit(currentLetter) && !isDigit(previousLetter)) {
40
+ return `-${currentLetter}`;
41
+ }
42
+ if (!isCaps(currentLetter)) return currentLetter;
43
+ if (previousLetter === "") {
44
+ return `${currentLetter.toLowerCase()}`;
45
+ }
46
+ if (isCaps(previousLetter)) {
47
+ return `${currentLetter.toLowerCase()}`;
48
+ }
49
+ return `-${currentLetter.toLowerCase()}`;
50
+ }).join("").trim().replace(/[-_\s]+/g, "-");
51
+ }
52
+ function toCamel(string) {
53
+ return toKebab(string).split("-").map((word, index) => {
54
+ if (index === 0) return word;
55
+ return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase();
56
+ }).join("");
57
+ }
58
+ function isCaps(char) {
59
+ return /\p{Lu}/u.test(char);
60
+ }
61
+ function isDigit(char) {
62
+ return /[0-9]/.test(char);
63
+ }
64
+
65
+ // src/lib/objects/camelcase-keys.js
25
66
  function camelCaseKeys(obj) {
26
67
  if (typeof obj !== "object" || obj === null) {
27
68
  return obj;
28
69
  }
29
70
  const result = {};
30
- (0, import_loop.objectForEach)(obj, ({ key, value }) => {
31
- const camelCaseKey = (0, import_convert_case.toCamel)(key);
71
+ objectForEach(obj, ({ key, value }) => {
72
+ const camelCaseKey = toCamel(key);
32
73
  result[camelCaseKey] = camelCaseKeys(value);
33
74
  });
34
75
  return result;
@@ -15,6 +15,8 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/objects/empty.js
18
20
  var empty_exports = {};
19
21
  __export(empty_exports, {
20
22
  isEmpty: () => isEmpty,
@@ -25,6 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/lib/objects/equal.js
28
30
  var equal_exports = {};
29
31
  __export(equal_exports, {
30
32
  isEqual: () => isEqual,
@@ -15,19 +15,130 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/objects/extend.js
18
20
  var extend_exports = {};
19
21
  __export(extend_exports, {
20
22
  extendObject: () => extendObject
21
23
  });
22
24
  module.exports = __toCommonJS(extend_exports);
23
- var import_loop = require("./loop.js");
24
- var import_functional = require("../functions/functional.js");
25
- var import_mix = require("./mix/mix.js");
25
+
26
+ // src/lib/objects/loop.js
27
+ function objectForEach(object, callback) {
28
+ Object.entries(object).forEach(([key, value]) => {
29
+ callback({ key, value });
30
+ });
31
+ }
32
+ function objectMap(object, callback) {
33
+ return Object.entries(object).map(([key, value]) => {
34
+ return callback({ key, value });
35
+ });
36
+ }
37
+
38
+ // src/lib/functions/functional.js
39
+ function curry(fn) {
40
+ return function curried(...args) {
41
+ if (args.length >= fn.length) {
42
+ return fn.apply(this, args);
43
+ } else {
44
+ return function(...moreArgs) {
45
+ return curried.apply(this, args.concat(moreArgs));
46
+ };
47
+ }
48
+ };
49
+ }
50
+
51
+ // src/lib/objects/mix/mix.js
52
+ var DEFAULT_OPTIONS = { array: "replace" };
53
+ var mix = createMix();
54
+ var concatMix = createMix({ array: "concat" });
55
+ function createMix(userOptions = {}) {
56
+ const options = { ...DEFAULT_OPTIONS, ...userOptions };
57
+ function _mix(...sources) {
58
+ const result = {};
59
+ for (const source of sources) {
60
+ if (source == null) continue;
61
+ merge(result, source, options);
62
+ }
63
+ return result;
64
+ }
65
+ return _mix;
66
+ }
67
+ function merge(output, input, options) {
68
+ const props = Object.keys(input);
69
+ for (const prop of props) {
70
+ if (prop === "__proto__") continue;
71
+ const descriptor = Object.getOwnPropertyDescriptor(input, prop);
72
+ const value = descriptor.value;
73
+ if (value) descriptor.value = cloneDescriptorValue(value);
74
+ if (!output[prop]) {
75
+ Object.defineProperty(output, prop, descriptor);
76
+ continue;
77
+ }
78
+ if (typeof output[prop] !== "object") {
79
+ Object.defineProperty(output, prop, descriptor);
80
+ continue;
81
+ }
82
+ if (descriptor.value == null || typeof descriptor.value !== "object") {
83
+ Object.defineProperty(output, prop, descriptor);
84
+ continue;
85
+ }
86
+ if (objectType(descriptor.value) === "[object Array]") {
87
+ output[prop] = options.array === "replace" ? descriptor.value.slice() : output[prop].concat(descriptor.value);
88
+ continue;
89
+ }
90
+ merge(output[prop], descriptor.value, options);
91
+ }
92
+ }
93
+ function cloneDescriptorValue(value) {
94
+ if (objectType(value) === "[object Array]") {
95
+ const array = [];
96
+ for (let v of value) {
97
+ v = cloneDescriptorValue(v);
98
+ array.push(v);
99
+ }
100
+ return array;
101
+ }
102
+ if (objectType(value) === "[object Object]") {
103
+ const obj = {};
104
+ const props = Object.keys(value);
105
+ for (const prop of props) {
106
+ const descriptor = Object.getOwnPropertyDescriptor(value, prop);
107
+ if (descriptor.value)
108
+ descriptor.value = cloneDescriptorValue(descriptor.value);
109
+ Object.defineProperty(obj, prop, descriptor);
110
+ }
111
+ return obj;
112
+ }
113
+ if (objectType(value) === "[object Date]") {
114
+ return new Date(value.getTime());
115
+ }
116
+ if (objectType(value) === "[object Map]") {
117
+ const map = /* @__PURE__ */ new Map();
118
+ for (const entry of value) {
119
+ map.set(entry[0], cloneDescriptorValue(entry[1]));
120
+ }
121
+ return map;
122
+ }
123
+ if (objectType(value) === "[object Set]") {
124
+ const set = /* @__PURE__ */ new Set();
125
+ for (const entry of value.entries()) {
126
+ set.add(cloneDescriptorValue(entry[0]));
127
+ }
128
+ return set;
129
+ }
130
+ return value;
131
+ }
132
+ function objectType(value) {
133
+ return Object.prototype.toString.call(value);
134
+ }
135
+
136
+ // src/lib/objects/extend.js
26
137
  function extendObject(object) {
27
138
  const orig = object;
28
- const extended = (0, import_mix.mix)({}, object);
29
- extended.forEach = (0, import_functional.curry)(import_loop.objectForEach)(orig);
30
- extended.map = (0, import_functional.curry)(import_loop.objectMap)(orig);
139
+ const extended = mix({}, object);
140
+ extended.forEach = curry(objectForEach)(orig);
141
+ extended.map = curry(objectMap)(orig);
31
142
  return { orig, extended };
32
143
  }
33
144
  // Annotate the CommonJS export names for ESM import in node:
@@ -15,17 +15,25 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/objects/flatten.js
18
20
  var flatten_exports = {};
19
21
  __export(flatten_exports, {
20
22
  flattenObject: () => flattenObject
21
23
  });
22
24
  module.exports = __toCommonJS(flatten_exports);
23
- var import_checks = require("../checks.js");
25
+
26
+ // src/lib/checks.js
27
+ function isObject(x) {
28
+ return typeof x === "object" && !Array.isArray(x) && x !== null;
29
+ }
30
+
31
+ // src/lib/objects/flatten.js
24
32
  function flattenObject(obj, { separator, prefix = "" }) {
25
33
  return Object.entries(obj).reduce((acc, [key, value]) => {
26
34
  const newKey = prefix ? `${prefix}${separator}${key}` : key;
27
- const isAnObject = (0, import_checks.isObject)(value);
28
- const hasNestedObject = isAnObject && Object.values(value).some(import_checks.isObject);
35
+ const isAnObject = isObject(value);
36
+ const hasNestedObject = isAnObject && Object.values(value).some(isObject);
29
37
  if (hasNestedObject) {
30
38
  Object.assign(acc, flattenObject(value, { separator, prefix: newKey }));
31
39
  } else {