@bemoje/object 2.2.1 → 2.2.3

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 (260) hide show
  1. package/README.md +74 -55
  2. package/lib/index.d.cts +548 -69
  3. package/lib/index.d.ts +548 -69
  4. package/package.json +18 -904
  5. package/lib/arrAssign.cjs +0 -26
  6. package/lib/arrAssign.d.cts +0 -6
  7. package/lib/arrAssign.d.ts +0 -6
  8. package/lib/arrAssign.js +0 -24
  9. package/lib/className.cjs +0 -12
  10. package/lib/className.d.cts +0 -6
  11. package/lib/className.d.ts +0 -6
  12. package/lib/className.js +0 -10
  13. package/lib/constructorOf.cjs +0 -12
  14. package/lib/constructorOf.d.cts +0 -6
  15. package/lib/constructorOf.d.ts +0 -6
  16. package/lib/constructorOf.js +0 -10
  17. package/lib/createArrayMerger.cjs +0 -21
  18. package/lib/createArrayMerger.d.cts +0 -6
  19. package/lib/createArrayMerger.d.ts +0 -6
  20. package/lib/createArrayMerger.js +0 -19
  21. package/lib/createObjectMerger.cjs +0 -21
  22. package/lib/createObjectMerger.d.cts +0 -8
  23. package/lib/createObjectMerger.d.ts +0 -8
  24. package/lib/createObjectMerger.js +0 -19
  25. package/lib/defineAccessors.cjs +0 -16
  26. package/lib/defineAccessors.d.cts +0 -9
  27. package/lib/defineAccessors.d.ts +0 -9
  28. package/lib/defineAccessors.js +0 -14
  29. package/lib/defineGetter.cjs +0 -17
  30. package/lib/defineGetter.d.cts +0 -8
  31. package/lib/defineGetter.d.ts +0 -8
  32. package/lib/defineGetter.js +0 -15
  33. package/lib/defineLazyProperty.cjs +0 -40
  34. package/lib/defineLazyProperty.d.cts +0 -8
  35. package/lib/defineLazyProperty.d.ts +0 -8
  36. package/lib/defineLazyProperty.js +0 -38
  37. package/lib/defineMethod.cjs +0 -18
  38. package/lib/defineMethod.d.cts +0 -9
  39. package/lib/defineMethod.d.ts +0 -9
  40. package/lib/defineMethod.js +0 -16
  41. package/lib/defineProperty.cjs +0 -15
  42. package/lib/defineProperty.d.cts +0 -10
  43. package/lib/defineProperty.d.ts +0 -10
  44. package/lib/defineProperty.js +0 -13
  45. package/lib/defineSetter.cjs +0 -17
  46. package/lib/defineSetter.d.cts +0 -8
  47. package/lib/defineSetter.d.ts +0 -8
  48. package/lib/defineSetter.js +0 -15
  49. package/lib/defineValue.cjs +0 -17
  50. package/lib/defineValue.d.cts +0 -9
  51. package/lib/defineValue.d.ts +0 -9
  52. package/lib/defineValue.js +0 -15
  53. package/lib/deleteNullishPropsMutable.cjs +0 -17
  54. package/lib/deleteNullishPropsMutable.d.cts +0 -6
  55. package/lib/deleteNullishPropsMutable.d.ts +0 -6
  56. package/lib/deleteNullishPropsMutable.js +0 -15
  57. package/lib/entriesOf.cjs +0 -12
  58. package/lib/entriesOf.d.cts +0 -8
  59. package/lib/entriesOf.d.ts +0 -8
  60. package/lib/entriesOf.js +0 -10
  61. package/lib/filterObject.cjs +0 -24
  62. package/lib/filterObject.d.cts +0 -9
  63. package/lib/filterObject.d.ts +0 -9
  64. package/lib/filterObject.js +0 -22
  65. package/lib/filterObjectMutable.cjs +0 -18
  66. package/lib/filterObjectMutable.d.cts +0 -8
  67. package/lib/filterObjectMutable.d.ts +0 -8
  68. package/lib/filterObjectMutable.js +0 -16
  69. package/lib/getClassChain.cjs +0 -25
  70. package/lib/getClassChain.d.cts +0 -14
  71. package/lib/getClassChain.d.ts +0 -14
  72. package/lib/getClassChain.js +0 -23
  73. package/lib/getConfigurableMethodOrGetterKeys.cjs +0 -24
  74. package/lib/getConfigurableMethodOrGetterKeys.d.cts +0 -10
  75. package/lib/getConfigurableMethodOrGetterKeys.d.ts +0 -10
  76. package/lib/getConfigurableMethodOrGetterKeys.js +0 -22
  77. package/lib/getKeys.cjs +0 -102
  78. package/lib/getKeys.d.cts +0 -19
  79. package/lib/getKeys.d.ts +0 -19
  80. package/lib/getKeys.js +0 -100
  81. package/lib/getKeysPreset.cjs +0 -95
  82. package/lib/getKeysPreset.d.cts +0 -46
  83. package/lib/getKeysPreset.d.ts +0 -46
  84. package/lib/getKeysPreset.js +0 -93
  85. package/lib/getOwnProperty.cjs +0 -12
  86. package/lib/getOwnProperty.d.cts +0 -6
  87. package/lib/getOwnProperty.d.ts +0 -6
  88. package/lib/getOwnProperty.js +0 -10
  89. package/lib/getPrototypeChain.cjs +0 -20
  90. package/lib/getPrototypeChain.d.cts +0 -9
  91. package/lib/getPrototypeChain.d.ts +0 -9
  92. package/lib/getPrototypeChain.js +0 -18
  93. package/lib/getSuperClass.cjs +0 -34
  94. package/lib/getSuperClass.d.cts +0 -11
  95. package/lib/getSuperClass.d.ts +0 -11
  96. package/lib/getSuperClass.js +0 -32
  97. package/lib/getSuperClasses.cjs +0 -33
  98. package/lib/getSuperClasses.d.cts +0 -13
  99. package/lib/getSuperClasses.d.ts +0 -13
  100. package/lib/getSuperClasses.js +0 -31
  101. package/lib/hasOwnProperty.cjs +0 -12
  102. package/lib/hasOwnProperty.d.cts +0 -6
  103. package/lib/hasOwnProperty.d.ts +0 -6
  104. package/lib/hasOwnProperty.js +0 -10
  105. package/lib/hasProperty.cjs +0 -45
  106. package/lib/hasProperty.d.cts +0 -6
  107. package/lib/hasProperty.d.ts +0 -6
  108. package/lib/hasProperty.js +0 -43
  109. package/lib/hasPrototypeChainProperty.cjs +0 -39
  110. package/lib/hasPrototypeChainProperty.d.cts +0 -7
  111. package/lib/hasPrototypeChainProperty.d.ts +0 -7
  112. package/lib/hasPrototypeChainProperty.js +0 -37
  113. package/lib/inheritPrototypeMembers.cjs +0 -24
  114. package/lib/inheritPrototypeMembers.d.cts +0 -8
  115. package/lib/inheritPrototypeMembers.d.ts +0 -8
  116. package/lib/inheritPrototypeMembers.js +0 -22
  117. package/lib/inheritStaticMembers.cjs +0 -25
  118. package/lib/inheritStaticMembers.d.cts +0 -8
  119. package/lib/inheritStaticMembers.d.ts +0 -8
  120. package/lib/inheritStaticMembers.js +0 -23
  121. package/lib/isAccessorDescriptor.cjs +0 -21
  122. package/lib/isAccessorDescriptor.d.cts +0 -19
  123. package/lib/isAccessorDescriptor.d.ts +0 -19
  124. package/lib/isAccessorDescriptor.js +0 -19
  125. package/lib/isEnumerable.cjs +0 -12
  126. package/lib/isEnumerable.d.cts +0 -6
  127. package/lib/isEnumerable.d.ts +0 -6
  128. package/lib/isEnumerable.js +0 -10
  129. package/lib/isMethodValueDescriptor.cjs +0 -12
  130. package/lib/isMethodValueDescriptor.d.cts +0 -10
  131. package/lib/isMethodValueDescriptor.d.ts +0 -10
  132. package/lib/isMethodValueDescriptor.js +0 -10
  133. package/lib/isValueDescriptor.cjs +0 -21
  134. package/lib/isValueDescriptor.d.cts +0 -15
  135. package/lib/isValueDescriptor.d.ts +0 -15
  136. package/lib/isValueDescriptor.js +0 -19
  137. package/lib/iterableFirstElement.cjs +0 -12
  138. package/lib/iterableFirstElement.d.cts +0 -13
  139. package/lib/iterableFirstElement.d.ts +0 -13
  140. package/lib/iterableFirstElement.js +0 -10
  141. package/lib/iterateObject.cjs +0 -74
  142. package/lib/iterateObject.d.cts +0 -36
  143. package/lib/iterateObject.d.ts +0 -36
  144. package/lib/iterateObject.js +0 -72
  145. package/lib/keysOf.cjs +0 -12
  146. package/lib/keysOf.d.cts +0 -8
  147. package/lib/keysOf.d.ts +0 -8
  148. package/lib/keysOf.js +0 -10
  149. package/lib/mapObjectEntries.cjs +0 -23
  150. package/lib/mapObjectEntries.d.cts +0 -8
  151. package/lib/mapObjectEntries.d.ts +0 -8
  152. package/lib/mapObjectEntries.js +0 -21
  153. package/lib/mapObjectKeys.cjs +0 -22
  154. package/lib/mapObjectKeys.d.cts +0 -8
  155. package/lib/mapObjectKeys.d.ts +0 -8
  156. package/lib/mapObjectKeys.js +0 -20
  157. package/lib/objAssign.cjs +0 -26
  158. package/lib/objAssign.d.cts +0 -8
  159. package/lib/objAssign.d.ts +0 -8
  160. package/lib/objAssign.js +0 -24
  161. package/lib/objDeepFreeze.cjs +0 -18
  162. package/lib/objDeepFreeze.d.cts +0 -10
  163. package/lib/objDeepFreeze.d.ts +0 -10
  164. package/lib/objDeepFreeze.js +0 -16
  165. package/lib/objDefineLazyProperty.cjs +0 -31
  166. package/lib/objDefineLazyProperty.d.cts +0 -13
  167. package/lib/objDefineLazyProperty.d.ts +0 -13
  168. package/lib/objDefineLazyProperty.js +0 -29
  169. package/lib/objDelete.cjs +0 -13
  170. package/lib/objDelete.d.cts +0 -15
  171. package/lib/objDelete.d.ts +0 -15
  172. package/lib/objDelete.js +0 -11
  173. package/lib/objGet.cjs +0 -12
  174. package/lib/objGet.d.cts +0 -6
  175. package/lib/objGet.d.ts +0 -6
  176. package/lib/objGet.js +0 -10
  177. package/lib/objGetOrDefault.cjs +0 -22
  178. package/lib/objGetOrDefault.d.cts +0 -6
  179. package/lib/objGetOrDefault.d.ts +0 -6
  180. package/lib/objGetOrDefault.js +0 -20
  181. package/lib/objGetOrDefaultValue.cjs +0 -12
  182. package/lib/objGetOrDefaultValue.d.cts +0 -7
  183. package/lib/objGetOrDefaultValue.d.ts +0 -7
  184. package/lib/objGetOrDefaultValue.js +0 -10
  185. package/lib/objHas.cjs +0 -12
  186. package/lib/objHas.d.cts +0 -17
  187. package/lib/objHas.d.ts +0 -17
  188. package/lib/objHas.js +0 -10
  189. package/lib/objOmitKeysMutable.cjs +0 -18
  190. package/lib/objOmitKeysMutable.d.cts +0 -17
  191. package/lib/objOmitKeysMutable.d.ts +0 -17
  192. package/lib/objOmitKeysMutable.js +0 -16
  193. package/lib/objPropertyValueToGetter.cjs +0 -26
  194. package/lib/objPropertyValueToGetter.d.cts +0 -23
  195. package/lib/objPropertyValueToGetter.d.ts +0 -23
  196. package/lib/objPropertyValueToGetter.js +0 -24
  197. package/lib/objSet.cjs +0 -12
  198. package/lib/objSet.d.cts +0 -6
  199. package/lib/objSet.d.ts +0 -6
  200. package/lib/objSet.js +0 -10
  201. package/lib/objSize.cjs +0 -12
  202. package/lib/objSize.d.cts +0 -6
  203. package/lib/objSize.d.ts +0 -6
  204. package/lib/objSize.js +0 -10
  205. package/lib/objSortKeys.cjs +0 -20
  206. package/lib/objSortKeys.d.cts +0 -8
  207. package/lib/objSortKeys.d.ts +0 -8
  208. package/lib/objSortKeys.js +0 -18
  209. package/lib/objToMap.cjs +0 -12
  210. package/lib/objToMap.d.cts +0 -8
  211. package/lib/objToMap.d.ts +0 -8
  212. package/lib/objToMap.js +0 -10
  213. package/lib/objUpdate.cjs +0 -12
  214. package/lib/objUpdate.d.cts +0 -8
  215. package/lib/objUpdate.d.ts +0 -8
  216. package/lib/objUpdate.js +0 -10
  217. package/lib/objUpdatePropertyDescriptors.cjs +0 -18
  218. package/lib/objUpdatePropertyDescriptors.d.cts +0 -17
  219. package/lib/objUpdatePropertyDescriptors.d.ts +0 -17
  220. package/lib/objUpdatePropertyDescriptors.js +0 -16
  221. package/lib/propertyIsEnumerable.cjs +0 -12
  222. package/lib/propertyIsEnumerable.d.cts +0 -6
  223. package/lib/propertyIsEnumerable.d.ts +0 -6
  224. package/lib/propertyIsEnumerable.js +0 -10
  225. package/lib/setEnumerable.cjs +0 -17
  226. package/lib/setEnumerable.d.cts +0 -6
  227. package/lib/setEnumerable.d.ts +0 -6
  228. package/lib/setEnumerable.js +0 -15
  229. package/lib/setNonConfigurable.cjs +0 -17
  230. package/lib/setNonConfigurable.d.cts +0 -6
  231. package/lib/setNonConfigurable.d.ts +0 -6
  232. package/lib/setNonConfigurable.js +0 -15
  233. package/lib/setNonEnumerable.cjs +0 -17
  234. package/lib/setNonEnumerable.d.cts +0 -6
  235. package/lib/setNonEnumerable.d.ts +0 -6
  236. package/lib/setNonEnumerable.js +0 -15
  237. package/lib/setNonWritable.cjs +0 -17
  238. package/lib/setNonWritable.d.cts +0 -6
  239. package/lib/setNonWritable.d.ts +0 -6
  240. package/lib/setNonWritable.js +0 -15
  241. package/lib/setWritable.cjs +0 -17
  242. package/lib/setWritable.d.cts +0 -6
  243. package/lib/setWritable.d.ts +0 -6
  244. package/lib/setWritable.js +0 -15
  245. package/lib/sortKeys.cjs +0 -16
  246. package/lib/sortKeys.d.cts +0 -6
  247. package/lib/sortKeys.d.ts +0 -6
  248. package/lib/sortKeys.js +0 -14
  249. package/lib/sortKeysLike.cjs +0 -16
  250. package/lib/sortKeysLike.d.cts +0 -6
  251. package/lib/sortKeysLike.d.ts +0 -6
  252. package/lib/sortKeysLike.js +0 -14
  253. package/lib/staticClassKeysOf.cjs +0 -20
  254. package/lib/staticClassKeysOf.d.cts +0 -15
  255. package/lib/staticClassKeysOf.d.ts +0 -15
  256. package/lib/staticClassKeysOf.js +0 -18
  257. package/lib/valuesOf.cjs +0 -12
  258. package/lib/valuesOf.d.cts +0 -8
  259. package/lib/valuesOf.d.ts +0 -8
  260. package/lib/valuesOf.js +0 -10
