@bemoje/object 2.0.1 → 2.2.0

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 (263) hide show
  1. package/lib/arrAssign.cjs +9 -0
  2. package/lib/arrAssign.d.cts +6 -0
  3. package/lib/arrAssign.d.ts +6 -0
  4. package/lib/arrAssign.js +8 -0
  5. package/lib/className.cjs +10 -0
  6. package/lib/className.d.cts +6 -0
  7. package/lib/className.d.ts +6 -0
  8. package/lib/className.js +8 -0
  9. package/lib/constructorOf.cjs +10 -0
  10. package/lib/constructorOf.d.cts +6 -0
  11. package/lib/constructorOf.d.ts +6 -0
  12. package/lib/constructorOf.js +8 -0
  13. package/lib/createArrayMerger.cjs +19 -0
  14. package/lib/createArrayMerger.d.cts +6 -0
  15. package/lib/createArrayMerger.d.ts +6 -0
  16. package/lib/createArrayMerger.js +17 -0
  17. package/lib/createObjectMerger.cjs +19 -0
  18. package/lib/createObjectMerger.d.cts +8 -0
  19. package/lib/createObjectMerger.d.ts +8 -0
  20. package/lib/createObjectMerger.js +17 -0
  21. package/lib/defineAccessors.cjs +14 -0
  22. package/lib/defineAccessors.d.cts +9 -0
  23. package/lib/defineAccessors.d.ts +9 -0
  24. package/lib/defineAccessors.js +12 -0
  25. package/lib/defineGetter.cjs +15 -0
  26. package/lib/defineGetter.d.cts +8 -0
  27. package/lib/defineGetter.d.ts +8 -0
  28. package/lib/defineGetter.js +13 -0
  29. package/lib/defineLazyProperty.cjs +19 -0
  30. package/lib/defineLazyProperty.d.cts +8 -0
  31. package/lib/defineLazyProperty.d.ts +8 -0
  32. package/lib/defineLazyProperty.js +16 -0
  33. package/lib/defineMethod.cjs +16 -0
  34. package/lib/defineMethod.d.cts +9 -0
  35. package/lib/defineMethod.d.ts +9 -0
  36. package/lib/defineMethod.js +14 -0
  37. package/lib/defineProperty.cjs +13 -0
  38. package/lib/defineProperty.d.cts +10 -0
  39. package/lib/defineProperty.d.ts +10 -0
  40. package/lib/defineProperty.js +11 -0
  41. package/lib/defineSetter.cjs +15 -0
  42. package/lib/defineSetter.d.cts +8 -0
  43. package/lib/defineSetter.d.ts +8 -0
  44. package/lib/defineSetter.js +13 -0
  45. package/lib/defineValue.cjs +15 -0
  46. package/lib/defineValue.d.cts +9 -0
  47. package/lib/defineValue.d.ts +9 -0
  48. package/lib/defineValue.js +13 -0
  49. package/lib/deleteNullishPropsMutable.cjs +15 -0
  50. package/lib/deleteNullishPropsMutable.d.cts +6 -0
  51. package/lib/deleteNullishPropsMutable.d.ts +6 -0
  52. package/lib/deleteNullishPropsMutable.js +13 -0
  53. package/lib/entriesOf.cjs +10 -0
  54. package/lib/entriesOf.d.cts +8 -0
  55. package/lib/entriesOf.d.ts +8 -0
  56. package/lib/entriesOf.js +8 -0
  57. package/lib/filterObject.cjs +18 -0
  58. package/lib/filterObject.d.cts +9 -0
  59. package/lib/filterObject.d.ts +9 -0
  60. package/lib/filterObject.js +15 -0
  61. package/lib/filterObjectMutable.cjs +16 -0
  62. package/lib/filterObjectMutable.d.cts +8 -0
  63. package/lib/filterObjectMutable.d.ts +8 -0
  64. package/lib/filterObjectMutable.js +14 -0
  65. package/lib/getClassChain.cjs +23 -0
  66. package/lib/getClassChain.d.cts +14 -0
  67. package/lib/getClassChain.d.ts +14 -0
  68. package/lib/getClassChain.js +21 -0
  69. package/lib/getConfigurableMethodOrGetterKeys.cjs +22 -0
  70. package/lib/getConfigurableMethodOrGetterKeys.d.cts +10 -0
  71. package/lib/getConfigurableMethodOrGetterKeys.d.ts +10 -0
  72. package/lib/getConfigurableMethodOrGetterKeys.js +20 -0
  73. package/lib/getKeys.cjs +13 -0
  74. package/lib/getKeys.d.cts +19 -0
  75. package/lib/getKeys.d.ts +19 -0
  76. package/lib/getKeys.js +10 -0
  77. package/lib/getKeysPreset.cjs +89 -0
  78. package/lib/getKeysPreset.d.cts +46 -0
  79. package/lib/getKeysPreset.d.ts +46 -0
  80. package/lib/getKeysPreset.js +86 -0
  81. package/lib/getOwnProperty.cjs +10 -0
  82. package/lib/getOwnProperty.d.cts +6 -0
  83. package/lib/getOwnProperty.d.ts +6 -0
  84. package/lib/getOwnProperty.js +8 -0
  85. package/lib/getPrototypeChain.cjs +18 -0
  86. package/lib/getPrototypeChain.d.cts +9 -0
  87. package/lib/getPrototypeChain.d.ts +9 -0
  88. package/lib/getPrototypeChain.js +16 -0
  89. package/lib/getSuperClass.cjs +15 -0
  90. package/lib/getSuperClass.d.cts +11 -0
  91. package/lib/getSuperClass.d.ts +11 -0
  92. package/lib/getSuperClass.js +12 -0
  93. package/lib/getSuperClasses.cjs +14 -0
  94. package/lib/getSuperClasses.d.cts +13 -0
  95. package/lib/getSuperClasses.d.ts +13 -0
  96. package/lib/getSuperClasses.js +11 -0
  97. package/lib/hasOwnProperty.cjs +10 -0
  98. package/lib/hasOwnProperty.d.cts +6 -0
  99. package/lib/hasOwnProperty.d.ts +6 -0
  100. package/lib/hasOwnProperty.js +8 -0
  101. package/lib/hasProperty.cjs +13 -0
  102. package/lib/hasProperty.d.cts +6 -0
  103. package/lib/hasProperty.d.ts +6 -0
  104. package/lib/hasProperty.js +10 -0
  105. package/lib/hasPrototypeChainProperty.cjs +15 -0
  106. package/lib/hasPrototypeChainProperty.d.cts +7 -0
  107. package/lib/hasPrototypeChainProperty.d.ts +7 -0
  108. package/lib/hasPrototypeChainProperty.js +12 -0
  109. package/lib/index.cjs +453 -0
  110. package/lib/index.d.cts +69 -0
  111. package/lib/index.d.ts +69 -0
  112. package/lib/index.js +64 -0
  113. package/lib/inheritPrototypeMembers.cjs +22 -0
  114. package/lib/inheritPrototypeMembers.d.cts +8 -0
  115. package/lib/inheritPrototypeMembers.d.ts +8 -0
  116. package/lib/inheritPrototypeMembers.js +20 -0
  117. package/lib/inheritStaticMembers.cjs +23 -0
  118. package/lib/inheritStaticMembers.d.cts +8 -0
  119. package/lib/inheritStaticMembers.d.ts +8 -0
  120. package/lib/inheritStaticMembers.js +21 -0
  121. package/lib/isAccessorDescriptor.cjs +19 -0
  122. package/lib/isAccessorDescriptor.d.cts +19 -0
  123. package/lib/isAccessorDescriptor.d.ts +19 -0
  124. package/lib/isAccessorDescriptor.js +17 -0
  125. package/lib/isEnumerable.cjs +10 -0
  126. package/lib/isEnumerable.d.cts +6 -0
  127. package/lib/isEnumerable.d.ts +6 -0
  128. package/lib/isEnumerable.js +8 -0
  129. package/lib/isMethodValueDescriptor.cjs +10 -0
  130. package/lib/isMethodValueDescriptor.d.cts +10 -0
  131. package/lib/isMethodValueDescriptor.d.ts +10 -0
  132. package/lib/isMethodValueDescriptor.js +8 -0
  133. package/lib/isValueDescriptor.cjs +19 -0
  134. package/lib/isValueDescriptor.d.cts +15 -0
  135. package/lib/isValueDescriptor.d.ts +15 -0
  136. package/lib/isValueDescriptor.js +17 -0
  137. package/lib/iterableFirstElement.cjs +10 -0
  138. package/lib/iterableFirstElement.d.cts +13 -0
  139. package/lib/iterableFirstElement.d.ts +13 -0
  140. package/lib/iterableFirstElement.js +8 -0
  141. package/lib/iterateObject.cjs +72 -0
  142. package/lib/iterateObject.d.cts +36 -0
  143. package/lib/iterateObject.d.ts +36 -0
  144. package/lib/iterateObject.js +70 -0
  145. package/lib/keysOf.cjs +10 -0
  146. package/lib/keysOf.d.cts +8 -0
  147. package/lib/keysOf.d.ts +8 -0
  148. package/lib/keysOf.js +8 -0
  149. package/lib/mapObjectEntries.cjs +17 -0
  150. package/lib/mapObjectEntries.d.cts +8 -0
  151. package/lib/mapObjectEntries.d.ts +8 -0
  152. package/lib/mapObjectEntries.js +14 -0
  153. package/lib/mapObjectKeys.cjs +16 -0
  154. package/lib/mapObjectKeys.d.cts +8 -0
  155. package/lib/mapObjectKeys.d.ts +8 -0
  156. package/lib/mapObjectKeys.js +13 -0
  157. package/lib/objAssign.cjs +9 -0
  158. package/lib/objAssign.d.cts +8 -0
  159. package/lib/objAssign.d.ts +8 -0
  160. package/lib/objAssign.js +8 -0
  161. package/lib/objDeepFreeze.cjs +16 -0
  162. package/lib/objDeepFreeze.d.cts +10 -0
  163. package/lib/objDeepFreeze.d.ts +10 -0
  164. package/lib/objDeepFreeze.js +14 -0
  165. package/lib/objDefineLazyProperty.cjs +29 -0
  166. package/lib/objDefineLazyProperty.d.cts +13 -0
  167. package/lib/objDefineLazyProperty.d.ts +13 -0
  168. package/lib/objDefineLazyProperty.js +27 -0
  169. package/lib/objDelete.cjs +11 -0
  170. package/lib/objDelete.d.cts +15 -0
  171. package/lib/objDelete.d.ts +15 -0
  172. package/lib/objDelete.js +9 -0
  173. package/lib/objGet.cjs +10 -0
  174. package/lib/objGet.d.cts +6 -0
  175. package/lib/objGet.d.ts +6 -0
  176. package/lib/objGet.js +8 -0
  177. package/lib/objGetOrDefault.cjs +16 -0
  178. package/lib/objGetOrDefault.d.cts +6 -0
  179. package/lib/objGetOrDefault.d.ts +6 -0
  180. package/lib/objGetOrDefault.js +13 -0
  181. package/lib/objGetOrDefaultValue.cjs +10 -0
  182. package/lib/objGetOrDefaultValue.d.cts +7 -0
  183. package/lib/objGetOrDefaultValue.d.ts +7 -0
  184. package/lib/objGetOrDefaultValue.js +8 -0
  185. package/lib/objHas.cjs +10 -0
  186. package/lib/objHas.d.cts +17 -0
  187. package/lib/objHas.d.ts +17 -0
  188. package/lib/objHas.js +8 -0
  189. package/lib/objOmitKeysMutable.cjs +16 -0
  190. package/lib/objOmitKeysMutable.d.cts +17 -0
  191. package/lib/objOmitKeysMutable.d.ts +17 -0
  192. package/lib/objOmitKeysMutable.js +14 -0
  193. package/lib/objPropertyValueToGetter.cjs +24 -0
  194. package/lib/objPropertyValueToGetter.d.cts +23 -0
  195. package/lib/objPropertyValueToGetter.d.ts +23 -0
  196. package/lib/objPropertyValueToGetter.js +22 -0
  197. package/lib/objSet.cjs +10 -0
  198. package/lib/objSet.d.cts +6 -0
  199. package/lib/objSet.d.ts +6 -0
  200. package/lib/objSet.js +8 -0
  201. package/lib/objSize.cjs +10 -0
  202. package/lib/objSize.d.cts +6 -0
  203. package/lib/objSize.d.ts +6 -0
  204. package/lib/objSize.js +8 -0
  205. package/lib/objSortKeys.cjs +18 -0
  206. package/lib/objSortKeys.d.cts +8 -0
  207. package/lib/objSortKeys.d.ts +8 -0
  208. package/lib/objSortKeys.js +16 -0
  209. package/lib/objToMap.cjs +10 -0
  210. package/lib/objToMap.d.cts +8 -0
  211. package/lib/objToMap.d.ts +8 -0
  212. package/lib/objToMap.js +8 -0
  213. package/lib/objUpdate.cjs +10 -0
  214. package/lib/objUpdate.d.cts +8 -0
  215. package/lib/objUpdate.d.ts +8 -0
  216. package/lib/objUpdate.js +8 -0
  217. package/lib/objUpdatePropertyDescriptors.cjs +16 -0
  218. package/lib/objUpdatePropertyDescriptors.d.cts +17 -0
  219. package/lib/objUpdatePropertyDescriptors.d.ts +17 -0
  220. package/lib/objUpdatePropertyDescriptors.js +14 -0
  221. package/lib/propertyIsEnumerable.cjs +10 -0
  222. package/lib/propertyIsEnumerable.d.cts +6 -0
  223. package/lib/propertyIsEnumerable.d.ts +6 -0
  224. package/lib/propertyIsEnumerable.js +8 -0
  225. package/lib/setEnumerable.cjs +15 -0
  226. package/lib/setEnumerable.d.cts +6 -0
  227. package/lib/setEnumerable.d.ts +6 -0
  228. package/lib/setEnumerable.js +13 -0
  229. package/lib/setNonConfigurable.cjs +15 -0
  230. package/lib/setNonConfigurable.d.cts +6 -0
  231. package/lib/setNonConfigurable.d.ts +6 -0
  232. package/lib/setNonConfigurable.js +13 -0
  233. package/lib/setNonEnumerable.cjs +15 -0
  234. package/lib/setNonEnumerable.d.cts +6 -0
  235. package/lib/setNonEnumerable.d.ts +6 -0
  236. package/lib/setNonEnumerable.js +13 -0
  237. package/lib/setNonWritable.cjs +15 -0
  238. package/lib/setNonWritable.d.cts +6 -0
  239. package/lib/setNonWritable.d.ts +6 -0
  240. package/lib/setNonWritable.js +13 -0
  241. package/lib/setWritable.cjs +15 -0
  242. package/lib/setWritable.d.cts +6 -0
  243. package/lib/setWritable.d.ts +6 -0
  244. package/lib/setWritable.js +13 -0
  245. package/lib/sortKeys.cjs +14 -0
  246. package/lib/sortKeys.d.cts +6 -0
  247. package/lib/sortKeys.d.ts +6 -0
  248. package/lib/sortKeys.js +12 -0
  249. package/lib/sortKeysLike.cjs +14 -0
  250. package/lib/sortKeysLike.d.cts +6 -0
  251. package/lib/sortKeysLike.d.ts +6 -0
  252. package/lib/sortKeysLike.js +12 -0
  253. package/lib/staticClassKeysOf.cjs +18 -0
  254. package/lib/staticClassKeysOf.d.cts +15 -0
  255. package/lib/staticClassKeysOf.d.ts +15 -0
  256. package/lib/staticClassKeysOf.js +16 -0
  257. package/lib/valuesOf.cjs +10 -0
  258. package/lib/valuesOf.d.cts +8 -0
  259. package/lib/valuesOf.d.ts +8 -0
  260. package/lib/valuesOf.js +8 -0
  261. package/package.json +935 -21
  262. package/index.d.ts +0 -891
  263. package/index.mjs +0 -970
