@bemoje/object 2.2.0 → 2.2.2

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 (261) hide show
  1. package/lib/index.cjs +853 -449
  2. package/lib/index.d.cts +548 -69
  3. package/lib/index.d.ts +548 -69
  4. package/lib/index.js +792 -64
  5. package/package.json +274 -530
  6. package/lib/arrAssign.cjs +0 -9
  7. package/lib/arrAssign.d.cts +0 -6
  8. package/lib/arrAssign.d.ts +0 -6
  9. package/lib/arrAssign.js +0 -8
  10. package/lib/className.cjs +0 -10
  11. package/lib/className.d.cts +0 -6
  12. package/lib/className.d.ts +0 -6
  13. package/lib/className.js +0 -8
  14. package/lib/constructorOf.cjs +0 -10
  15. package/lib/constructorOf.d.cts +0 -6
  16. package/lib/constructorOf.d.ts +0 -6
  17. package/lib/constructorOf.js +0 -8
  18. package/lib/createArrayMerger.cjs +0 -19
  19. package/lib/createArrayMerger.d.cts +0 -6
  20. package/lib/createArrayMerger.d.ts +0 -6
  21. package/lib/createArrayMerger.js +0 -17
  22. package/lib/createObjectMerger.cjs +0 -19
  23. package/lib/createObjectMerger.d.cts +0 -8
  24. package/lib/createObjectMerger.d.ts +0 -8
  25. package/lib/createObjectMerger.js +0 -17
  26. package/lib/defineAccessors.cjs +0 -14
  27. package/lib/defineAccessors.d.cts +0 -9
  28. package/lib/defineAccessors.d.ts +0 -9
  29. package/lib/defineAccessors.js +0 -12
  30. package/lib/defineGetter.cjs +0 -15
  31. package/lib/defineGetter.d.cts +0 -8
  32. package/lib/defineGetter.d.ts +0 -8
  33. package/lib/defineGetter.js +0 -13
  34. package/lib/defineLazyProperty.cjs +0 -19
  35. package/lib/defineLazyProperty.d.cts +0 -8
  36. package/lib/defineLazyProperty.d.ts +0 -8
  37. package/lib/defineLazyProperty.js +0 -16
  38. package/lib/defineMethod.cjs +0 -16
  39. package/lib/defineMethod.d.cts +0 -9
  40. package/lib/defineMethod.d.ts +0 -9
  41. package/lib/defineMethod.js +0 -14
  42. package/lib/defineProperty.cjs +0 -13
  43. package/lib/defineProperty.d.cts +0 -10
  44. package/lib/defineProperty.d.ts +0 -10
  45. package/lib/defineProperty.js +0 -11
  46. package/lib/defineSetter.cjs +0 -15
  47. package/lib/defineSetter.d.cts +0 -8
  48. package/lib/defineSetter.d.ts +0 -8
  49. package/lib/defineSetter.js +0 -13
  50. package/lib/defineValue.cjs +0 -15
  51. package/lib/defineValue.d.cts +0 -9
  52. package/lib/defineValue.d.ts +0 -9
  53. package/lib/defineValue.js +0 -13
  54. package/lib/deleteNullishPropsMutable.cjs +0 -15
  55. package/lib/deleteNullishPropsMutable.d.cts +0 -6
  56. package/lib/deleteNullishPropsMutable.d.ts +0 -6
  57. package/lib/deleteNullishPropsMutable.js +0 -13
  58. package/lib/entriesOf.cjs +0 -10
  59. package/lib/entriesOf.d.cts +0 -8
  60. package/lib/entriesOf.d.ts +0 -8
  61. package/lib/entriesOf.js +0 -8
  62. package/lib/filterObject.cjs +0 -18
  63. package/lib/filterObject.d.cts +0 -9
  64. package/lib/filterObject.d.ts +0 -9
  65. package/lib/filterObject.js +0 -15
  66. package/lib/filterObjectMutable.cjs +0 -16
  67. package/lib/filterObjectMutable.d.cts +0 -8
  68. package/lib/filterObjectMutable.d.ts +0 -8
  69. package/lib/filterObjectMutable.js +0 -14
  70. package/lib/getClassChain.cjs +0 -23
  71. package/lib/getClassChain.d.cts +0 -14
  72. package/lib/getClassChain.d.ts +0 -14
  73. package/lib/getClassChain.js +0 -21
  74. package/lib/getConfigurableMethodOrGetterKeys.cjs +0 -22
  75. package/lib/getConfigurableMethodOrGetterKeys.d.cts +0 -10
  76. package/lib/getConfigurableMethodOrGetterKeys.d.ts +0 -10
  77. package/lib/getConfigurableMethodOrGetterKeys.js +0 -20
  78. package/lib/getKeys.cjs +0 -13
  79. package/lib/getKeys.d.cts +0 -19
  80. package/lib/getKeys.d.ts +0 -19
  81. package/lib/getKeys.js +0 -10
  82. package/lib/getKeysPreset.cjs +0 -89
  83. package/lib/getKeysPreset.d.cts +0 -46
  84. package/lib/getKeysPreset.d.ts +0 -46
  85. package/lib/getKeysPreset.js +0 -86
  86. package/lib/getOwnProperty.cjs +0 -10
  87. package/lib/getOwnProperty.d.cts +0 -6
  88. package/lib/getOwnProperty.d.ts +0 -6
  89. package/lib/getOwnProperty.js +0 -8
  90. package/lib/getPrototypeChain.cjs +0 -18
  91. package/lib/getPrototypeChain.d.cts +0 -9
  92. package/lib/getPrototypeChain.d.ts +0 -9
  93. package/lib/getPrototypeChain.js +0 -16
  94. package/lib/getSuperClass.cjs +0 -15
  95. package/lib/getSuperClass.d.cts +0 -11
  96. package/lib/getSuperClass.d.ts +0 -11
  97. package/lib/getSuperClass.js +0 -12
  98. package/lib/getSuperClasses.cjs +0 -14
  99. package/lib/getSuperClasses.d.cts +0 -13
  100. package/lib/getSuperClasses.d.ts +0 -13
  101. package/lib/getSuperClasses.js +0 -11
  102. package/lib/hasOwnProperty.cjs +0 -10
  103. package/lib/hasOwnProperty.d.cts +0 -6
  104. package/lib/hasOwnProperty.d.ts +0 -6
  105. package/lib/hasOwnProperty.js +0 -8
  106. package/lib/hasProperty.cjs +0 -13
  107. package/lib/hasProperty.d.cts +0 -6
  108. package/lib/hasProperty.d.ts +0 -6
  109. package/lib/hasProperty.js +0 -10
  110. package/lib/hasPrototypeChainProperty.cjs +0 -15
  111. package/lib/hasPrototypeChainProperty.d.cts +0 -7
  112. package/lib/hasPrototypeChainProperty.d.ts +0 -7
  113. package/lib/hasPrototypeChainProperty.js +0 -12
  114. package/lib/inheritPrototypeMembers.cjs +0 -22
  115. package/lib/inheritPrototypeMembers.d.cts +0 -8
  116. package/lib/inheritPrototypeMembers.d.ts +0 -8
  117. package/lib/inheritPrototypeMembers.js +0 -20
  118. package/lib/inheritStaticMembers.cjs +0 -23
  119. package/lib/inheritStaticMembers.d.cts +0 -8
  120. package/lib/inheritStaticMembers.d.ts +0 -8
  121. package/lib/inheritStaticMembers.js +0 -21
  122. package/lib/isAccessorDescriptor.cjs +0 -19
  123. package/lib/isAccessorDescriptor.d.cts +0 -19
  124. package/lib/isAccessorDescriptor.d.ts +0 -19
  125. package/lib/isAccessorDescriptor.js +0 -17
  126. package/lib/isEnumerable.cjs +0 -10
  127. package/lib/isEnumerable.d.cts +0 -6
  128. package/lib/isEnumerable.d.ts +0 -6
  129. package/lib/isEnumerable.js +0 -8
  130. package/lib/isMethodValueDescriptor.cjs +0 -10
  131. package/lib/isMethodValueDescriptor.d.cts +0 -10
  132. package/lib/isMethodValueDescriptor.d.ts +0 -10
  133. package/lib/isMethodValueDescriptor.js +0 -8
  134. package/lib/isValueDescriptor.cjs +0 -19
  135. package/lib/isValueDescriptor.d.cts +0 -15
  136. package/lib/isValueDescriptor.d.ts +0 -15
  137. package/lib/isValueDescriptor.js +0 -17
  138. package/lib/iterableFirstElement.cjs +0 -10
  139. package/lib/iterableFirstElement.d.cts +0 -13
  140. package/lib/iterableFirstElement.d.ts +0 -13
  141. package/lib/iterableFirstElement.js +0 -8
  142. package/lib/iterateObject.cjs +0 -72
  143. package/lib/iterateObject.d.cts +0 -36
  144. package/lib/iterateObject.d.ts +0 -36
  145. package/lib/iterateObject.js +0 -70
  146. package/lib/keysOf.cjs +0 -10
  147. package/lib/keysOf.d.cts +0 -8
  148. package/lib/keysOf.d.ts +0 -8
  149. package/lib/keysOf.js +0 -8
  150. package/lib/mapObjectEntries.cjs +0 -17
  151. package/lib/mapObjectEntries.d.cts +0 -8
  152. package/lib/mapObjectEntries.d.ts +0 -8
  153. package/lib/mapObjectEntries.js +0 -14
  154. package/lib/mapObjectKeys.cjs +0 -16
  155. package/lib/mapObjectKeys.d.cts +0 -8
  156. package/lib/mapObjectKeys.d.ts +0 -8
  157. package/lib/mapObjectKeys.js +0 -13
  158. package/lib/objAssign.cjs +0 -9
  159. package/lib/objAssign.d.cts +0 -8
  160. package/lib/objAssign.d.ts +0 -8
  161. package/lib/objAssign.js +0 -8
  162. package/lib/objDeepFreeze.cjs +0 -16
  163. package/lib/objDeepFreeze.d.cts +0 -10
  164. package/lib/objDeepFreeze.d.ts +0 -10
  165. package/lib/objDeepFreeze.js +0 -14
  166. package/lib/objDefineLazyProperty.cjs +0 -29
  167. package/lib/objDefineLazyProperty.d.cts +0 -13
  168. package/lib/objDefineLazyProperty.d.ts +0 -13
  169. package/lib/objDefineLazyProperty.js +0 -27
  170. package/lib/objDelete.cjs +0 -11
  171. package/lib/objDelete.d.cts +0 -15
  172. package/lib/objDelete.d.ts +0 -15
  173. package/lib/objDelete.js +0 -9
  174. package/lib/objGet.cjs +0 -10
  175. package/lib/objGet.d.cts +0 -6
  176. package/lib/objGet.d.ts +0 -6
  177. package/lib/objGet.js +0 -8
  178. package/lib/objGetOrDefault.cjs +0 -16
  179. package/lib/objGetOrDefault.d.cts +0 -6
  180. package/lib/objGetOrDefault.d.ts +0 -6
  181. package/lib/objGetOrDefault.js +0 -13
  182. package/lib/objGetOrDefaultValue.cjs +0 -10
  183. package/lib/objGetOrDefaultValue.d.cts +0 -7
  184. package/lib/objGetOrDefaultValue.d.ts +0 -7
  185. package/lib/objGetOrDefaultValue.js +0 -8
  186. package/lib/objHas.cjs +0 -10
  187. package/lib/objHas.d.cts +0 -17
  188. package/lib/objHas.d.ts +0 -17
  189. package/lib/objHas.js +0 -8
  190. package/lib/objOmitKeysMutable.cjs +0 -16
  191. package/lib/objOmitKeysMutable.d.cts +0 -17
  192. package/lib/objOmitKeysMutable.d.ts +0 -17
  193. package/lib/objOmitKeysMutable.js +0 -14
  194. package/lib/objPropertyValueToGetter.cjs +0 -24
  195. package/lib/objPropertyValueToGetter.d.cts +0 -23
  196. package/lib/objPropertyValueToGetter.d.ts +0 -23
  197. package/lib/objPropertyValueToGetter.js +0 -22
  198. package/lib/objSet.cjs +0 -10
  199. package/lib/objSet.d.cts +0 -6
  200. package/lib/objSet.d.ts +0 -6
  201. package/lib/objSet.js +0 -8
  202. package/lib/objSize.cjs +0 -10
  203. package/lib/objSize.d.cts +0 -6
  204. package/lib/objSize.d.ts +0 -6
  205. package/lib/objSize.js +0 -8
  206. package/lib/objSortKeys.cjs +0 -18
  207. package/lib/objSortKeys.d.cts +0 -8
  208. package/lib/objSortKeys.d.ts +0 -8
  209. package/lib/objSortKeys.js +0 -16
  210. package/lib/objToMap.cjs +0 -10
  211. package/lib/objToMap.d.cts +0 -8
  212. package/lib/objToMap.d.ts +0 -8
  213. package/lib/objToMap.js +0 -8
  214. package/lib/objUpdate.cjs +0 -10
  215. package/lib/objUpdate.d.cts +0 -8
  216. package/lib/objUpdate.d.ts +0 -8
  217. package/lib/objUpdate.js +0 -8
  218. package/lib/objUpdatePropertyDescriptors.cjs +0 -16
  219. package/lib/objUpdatePropertyDescriptors.d.cts +0 -17
  220. package/lib/objUpdatePropertyDescriptors.d.ts +0 -17
  221. package/lib/objUpdatePropertyDescriptors.js +0 -14
  222. package/lib/propertyIsEnumerable.cjs +0 -10
  223. package/lib/propertyIsEnumerable.d.cts +0 -6
  224. package/lib/propertyIsEnumerable.d.ts +0 -6
  225. package/lib/propertyIsEnumerable.js +0 -8
  226. package/lib/setEnumerable.cjs +0 -15
  227. package/lib/setEnumerable.d.cts +0 -6
  228. package/lib/setEnumerable.d.ts +0 -6
  229. package/lib/setEnumerable.js +0 -13
  230. package/lib/setNonConfigurable.cjs +0 -15
  231. package/lib/setNonConfigurable.d.cts +0 -6
  232. package/lib/setNonConfigurable.d.ts +0 -6
  233. package/lib/setNonConfigurable.js +0 -13
  234. package/lib/setNonEnumerable.cjs +0 -15
  235. package/lib/setNonEnumerable.d.cts +0 -6
  236. package/lib/setNonEnumerable.d.ts +0 -6
  237. package/lib/setNonEnumerable.js +0 -13
  238. package/lib/setNonWritable.cjs +0 -15
  239. package/lib/setNonWritable.d.cts +0 -6
  240. package/lib/setNonWritable.d.ts +0 -6
  241. package/lib/setNonWritable.js +0 -13
  242. package/lib/setWritable.cjs +0 -15
  243. package/lib/setWritable.d.cts +0 -6
  244. package/lib/setWritable.d.ts +0 -6
  245. package/lib/setWritable.js +0 -13
  246. package/lib/sortKeys.cjs +0 -14
  247. package/lib/sortKeys.d.cts +0 -6
  248. package/lib/sortKeys.d.ts +0 -6
  249. package/lib/sortKeys.js +0 -12
  250. package/lib/sortKeysLike.cjs +0 -14
  251. package/lib/sortKeysLike.d.cts +0 -6
  252. package/lib/sortKeysLike.d.ts +0 -6
  253. package/lib/sortKeysLike.js +0 -12
  254. package/lib/staticClassKeysOf.cjs +0 -18
  255. package/lib/staticClassKeysOf.d.cts +0 -15
  256. package/lib/staticClassKeysOf.d.ts +0 -15
  257. package/lib/staticClassKeysOf.js +0 -16
  258. package/lib/valuesOf.cjs +0 -10
  259. package/lib/valuesOf.d.cts +0 -8
  260. package/lib/valuesOf.d.ts +0 -8
  261. package/lib/valuesOf.js +0 -8