@@ -1,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/iterableFirstElement.ts
5
- function iterableFirstElement(iterable) {
6
- return iterable[Symbol.iterator]().next().value;
7
- }
8
- __name(iterableFirstElement, "iterableFirstElement");
9
-
10
- export { iterableFirstElement };
@@ -1,74 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/iterateObject.ts
7
- function* iterateObject(root) {
8
- const seen = /* @__PURE__ */ new WeakSet();
9
- const stack = [
10
- {
11
- value: root,
12
- propertyPathArray: [],
13
- object: {}
14
- }
15
- ];
16
- while (stack.length > 0) {
17
- const { value: current, propertyPathArray, object } = stack.pop();
18
- if (typeof current === "object" && current !== null) {
19
- if (seen.has(current)) {
20
- continue;
21
- }
22
- seen.add(current);
23
- if (propertyPathArray.length > 0) {
24
- yield {
25
- object,
26
- key: propertyPathArray[propertyPathArray.length - 1],
27
- value: current,
28
- root,
29
- propertyPathArray,
30
- propertyPath: propertyPathArray.map((s) => {
31
- return typeof s === "string" ? s : `[${s}]`;
32
- }).join(".").replaceAll(".[", "["),
33
- isLeaf: false,
34
- nodeType: Array.isArray(current) ? "array" : "object"
35
- };
36
- }
37
- if (Array.isArray(current)) {
38
- for (let i = current.length - 1; i >= 0; i--) {
39
- stack.push({
40
- value: current[i],
41
- propertyPathArray: propertyPathArray.concat(i),
42
- object: current
43
- });
44
- }
45
- } else {
46
- const entries = Object.entries(current);
47
- for (let i = entries.length - 1; i >= 0; i--) {
48
- const [key, value] = entries[i];
49
- stack.push({
50
- value,
51
- propertyPathArray: propertyPathArray.concat(key),
52
- object: current
53
- });
54
- }
55
- }
56
- } else {
57
- yield {
58
- object,
59
- value: current,
60
- key: propertyPathArray[propertyPathArray.length - 1],
61
- root,
62
- propertyPathArray,
63
- propertyPath: propertyPathArray.map((s) => {
64
- return typeof s === "string" ? s : `[${s}]`;
65
- }).join(".").replaceAll(".[", "["),
66
- isLeaf: true,
67
- nodeType: "object"
68
- };
69
- }
70
- }
71
- }
72
- __name(iterateObject, "iterateObject");
73
-
74
- 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,72 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/iterateObject.ts
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
- export { iterateObject };
package/lib/keysOf.cjs DELETED
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/keysOf.ts
7
- function keysOf(obj) {
8
- return Object.keys(obj);
9
- }
10
- __name(keysOf, "keysOf");
11
-
12
- 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,10 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/keysOf.ts
5
- function keysOf(obj) {
6
- return Object.keys(obj);
7
- }
8
- __name(keysOf, "keysOf");
9
-
10
- export { keysOf };
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/entriesOf.ts
7
- function entriesOf(obj) {
8
- return Object.entries(obj);
9
- }
10
- __name(entriesOf, "entriesOf");
11
-
12
- // src/mapObjectEntries.ts
13
- function mapObjectEntries(obj, fn) {
14
- const accum = {};
15
- for (const [key, value] of entriesOf(obj)) {
16
- const [newKey, newValue] = fn(key, value);
17
- accum[newKey] = newValue;
18
- }
19
- return accum;
20
- }
21
- __name(mapObjectEntries, "mapObjectEntries");
22
-
23
- 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,21 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/entriesOf.ts
5
- function entriesOf(obj) {
6
- return Object.entries(obj);
7
- }
8
- __name(entriesOf, "entriesOf");
9
-
10
- // src/mapObjectEntries.ts
11
- function mapObjectEntries(obj, fn) {
12
- const accum = {};
13
- for (const [key, value] of entriesOf(obj)) {
14
- const [newKey, newValue] = fn(key, value);
15
- accum[newKey] = newValue;
16
- }
17
- return accum;
18
- }
19
- __name(mapObjectEntries, "mapObjectEntries");
20
-
21
- export { mapObjectEntries };
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/entriesOf.ts
7
- function entriesOf(obj) {
8
- return Object.entries(obj);
9
- }
10
- __name(entriesOf, "entriesOf");
11
-
12
- // src/mapObjectKeys.ts
13
- function mapObjectKeys(obj, fn) {
14
- const accum = {};
15
- for (const [key, value] of entriesOf(obj)) {
16
- accum[fn(key, value)] = value;
17
- }
18
- return accum;
19
- }
20
- __name(mapObjectKeys, "mapObjectKeys");
21
-
22
- 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,20 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/entriesOf.ts
5
- function entriesOf(obj) {
6
- return Object.entries(obj);
7
- }
8
- __name(entriesOf, "entriesOf");
9
-
10
- // src/mapObjectKeys.ts
11
- function mapObjectKeys(obj, fn) {
12
- const accum = {};
13
- for (const [key, value] of entriesOf(obj)) {
14
- accum[fn(key, value)] = value;
15
- }
16
- return accum;
17
- }
18
- __name(mapObjectKeys, "mapObjectKeys");
19
-
20
- export { mapObjectKeys };
package/lib/objAssign.cjs DELETED
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/createObjectMerger.ts
7
- function createObjectMerger(predicate) {
8
- return /* @__PURE__ */ __name(function objMerge(target, ...sources) {
9
- for (const src of sources) {
10
- for (const [key, value] of Object.entries(src)) {
11
- if (predicate(value, key, src)) {
12
- target[key] = value;
13
- }
14
- }
15
- }
16
- return target;
17
- }, "objMerge");
18
- }
19
- __name(createObjectMerger, "createObjectMerger");
20
-
21
- // src/objAssign.ts
22
- var objAssign = createObjectMerger((value) => {
23
- return value != null;
24
- });
25
-
26
- 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,24 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/createObjectMerger.ts
5
- function createObjectMerger(predicate) {
6
- return /* @__PURE__ */ __name(function objMerge(target, ...sources) {
7
- for (const src of sources) {
8
- for (const [key, value] of Object.entries(src)) {
9
- if (predicate(value, key, src)) {
10
- target[key] = value;
11
- }
12
- }
13
- }
14
- return target;
15
- }, "objMerge");
16
- }
17
- __name(createObjectMerger, "createObjectMerger");
18
-
19
- // src/objAssign.ts
20
- var objAssign = createObjectMerger((value) => {
21
- return value != null;
22
- });
23
-
24
- export { objAssign };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/objDeepFreeze.ts
7
- function objDeepFreeze(o) {
8
- for (const key of Reflect.ownKeys(o)) {
9
- const value = o[key];
10
- if (value && typeof value === "object" || typeof value === "function") {
11
- objDeepFreeze(value);
12
- }
13
- }
14
- return Object.freeze(o);
15
- }
16
- __name(objDeepFreeze, "objDeepFreeze");
17
-
18
- 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,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/objDeepFreeze.ts
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
- export { objDeepFreeze };
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/objDefineLazyProperty.ts
7
- function objDefineLazyProperty(object, key, getValue) {
8
- const set = /* @__PURE__ */ __name((value) => {
9
- return Object.defineProperty(object, key, {
10
- value,
11
- enumerable: true,
12
- writable: true
13
- });
14
- }, "set");
15
- Object.defineProperty(object, key, {
16
- configurable: true,
17
- enumerable: true,
18
- get() {
19
- const result = getValue();
20
- set(result);
21
- return result;
22
- },
23
- set(value) {
24
- set(value);
25
- }
26
- });
27
- return object;
28
- }
29
- __name(objDefineLazyProperty, "objDefineLazyProperty");
30
-
31
- 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,29 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/objDefineLazyProperty.ts
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
- export { objDefineLazyProperty };
package/lib/objDelete.cjs DELETED
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // src/objDelete.ts
7
- function objDelete(obj, key) {
8
- delete obj[key];
9
- return obj;
10
- }
11
- __name(objDelete, "objDelete");
12
-
13
- 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 };