@bemoje/object 2.2.0 → 2.2.2

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