@bemoje/object 2.1.0 → 2.2.1

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