@@ -0,0 +1,17 @@
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;
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,14 @@
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 };
@@ -0,0 +1,16 @@
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;
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,8 @@
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 };
@@ -0,0 +1,16 @@
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;
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,14 @@
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 };
@@ -0,0 +1,29 @@
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;
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,13 @@
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 };
@@ -0,0 +1,27 @@
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 };
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,15 @@
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 };
@@ -0,0 +1,15 @@
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 };
@@ -0,0 +1,9 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ function objDelete(obj, key) {
4
+ delete obj[key];
5
+ return obj;
6
+ }
7
+ __name(objDelete, "objDelete");
8
+
9
+ export { objDelete };
package/lib/objGet.cjs ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ function objGet(obj, key) {
6
+ return obj[key];
7
+ }
8
+ __name(objGet, "objGet");
9
+
10
+ exports.objGet = objGet;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Retrieves the value associated with the specified key from an object.
3
+ */
4
+ declare function objGet<T, K extends keyof T>(obj: T, key: K): T[K];
5
+
6
+ export { objGet };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Retrieves the value associated with the specified key from an object.
3
+ */
4
+ declare function objGet<T, K extends keyof T>(obj: T, key: K): T[K];
5
+
6
+ export { objGet };
package/lib/objGet.js ADDED
@@ -0,0 +1,8 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ function objGet(obj, key) {
4
+ return obj[key];
5
+ }
6
+ __name(objGet, "objGet");
7
+
8
+ export { objGet };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var hasOwnProperty = require('./hasOwnProperty');
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ function objGetOrDefault(object, key, factory) {
8
+ const value = object[key];
9
+ if (value !== void 0 || hasOwnProperty.hasOwnProperty(object, key)) {
10
+ return value;
11
+ }
12
+ return object[key] = factory(key);
13
+ }
14
+ __name(objGetOrDefault, "objGetOrDefault");
15
+
16
+ exports.objGetOrDefault = objGetOrDefault;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets a property value from an object or creates it using a factory function if it doesn't exist.
3
+ */
4
+ declare function objGetOrDefault<K extends PropertyKey, V>(object: Record<K, V>, key: K, factory: (key: K) => V): V;
5
+
6
+ export { objGetOrDefault };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets a property value from an object or creates it using a factory function if it doesn't exist.
3
+ */
4
+ declare function objGetOrDefault<K extends PropertyKey, V>(object: Record<K, V>, key: K, factory: (key: K) => V): V;
5
+
6
+ export { objGetOrDefault };
@@ -0,0 +1,13 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+ import { hasOwnProperty } from './hasOwnProperty';
3
+
4
+ function objGetOrDefault(object, key, factory) {
5
+ const value = object[key];
6
+ if (value !== void 0 || hasOwnProperty(object, key)) {
7
+ return value;
8
+ }
9
+ return object[key] = factory(key);
10
+ }
11
+ __name(objGetOrDefault, "objGetOrDefault");
12
+
13
+ export { objGetOrDefault };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ function objGetOrDefaultValue(obj, key, defaultValue) {
6
+ return obj[key] ?? (obj[key] = defaultValue);
7
+ }
8
+ __name(objGetOrDefaultValue, "objGetOrDefaultValue");
9
+
10
+ exports.objGetOrDefaultValue = objGetOrDefaultValue;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This function attempts to retrieve a value from an object using a provided key.
3
+ * If the key does not exist in the object, it sets the provided default value in the object and returns it.
4
+ */
5
+ declare function objGetOrDefaultValue<T, K extends keyof T>(obj: T, key: K, defaultValue: T[K]): T[K];
6
+
7
+ export { objGetOrDefaultValue };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This function attempts to retrieve a value from an object using a provided key.
3
+ * If the key does not exist in the object, it sets the provided default value in the object and returns it.
4
+ */
5
+ declare function objGetOrDefaultValue<T, K extends keyof T>(obj: T, key: K, defaultValue: T[K]): T[K];
6
+
7
+ export { objGetOrDefaultValue };
@@ -0,0 +1,8 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ function objGetOrDefaultValue(obj, key, defaultValue) {
4
+ return obj[key] ?? (obj[key] = defaultValue);
5
+ }
6
+ __name(objGetOrDefaultValue, "objGetOrDefaultValue");
7
+
8
+ export { objGetOrDefaultValue };
package/lib/objHas.cjs ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ function objHas(obj, key) {
6
+ return Reflect.has(obj, key);
7
+ }
8
+ __name(objHas, "objHas");
9
+
10
+ exports.objHas = objHas;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Checks if an object has a specific key.
3
+ * @param obj The object to check.
4
+ * @template K - The type of the keys in the object.
5
+ * @returns Returns true if the object has the key, false otherwise.
6
+ * @param key The key to check for.
7
+ * @example ```ts
8
+ * const myObj = { name: 'John', age: 30 };
9
+ * objHas(myObj, 'name');
10
+ * //=> true
11
+ * objHas(myObj, 'email');
12
+ * //=> false
13
+ * ```
14
+ */
15
+ declare function objHas<V>(obj: Record<PropertyKey, V>, key: PropertyKey): boolean;
16
+
17
+ export { objHas };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Checks if an object has a specific key.
3
+ * @param obj The object to check.
4
+ * @template K - The type of the keys in the object.
5
+ * @returns Returns true if the object has the key, false otherwise.
6
+ * @param key The key to check for.
7
+ * @example ```ts
8
+ * const myObj = { name: 'John', age: 30 };
9
+ * objHas(myObj, 'name');
10
+ * //=> true
11
+ * objHas(myObj, 'email');
12
+ * //=> false
13
+ * ```
14
+ */
15
+ declare function objHas<V>(obj: Record<PropertyKey, V>, key: PropertyKey): boolean;
16
+
17
+ export { objHas };
package/lib/objHas.js ADDED
@@ -0,0 +1,8 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ function objHas(obj, key) {
4
+ return Reflect.has(obj, key);
5
+ }
6
+ __name(objHas, "objHas");
7
+
8
+ export { objHas };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ function objOmitKeysMutable(obj, ...keys) {
6
+ for (const key of keys) {
7
+ if (!Object.hasOwn(obj, key)) {
8
+ continue;
9
+ }
10
+ Reflect.deleteProperty(obj, key);
11
+ }
12
+ return obj;
13
+ }
14
+ __name(objOmitKeysMutable, "objOmitKeysMutable");
15
+
16
+ exports.objOmitKeysMutable = objOmitKeysMutable;
@@ -0,0 +1,17 @@
1
+ import { A as Any } from './Any-ChepAe8v.cjs';
2
+
3
+ /**
4
+ * Deletes the specified keys from an object in a mutable way.
5
+ * @param obj The object from which to delete the keys.
6
+ * @returns The modified object with the specified keys deleted.
7
+ * @typeparam V - The type of the values in the object.
8
+ * @param keys The keys to delete from the object.
9
+ * @example ```ts
10
+ * const obj = { a: 1, b: 2, c: 3 };
11
+ * objOmitKeysMutable(obj, 'a', 'c');
12
+ * //=> { b: 2 }
13
+ * ```
14
+ */
15
+ declare function objOmitKeysMutable<O extends Record<PropertyKey, Any>>(obj: O, ...keys: PropertyKey[]): O;
16
+
17
+ export { objOmitKeysMutable };
@@ -0,0 +1,17 @@
1
+ import { A as Any } from './Any-ChepAe8v.js';
2
+
3
+ /**
4
+ * Deletes the specified keys from an object in a mutable way.
5
+ * @param obj The object from which to delete the keys.
6
+ * @returns The modified object with the specified keys deleted.
7
+ * @typeparam V - The type of the values in the object.
8
+ * @param keys The keys to delete from the object.
9
+ * @example ```ts
10
+ * const obj = { a: 1, b: 2, c: 3 };
11
+ * objOmitKeysMutable(obj, 'a', 'c');
12
+ * //=> { b: 2 }
13
+ * ```
14
+ */
15
+ declare function objOmitKeysMutable<O extends Record<PropertyKey, Any>>(obj: O, ...keys: PropertyKey[]): O;
16
+
17
+ export { objOmitKeysMutable };
@@ -0,0 +1,14 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+
3
+ function objOmitKeysMutable(obj, ...keys) {
4
+ for (const key of keys) {
5
+ if (!Object.hasOwn(obj, key)) {
6
+ continue;
7
+ }
8
+ Reflect.deleteProperty(obj, key);
9
+ }
10
+ return obj;
11
+ }
12
+ __name(objOmitKeysMutable, "objOmitKeysMutable");
13
+
14
+ export { objOmitKeysMutable };
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
+ function objPropertyValueToGetter(object, ...propertyNames) {
6
+ for (const propertyName of propertyNames) {
7
+ const descriptor = Object.getOwnPropertyDescriptor(object, propertyName);
8
+ if (!descriptor) {
9
+ throw new Error(`Property descriptor for '${String(propertyName)}' not found.`);
10
+ }
11
+ const { enumerable, configurable, value } = descriptor;
12
+ Object.defineProperty(object, propertyName, {
13
+ enumerable,
14
+ configurable,
15
+ get: /* @__PURE__ */ __name(() => {
16
+ return value;
17
+ }, "get")
18
+ });
19
+ }
20
+ return object;
21
+ }
22
+ __name(objPropertyValueToGetter, "objPropertyValueToGetter");
23
+
24
+ exports.objPropertyValueToGetter = objPropertyValueToGetter;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Converts the specified properties of an object into getter functions.
3
+ * @template K - The type of the keys of the object.
4
+ * @template V - The type of the values of the object.
5
+ * @template T - The type of the object.
6
+ * @param object The object whose properties are to be converted into getter functions.
7
+ * @param propertyNames The names of the properties to be converted into getter functions.
8
+ * @returns The object with the specified properties converted into getter functions.
9
+ * @throws Throws an error if the property descriptor for a specified property name is not found.
10
+ * @example ```ts
11
+ * const obj = { a: 1, b: 2, c: 3 };
12
+ * objPropertyValueToGetter(obj, 'a', 'b');
13
+ * obj.a;
14
+ * //=> 1
15
+ * obj.b;
16
+ * //=> 2
17
+ * obj.c;
18
+ * //=> 3
19
+ * ```
20
+ */
21
+ declare function objPropertyValueToGetter<V, T extends Record<PropertyKey, V>>(object: T, ...propertyNames: PropertyKey[]): T;
22
+
23
+ export { objPropertyValueToGetter };