@@ -1,17 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function isValueDescriptor(des) {
4
- if (!des) {
5
- return false;
6
- }
7
- if (des.get) {
8
- return false;
9
- }
10
- if (des.set) {
11
- return false;
12
- }
13
- return true;
14
- }
15
- __name(isValueDescriptor, "isValueDescriptor");
16
-
17
- export { isValueDescriptor };
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function iterableFirstElement(iterable) {
6
- return iterable[Symbol.iterator]().next().value;
7
- }
8
- __name(iterableFirstElement, "iterableFirstElement");
9
-
10
- exports.iterableFirstElement = iterableFirstElement;
@@ -1,13 +0,0 @@
1
- /**
2
- * Returns the first element of an iterable object.
3
- * @template T - The type of elements in the iterable.
4
- * @param iterable The iterable object.
5
- * @returns The first element of the iterable object, or `undefined` if the iterable is empty.
6
- * @example ```ts
7
- * iterableFirstElement([1, 2, 3, 4, 5]);
8
- * //=> 1
9
- * ```
10
- */
11
- declare function iterableFirstElement<T>(iterable: Iterable<T>): T | undefined;
12
-
13
- export { iterableFirstElement };
@@ -1,13 +0,0 @@
1
- /**
2
- * Returns the first element of an iterable object.
3
- * @template T - The type of elements in the iterable.
4
- * @param iterable The iterable object.
5
- * @returns The first element of the iterable object, or `undefined` if the iterable is empty.
6
- * @example ```ts
7
- * iterableFirstElement([1, 2, 3, 4, 5]);
8
- * //=> 1
9
- * ```
10
- */
11
- declare function iterableFirstElement<T>(iterable: Iterable<T>): T | undefined;
12
-
13
- export { iterableFirstElement };
@@ -1,8 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function iterableFirstElement(iterable) {
4
- return iterable[Symbol.iterator]().next().value;
5
- }
6
- __name(iterableFirstElement, "iterableFirstElement");
7
-
8
- export { iterableFirstElement };
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function* iterateObject(root) {
6
- const seen = /* @__PURE__ */ new WeakSet();
7
- const stack = [
8
- {
9
- value: root,
10
- propertyPathArray: [],
11
- object: {}
12
- }
13
- ];
14
- while (stack.length > 0) {
15
- const { value: current, propertyPathArray, object } = stack.pop();
16
- if (typeof current === "object" && current !== null) {
17
- if (seen.has(current)) {
18
- continue;
19
- }
20
- seen.add(current);
21
- if (propertyPathArray.length > 0) {
22
- yield {
23
- object,
24
- key: propertyPathArray[propertyPathArray.length - 1],
25
- value: current,
26
- root,
27
- propertyPathArray,
28
- propertyPath: propertyPathArray.map((s) => {
29
- return typeof s === "string" ? s : `[${s}]`;
30
- }).join(".").replaceAll(".[", "["),
31
- isLeaf: false,
32
- nodeType: Array.isArray(current) ? "array" : "object"
33
- };
34
- }
35
- if (Array.isArray(current)) {
36
- for (let i = current.length - 1; i >= 0; i--) {
37
- stack.push({
38
- value: current[i],
39
- propertyPathArray: propertyPathArray.concat(i),
40
- object: current
41
- });
42
- }
43
- } else {
44
- const entries = Object.entries(current);
45
- for (let i = entries.length - 1; i >= 0; i--) {
46
- const [key, value] = entries[i];
47
- stack.push({
48
- value,
49
- propertyPathArray: propertyPathArray.concat(key),
50
- object: current
51
- });
52
- }
53
- }
54
- } else {
55
- yield {
56
- object,
57
- value: current,
58
- key: propertyPathArray[propertyPathArray.length - 1],
59
- root,
60
- propertyPathArray,
61
- propertyPath: propertyPathArray.map((s) => {
62
- return typeof s === "string" ? s : `[${s}]`;
63
- }).join(".").replaceAll(".[", "["),
64
- isLeaf: true,
65
- nodeType: "object"
66
- };
67
- }
68
- }
69
- }
70
- __name(iterateObject, "iterateObject");
71
-
72
- exports.iterateObject = iterateObject;
@@ -1,36 +0,0 @@
1
- /**
2
- * Interface describing the data yielded by iterateObject for each node in the traversal
3
- */
4
- interface IterateObjectYield<T extends object = object, V = unknown> {
5
- /** The parent object containing the current value */
6
- object: object;
7
- /** The key or index of the current value in its parent object */
8
- key: string | number;
9
- /** The value at the current node */
10
- value: V;
11
- /** Array representation of the path to the current node */
12
- propertyPathArray: (string | number)[];
13
- /** Lodash-style property path string (e.g., 'a.b[0].c') */
14
- propertyPath: string | number | symbol | readonly (string | number | symbol)[];
15
- /** Whether this node is a primitive value */
16
- isLeaf: boolean;
17
- /** The type of container at this node */
18
- nodeType: 'object' | 'array';
19
- /** Reference to the root object being traversed */
20
- root: T;
21
- }
22
- /**
23
- * Generator that performs a depth-first traversal of an object's structure.
24
- * Yields information about each node including its path, value, and container type.
25
- * Handles circular references and maintains parent-child relationships.
26
- *
27
- * Key features:
28
- * - Supports both objects and arrays
29
- * - Generates Lodash-style property paths
30
- * - Detects leaf nodes (primitives)
31
- * - Prevents circular reference loops
32
- * - Preserves traversal order
33
- */
34
- declare function iterateObject<T extends object = object, V = unknown>(root: T): Generator<IterateObjectYield<T, V>>;
35
-
36
- export { type IterateObjectYield, iterateObject };
@@ -1,36 +0,0 @@
1
- /**
2
- * Interface describing the data yielded by iterateObject for each node in the traversal
3
- */
4
- interface IterateObjectYield<T extends object = object, V = unknown> {
5
- /** The parent object containing the current value */
6
- object: object;
7
- /** The key or index of the current value in its parent object */
8
- key: string | number;
9
- /** The value at the current node */
10
- value: V;
11
- /** Array representation of the path to the current node */
12
- propertyPathArray: (string | number)[];
13
- /** Lodash-style property path string (e.g., 'a.b[0].c') */
14
- propertyPath: string | number | symbol | readonly (string | number | symbol)[];
15
- /** Whether this node is a primitive value */
16
- isLeaf: boolean;
17
- /** The type of container at this node */
18
- nodeType: 'object' | 'array';
19
- /** Reference to the root object being traversed */
20
- root: T;
21
- }
22
- /**
23
- * Generator that performs a depth-first traversal of an object's structure.
24
- * Yields information about each node including its path, value, and container type.
25
- * Handles circular references and maintains parent-child relationships.
26
- *
27
- * Key features:
28
- * - Supports both objects and arrays
29
- * - Generates Lodash-style property paths
30
- * - Detects leaf nodes (primitives)
31
- * - Prevents circular reference loops
32
- * - Preserves traversal order
33
- */
34
- declare function iterateObject<T extends object = object, V = unknown>(root: T): Generator<IterateObjectYield<T, V>>;
35
-
36
- export { type IterateObjectYield, iterateObject };
@@ -1,70 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function* iterateObject(root) {
4
- const seen = /* @__PURE__ */ new WeakSet();
5
- const stack = [
6
- {
7
- value: root,
8
- propertyPathArray: [],
9
- object: {}
10
- }
11
- ];
12
- while (stack.length > 0) {
13
- const { value: current, propertyPathArray, object } = stack.pop();
14
- if (typeof current === "object" && current !== null) {
15
- if (seen.has(current)) {
16
- continue;
17
- }
18
- seen.add(current);
19
- if (propertyPathArray.length > 0) {
20
- yield {
21
- object,
22
- key: propertyPathArray[propertyPathArray.length - 1],
23
- value: current,
24
- root,
25
- propertyPathArray,
26
- propertyPath: propertyPathArray.map((s) => {
27
- return typeof s === "string" ? s : `[${s}]`;
28
- }).join(".").replaceAll(".[", "["),
29
- isLeaf: false,
30
- nodeType: Array.isArray(current) ? "array" : "object"
31
- };
32
- }
33
- if (Array.isArray(current)) {
34
- for (let i = current.length - 1; i >= 0; i--) {
35
- stack.push({
36
- value: current[i],
37
- propertyPathArray: propertyPathArray.concat(i),
38
- object: current
39
- });
40
- }
41
- } else {
42
- const entries = Object.entries(current);
43
- for (let i = entries.length - 1; i >= 0; i--) {
44
- const [key, value] = entries[i];
45
- stack.push({
46
- value,
47
- propertyPathArray: propertyPathArray.concat(key),
48
- object: current
49
- });
50
- }
51
- }
52
- } else {
53
- yield {
54
- object,
55
- value: current,
56
- key: propertyPathArray[propertyPathArray.length - 1],
57
- root,
58
- propertyPathArray,
59
- propertyPath: propertyPathArray.map((s) => {
60
- return typeof s === "string" ? s : `[${s}]`;
61
- }).join(".").replaceAll(".[", "["),
62
- isLeaf: true,
63
- nodeType: "object"
64
- };
65
- }
66
- }
67
- }
68
- __name(iterateObject, "iterateObject");
69
-
70
- export { iterateObject };
package/lib/keysOf.cjs DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function keysOf(obj) {
6
- return Object.keys(obj);
7
- }
8
- __name(keysOf, "keysOf");
9
-
10
- exports.keysOf = keysOf;
package/lib/keysOf.d.cts DELETED
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.cjs';
2
-
3
- /**
4
- * Same as Object.keys except the keys are typed as string keys of T.
5
- */
6
- declare function keysOf<T extends object>(obj: T): StringKeyOf<T>[];
7
-
8
- export { keysOf };
package/lib/keysOf.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.js';
2
-
3
- /**
4
- * Same as Object.keys except the keys are typed as string keys of T.
5
- */
6
- declare function keysOf<T extends object>(obj: T): StringKeyOf<T>[];
7
-
8
- export { keysOf };
package/lib/keysOf.js DELETED
@@ -1,8 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function keysOf(obj) {
4
- return Object.keys(obj);
5
- }
6
- __name(keysOf, "keysOf");
7
-
8
- export { keysOf };
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var entriesOf = require('./entriesOf');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapObjectEntries(obj, fn) {
8
- const accum = {};
9
- for (const [key, value] of entriesOf.entriesOf(obj)) {
10
- const [newKey, newValue] = fn(key, value);
11
- accum[newKey] = newValue;
12
- }
13
- return accum;
14
- }
15
- __name(mapObjectEntries, "mapObjectEntries");
16
-
17
- exports.mapObjectEntries = mapObjectEntries;
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.cjs';
2
-
3
- /**
4
- * Maps over an object's entries, transforming both keys and values using the provided function.
5
- */
6
- declare function mapObjectEntries<T extends object, K extends PropertyKey, V>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => [K, V]): Record<K, V>;
7
-
8
- export { mapObjectEntries };
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.js';
2
-
3
- /**
4
- * Maps over an object's entries, transforming both keys and values using the provided function.
5
- */
6
- declare function mapObjectEntries<T extends object, K extends PropertyKey, V>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => [K, V]): Record<K, V>;
7
-
8
- export { mapObjectEntries };
@@ -1,14 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
- import { entriesOf } from './entriesOf';
3
-
4
- function mapObjectEntries(obj, fn) {
5
- const accum = {};
6
- for (const [key, value] of entriesOf(obj)) {
7
- const [newKey, newValue] = fn(key, value);
8
- accum[newKey] = newValue;
9
- }
10
- return accum;
11
- }
12
- __name(mapObjectEntries, "mapObjectEntries");
13
-
14
- export { mapObjectEntries };
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var entriesOf = require('./entriesOf');
4
-
5
- var __defProp = Object.defineProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- function mapObjectKeys(obj, fn) {
8
- const accum = {};
9
- for (const [key, value] of entriesOf.entriesOf(obj)) {
10
- accum[fn(key, value)] = value;
11
- }
12
- return accum;
13
- }
14
- __name(mapObjectKeys, "mapObjectKeys");
15
-
16
- exports.mapObjectKeys = mapObjectKeys;
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.cjs';
2
-
3
- /**
4
- * Maps over an object's keys, transforming each key using the provided function while preserving values.
5
- */
6
- declare function mapObjectKeys<T extends object, K extends PropertyKey>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => K): Record<K, T[StringKeyOf<T>]>;
7
-
8
- export { mapObjectKeys };
@@ -1,8 +0,0 @@
1
- import { S as StringKeyOf } from './StringKeyOf-9CGLwjJv.js';
2
-
3
- /**
4
- * Maps over an object's keys, transforming each key using the provided function while preserving values.
5
- */
6
- declare function mapObjectKeys<T extends object, K extends PropertyKey>(obj: T, fn: (key: StringKeyOf<T>, value: T[StringKeyOf<T>]) => K): Record<K, T[StringKeyOf<T>]>;
7
-
8
- export { mapObjectKeys };
@@ -1,13 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
- import { entriesOf } from './entriesOf';
3
-
4
- function mapObjectKeys(obj, fn) {
5
- const accum = {};
6
- for (const [key, value] of entriesOf(obj)) {
7
- accum[fn(key, value)] = value;
8
- }
9
- return accum;
10
- }
11
- __name(mapObjectKeys, "mapObjectKeys");
12
-
13
- export { mapObjectKeys };
package/lib/objAssign.cjs DELETED
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- var createObjectMerger = require('./createObjectMerger');
4
-
5
- const objAssign = createObjectMerger.createObjectMerger((value) => {
6
- return value != null;
7
- });
8
-
9
- exports.objAssign = objAssign;
@@ -1,8 +0,0 @@
1
- import { A as Any } from './Any-ChepAe8v.cjs';
2
-
3
- /**
4
- * Like Object.assign, but only copies source object property values != null.
5
- */
6
- declare const objAssign: (target: Record<string, Any>, ...sources: Record<string, Any>[]) => Record<string, any>;
7
-
8
- export { objAssign };
@@ -1,8 +0,0 @@
1
- import { A as Any } from './Any-ChepAe8v.js';
2
-
3
- /**
4
- * Like Object.assign, but only copies source object property values != null.
5
- */
6
- declare const objAssign: (target: Record<string, Any>, ...sources: Record<string, Any>[]) => Record<string, any>;
7
-
8
- export { objAssign };
package/lib/objAssign.js DELETED
@@ -1,8 +0,0 @@
1
- import './chunk-SHUYVCID.js';
2
- import { createObjectMerger } from './createObjectMerger';
3
-
4
- const objAssign = createObjectMerger((value) => {
5
- return value != null;
6
- });
7
-
8
- export { objAssign };
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function objDeepFreeze(o) {
6
- for (const key of Reflect.ownKeys(o)) {
7
- const value = o[key];
8
- if (value && typeof value === "object" || typeof value === "function") {
9
- objDeepFreeze(value);
10
- }
11
- }
12
- return Object.freeze(o);
13
- }
14
- __name(objDeepFreeze, "objDeepFreeze");
15
-
16
- exports.objDeepFreeze = objDeepFreeze;
@@ -1,10 +0,0 @@
1
- import { A as Any } from './Any-ChepAe8v.cjs';
2
-
3
- /**
4
- * Deep freezes an object.
5
- *
6
- * Note: Deep recursion may cause stack overflow for very deeply nested objects.
7
- */
8
- declare function objDeepFreeze(o: Record<PropertyKey, Any>): Record<PropertyKey, Any>;
9
-
10
- export { objDeepFreeze };
@@ -1,10 +0,0 @@
1
- import { A as Any } from './Any-ChepAe8v.js';
2
-
3
- /**
4
- * Deep freezes an object.
5
- *
6
- * Note: Deep recursion may cause stack overflow for very deeply nested objects.
7
- */
8
- declare function objDeepFreeze(o: Record<PropertyKey, Any>): Record<PropertyKey, Any>;
9
-
10
- export { objDeepFreeze };
@@ -1,14 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function objDeepFreeze(o) {
4
- for (const key of Reflect.ownKeys(o)) {
5
- const value = o[key];
6
- if (value && typeof value === "object" || typeof value === "function") {
7
- objDeepFreeze(value);
8
- }
9
- }
10
- return Object.freeze(o);
11
- }
12
- __name(objDeepFreeze, "objDeepFreeze");
13
-
14
- export { objDeepFreeze };
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function objDefineLazyProperty(object, key, getValue) {
6
- const set = /* @__PURE__ */ __name((value) => {
7
- return Object.defineProperty(object, key, {
8
- value,
9
- enumerable: true,
10
- writable: true
11
- });
12
- }, "set");
13
- Object.defineProperty(object, key, {
14
- configurable: true,
15
- enumerable: true,
16
- get() {
17
- const result = getValue();
18
- set(result);
19
- return result;
20
- },
21
- set(value) {
22
- set(value);
23
- }
24
- });
25
- return object;
26
- }
27
- __name(objDefineLazyProperty, "objDefineLazyProperty");
28
-
29
- exports.objDefineLazyProperty = objDefineLazyProperty;
@@ -1,13 +0,0 @@
1
- /**
2
- * Defines a lazy property on an object. The property will be lazily evaluated on the first access and then cached for subsequent accesses.
3
- * The property is both enumerable and configurable.
4
- *
5
- * @typeParam T - The type of the object on which the property will be defined. Must be a record with string keys.
6
- * @param object - The object on which to define the property.
7
- * @param key - The key of the property to define.
8
- * @param getValue - A function that returns the value of the property. This function will be called the first time the property is accessed.
9
- * @returns The original object with the newly defined property.
10
- */
11
- declare function objDefineLazyProperty<T extends Record<string, unknown>>(object: T, key: string, getValue: (...args: unknown[]) => unknown): T;
12
-
13
- export { objDefineLazyProperty };
@@ -1,13 +0,0 @@
1
- /**
2
- * Defines a lazy property on an object. The property will be lazily evaluated on the first access and then cached for subsequent accesses.
3
- * The property is both enumerable and configurable.
4
- *
5
- * @typeParam T - The type of the object on which the property will be defined. Must be a record with string keys.
6
- * @param object - The object on which to define the property.
7
- * @param key - The key of the property to define.
8
- * @param getValue - A function that returns the value of the property. This function will be called the first time the property is accessed.
9
- * @returns The original object with the newly defined property.
10
- */
11
- declare function objDefineLazyProperty<T extends Record<string, unknown>>(object: T, key: string, getValue: (...args: unknown[]) => unknown): T;
12
-
13
- export { objDefineLazyProperty };
@@ -1,27 +0,0 @@
1
- import { __name } from './chunk-SHUYVCID.js';
2
-
3
- function objDefineLazyProperty(object, key, getValue) {
4
- const set = /* @__PURE__ */ __name((value) => {
5
- return Object.defineProperty(object, key, {
6
- value,
7
- enumerable: true,
8
- writable: true
9
- });
10
- }, "set");
11
- Object.defineProperty(object, key, {
12
- configurable: true,
13
- enumerable: true,
14
- get() {
15
- const result = getValue();
16
- set(result);
17
- return result;
18
- },
19
- set(value) {
20
- set(value);
21
- }
22
- });
23
- return object;
24
- }
25
- __name(objDefineLazyProperty, "objDefineLazyProperty");
26
-
27
- export { objDefineLazyProperty };
package/lib/objDelete.cjs DELETED
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- function objDelete(obj, key) {
6
- delete obj[key];
7
- return obj;
8
- }
9
- __name(objDelete, "objDelete");
10
-
11
- exports.objDelete = objDelete;
@@ -1,15 +0,0 @@
1
- /**
2
- * Deletes a property from an object and returns the modified object.
3
- * @param obj The object from which to delete the property.
4
- * @template K - The type of the keys in the object.
5
- * @returns The modified object with the key deleted.
6
- * @param key The key of the property to delete.
7
- * @example ```ts
8
- * const obj = { name: 'John', age: 30 };
9
- * objDelete(obj, 'age');
10
- * //=> { name: 'John' }
11
- * ```
12
- */
13
- declare function objDelete<K extends PropertyKey, V>(obj: Record<K, V>, key: K): Omit<Record<K, V>, K>;
14
-
15
- export { objDelete };
@@ -1,15 +0,0 @@
1
- /**
2
- * Deletes a property from an object and returns the modified object.
3
- * @param obj The object from which to delete the property.
4
- * @template K - The type of the keys in the object.
5
- * @returns The modified object with the key deleted.
6
- * @param key The key of the property to delete.
7
- * @example ```ts
8
- * const obj = { name: 'John', age: 30 };
9
- * objDelete(obj, 'age');
10
- * //=> { name: 'John' }
11
- * ```
12
- */
13
- declare function objDelete<K extends PropertyKey, V>(obj: Record<K, V>, key: K): Omit<Record<K, V>, K>;
14
-
15
- export { objDelete };