@bemoje/object 0.2.13 → 0.2.15

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 (155) hide show
  1. package/cjs/index.d.ts +6 -12
  2. package/cjs/index.d.ts.map +1 -1
  3. package/cjs/index.js +6 -12
  4. package/cjs/index.js.map +1 -1
  5. package/cjs/lib/constructorOf.d.ts +6 -0
  6. package/cjs/lib/constructorOf.d.ts.map +1 -0
  7. package/cjs/lib/constructorOf.js +11 -0
  8. package/cjs/lib/constructorOf.js.map +1 -0
  9. package/cjs/lib/define.d.ts +7 -7
  10. package/cjs/lib/define.d.ts.map +1 -1
  11. package/cjs/lib/define.js +14 -14
  12. package/cjs/lib/define.js.map +1 -1
  13. package/cjs/lib/hasOwnProp.d.ts +3 -0
  14. package/cjs/lib/hasOwnProp.d.ts.map +1 -1
  15. package/cjs/lib/hasOwnProp.js +3 -0
  16. package/cjs/lib/hasOwnProp.js.map +1 -1
  17. package/cjs/lib/isPropEnum.d.ts +3 -0
  18. package/cjs/lib/isPropEnum.d.ts.map +1 -1
  19. package/cjs/lib/isPropEnum.js +3 -0
  20. package/cjs/lib/isPropEnum.js.map +1 -1
  21. package/cjs/lib/iterableFirstElement.d.ts +1 -1
  22. package/cjs/lib/iterableFirstElement.js +1 -1
  23. package/cjs/lib/iteratePrototypeChainOf.d.ts +7 -0
  24. package/cjs/lib/iteratePrototypeChainOf.d.ts.map +1 -0
  25. package/cjs/lib/iteratePrototypeChainOf.js +19 -0
  26. package/cjs/lib/iteratePrototypeChainOf.js.map +1 -0
  27. package/cjs/lib/oDeleteUndefined.d.ts +1 -2
  28. package/cjs/lib/oDeleteUndefined.d.ts.map +1 -1
  29. package/cjs/lib/oDeleteUndefined.js.map +1 -1
  30. package/cjs/lib/objFilter.d.ts +1 -2
  31. package/cjs/lib/objFilter.d.ts.map +1 -1
  32. package/cjs/lib/objFilter.js.map +1 -1
  33. package/cjs/lib/objFilterMutable.d.ts +1 -2
  34. package/cjs/lib/objFilterMutable.d.ts.map +1 -1
  35. package/cjs/lib/objFilterMutable.js.map +1 -1
  36. package/cjs/lib/objGet.d.ts +1 -15
  37. package/cjs/lib/objGet.d.ts.map +1 -1
  38. package/cjs/lib/objGet.js +0 -13
  39. package/cjs/lib/objGet.js.map +1 -1
  40. package/cjs/lib/objGetOrDefault.d.ts +8 -0
  41. package/cjs/lib/objGetOrDefault.d.ts.map +1 -0
  42. package/cjs/lib/objGetOrDefault.js +13 -0
  43. package/cjs/lib/objGetOrDefault.js.map +1 -0
  44. package/cjs/lib/objGetOrDefaultValue.d.ts +6 -0
  45. package/cjs/lib/objGetOrDefaultValue.d.ts.map +1 -0
  46. package/cjs/lib/objGetOrDefaultValue.js +12 -0
  47. package/cjs/lib/objGetOrDefaultValue.js.map +1 -0
  48. package/cjs/lib/objPropertyValueToGetter.d.ts +3 -3
  49. package/cjs/lib/objPropertyValueToGetter.d.ts.map +1 -1
  50. package/cjs/lib/objPropertyValueToGetter.js +3 -3
  51. package/cjs/lib/objReduce.d.ts +2 -12
  52. package/cjs/lib/objReduce.d.ts.map +1 -1
  53. package/cjs/lib/objReduce.js +3 -13
  54. package/cjs/lib/objReduce.js.map +1 -1
  55. package/cjs/lib/objSet.d.ts +1 -12
  56. package/cjs/lib/objSet.d.ts.map +1 -1
  57. package/cjs/lib/objSet.js +1 -12
  58. package/cjs/lib/objSet.js.map +1 -1
  59. package/cjs/lib/objSize.d.ts +2 -11
  60. package/cjs/lib/objSize.d.ts.map +1 -1
  61. package/cjs/lib/objSize.js +1 -9
  62. package/cjs/lib/objSize.js.map +1 -1
  63. package/cjs/lib/objSortKeys.d.ts +3 -3
  64. package/cjs/lib/objSortKeys.d.ts.map +1 -1
  65. package/cjs/lib/objSortKeys.js +8 -3
  66. package/cjs/lib/objSortKeys.js.map +1 -1
  67. package/cjs/lib/objToMap.d.ts +2 -14
  68. package/cjs/lib/objToMap.d.ts.map +1 -1
  69. package/cjs/lib/objToMap.js +0 -12
  70. package/cjs/lib/objToMap.js.map +1 -1
  71. package/cjs/lib/objUpdate.d.ts +6 -3
  72. package/cjs/lib/objUpdate.d.ts.map +1 -1
  73. package/cjs/lib/objUpdate.js +5 -2
  74. package/cjs/lib/objUpdate.js.map +1 -1
  75. package/cjs/lib/ownKeys.d.ts +18 -0
  76. package/cjs/lib/ownKeys.d.ts.map +1 -0
  77. package/cjs/lib/ownKeys.js +58 -0
  78. package/cjs/lib/ownKeys.js.map +1 -0
  79. package/cjs/lib/prototypeChainOf.d.ts +7 -0
  80. package/cjs/lib/prototypeChainOf.d.ts.map +1 -0
  81. package/cjs/lib/prototypeChainOf.js +12 -0
  82. package/cjs/lib/prototypeChainOf.js.map +1 -0
  83. package/cjs/lib/setEnumerable.d.ts +1 -1
  84. package/cjs/lib/setEnumerable.d.ts.map +1 -1
  85. package/cjs/lib/setEnumerable.js +1 -1
  86. package/cjs/lib/setEnumerable.js.map +1 -1
  87. package/cjs/lib/setNonConfigurable.d.ts +3 -3
  88. package/cjs/lib/setNonConfigurable.d.ts.map +1 -1
  89. package/cjs/lib/setNonConfigurable.js +3 -3
  90. package/cjs/lib/setNonConfigurable.js.map +1 -1
  91. package/cjs/lib/setNonEnumerable.d.ts +1 -1
  92. package/cjs/lib/setNonEnumerable.d.ts.map +1 -1
  93. package/cjs/lib/setNonEnumerable.js +1 -1
  94. package/cjs/lib/setNonEnumerable.js.map +1 -1
  95. package/cjs/lib/setNonWritable.d.ts +4 -4
  96. package/cjs/lib/setNonWritable.d.ts.map +1 -1
  97. package/cjs/lib/setNonWritable.js +4 -4
  98. package/cjs/lib/setNonWritable.js.map +1 -1
  99. package/cjs/lib/setWritable.d.ts +2 -2
  100. package/cjs/lib/setWritable.d.ts.map +1 -1
  101. package/cjs/lib/setWritable.js +2 -2
  102. package/cjs/lib/setWritable.js.map +1 -1
  103. package/cjs/lib/superChain.d.ts +2 -2
  104. package/cjs/lib/superChain.d.ts.map +1 -1
  105. package/cjs/lib/superChain.js +0 -1
  106. package/cjs/lib/superChain.js.map +1 -1
  107. package/package.json +1 -1
  108. package/cjs/lib/OView.d.ts +0 -136
  109. package/cjs/lib/OView.d.ts.map +0 -1
  110. package/cjs/lib/OView.js +0 -308
  111. package/cjs/lib/OView.js.map +0 -1
  112. package/cjs/lib/getConstructor.d.ts +0 -14
  113. package/cjs/lib/getConstructor.d.ts.map +0 -1
  114. package/cjs/lib/getConstructor.js +0 -19
  115. package/cjs/lib/getConstructor.js.map +0 -1
  116. package/cjs/lib/iteratePrototypeChain.d.ts +0 -13
  117. package/cjs/lib/iteratePrototypeChain.d.ts.map +0 -1
  118. package/cjs/lib/iteratePrototypeChain.js +0 -24
  119. package/cjs/lib/iteratePrototypeChain.js.map +0 -1
  120. package/cjs/lib/objEntries.d.ts +0 -16
  121. package/cjs/lib/objEntries.d.ts.map +0 -1
  122. package/cjs/lib/objEntries.js +0 -21
  123. package/cjs/lib/objEntries.js.map +0 -1
  124. package/cjs/lib/objEntriesArray.d.ts +0 -16
  125. package/cjs/lib/objEntriesArray.d.ts.map +0 -1
  126. package/cjs/lib/objEntriesArray.js +0 -21
  127. package/cjs/lib/objEntriesArray.js.map +0 -1
  128. package/cjs/lib/objGetOrElse.d.ts +0 -16
  129. package/cjs/lib/objGetOrElse.d.ts.map +0 -1
  130. package/cjs/lib/objGetOrElse.js +0 -24
  131. package/cjs/lib/objGetOrElse.js.map +0 -1
  132. package/cjs/lib/objKeys.d.ts +0 -17
  133. package/cjs/lib/objKeys.d.ts.map +0 -1
  134. package/cjs/lib/objKeys.js +0 -22
  135. package/cjs/lib/objKeys.js.map +0 -1
  136. package/cjs/lib/objKeysArray.d.ts +0 -15
  137. package/cjs/lib/objKeysArray.d.ts.map +0 -1
  138. package/cjs/lib/objKeysArray.js +0 -20
  139. package/cjs/lib/objKeysArray.js.map +0 -1
  140. package/cjs/lib/objReverse.d.ts +0 -14
  141. package/cjs/lib/objReverse.d.ts.map +0 -1
  142. package/cjs/lib/objReverse.js +0 -20
  143. package/cjs/lib/objReverse.js.map +0 -1
  144. package/cjs/lib/objValues.d.ts +0 -21
  145. package/cjs/lib/objValues.d.ts.map +0 -1
  146. package/cjs/lib/objValues.js +0 -26
  147. package/cjs/lib/objValues.js.map +0 -1
  148. package/cjs/lib/objValuesArray.d.ts +0 -15
  149. package/cjs/lib/objValuesArray.d.ts.map +0 -1
  150. package/cjs/lib/objValuesArray.js +0 -20
  151. package/cjs/lib/objValuesArray.js.map +0 -1
  152. package/cjs/lib/toJson.d.ts +0 -13
  153. package/cjs/lib/toJson.d.ts.map +0 -1
  154. package/cjs/lib/toJson.js +0 -19
  155. package/cjs/lib/toJson.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"iteratePrototypeChain.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/iteratePrototypeChain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C;;;;;;;GAOG;AACH,wBAAiB,qBAAqB,CACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAC9B,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,SAAS,CAAC,OAAO,MAAM,CAAC,SAAS,CAAC,CAQpC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.iteratePrototypeChain = void 0;
4
- /**
5
- * Iterate the prototype chain of a given object.
6
- * @remarks This function uses the `Reflect.getPrototypeOf` method to traverse the prototype chain.
7
- * It also uses the `isPrototype` and `isConstructor` helper functions to determine whether
8
- * the given object is a prototype or a constructor function.
9
- * @param object The object whose prototype chain is to be iterated over.
10
- * @throws If the provided object is not an object or a function, a TypeError will be thrown.
11
- */
12
- function* iteratePrototypeChain(object, opts) {
13
- if (opts?.excludeSelf)
14
- yield object;
15
- const orig = object;
16
- let node = object;
17
- while (node) {
18
- if (orig !== node)
19
- yield node;
20
- node = Reflect.getPrototypeOf(node);
21
- }
22
- }
23
- exports.iteratePrototypeChain = iteratePrototypeChain;
24
- //# sourceMappingURL=iteratePrototypeChain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iteratePrototypeChain.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/iteratePrototypeChain.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,QAAe,CAAC,CAAC,qBAAqB,CACpC,MAA8B,EAC9B,IAAgC;IAEhC,IAAI,IAAI,EAAE,WAAW;QAAE,MAAM,MAAM,CAAA;IACnC,MAAM,IAAI,GAAG,MAAM,CAAA;IACnB,IAAI,IAAI,GAAkB,MAAM,CAAA;IAChC,OAAO,IAAI,EAAE;QACX,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM,IAAI,CAAA;QAC7B,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;KACpC;AACH,CAAC;AAXD,sDAWC"}
@@ -1,16 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an iterable of key-value pairs from the given object.
4
- * @remarks This function is a part of Object Utilities.
5
- * @typeparam V - The type of values in the object.
6
- * @returns An iterable of tuples where each tuple is a key-value pair from the object.
7
- * @param obj The object to iterate over.
8
- * @example ```ts
9
- * const obj = { a: 1, b: 2, c: 3 };
10
- * for (const [key, value] of objEntries(obj)) {
11
- * //=> a //=> b //=> c 3
12
- * }
13
- * ```
14
- */
15
- export declare function objEntries<V>(obj: Record<ObjectKey, V>): Iterable<[string, V]>;
16
- //# sourceMappingURL=objEntries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objEntries.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAiB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAE/E"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objEntries = void 0;
4
- /**
5
- * Returns an iterable of key-value pairs from the given object.
6
- * @remarks This function is a part of Object Utilities.
7
- * @typeparam V - The type of values in the object.
8
- * @returns An iterable of tuples where each tuple is a key-value pair from the object.
9
- * @param obj The object to iterate over.
10
- * @example ```ts
11
- * const obj = { a: 1, b: 2, c: 3 };
12
- * for (const [key, value] of objEntries(obj)) {
13
- * //=> a //=> b //=> c 3
14
- * }
15
- * ```
16
- */
17
- function* objEntries(obj) {
18
- yield* Object.entries(obj);
19
- }
20
- exports.objEntries = objEntries;
21
- //# sourceMappingURL=objEntries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objEntries.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objEntries.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AACH,QAAe,CAAC,CAAC,UAAU,CAAI,GAAyB;IACtD,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC;AAFD,gCAEC"}
@@ -1,16 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an array of key-value pairs from the given object.
4
- * @remarks This function is a utility for converting an object into an array of its entries.
5
- * Each entry is a tuple where the first element is the key and the second is the value.
6
- * @typeparam V - The type of the values in the object.
7
- * @returns An array of entries, where each entry is a tuple of a string and a value of type `V`.
8
- * @param obj The object to extract keyvalue pairs from.
9
- * @example ```ts
10
- * const obj = { a: 1, b: 2, c: 3 };
11
- * objEntriesArray(obj);
12
- * //=> [['a', 1], ['b', 2], ['c', 3]]
13
- * ```
14
- */
15
- export declare function objEntriesArray<V>(obj: Record<ObjectKey, V>): Array<[string, V]>;
16
- //# sourceMappingURL=objEntriesArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objEntriesArray.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objEntriesArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAEhF"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objEntriesArray = void 0;
4
- /**
5
- * Returns an array of key-value pairs from the given object.
6
- * @remarks This function is a utility for converting an object into an array of its entries.
7
- * Each entry is a tuple where the first element is the key and the second is the value.
8
- * @typeparam V - The type of the values in the object.
9
- * @returns An array of entries, where each entry is a tuple of a string and a value of type `V`.
10
- * @param obj The object to extract keyvalue pairs from.
11
- * @example ```ts
12
- * const obj = { a: 1, b: 2, c: 3 };
13
- * objEntriesArray(obj);
14
- * //=> [['a', 1], ['b', 2], ['c', 3]]
15
- * ```
16
- */
17
- function objEntriesArray(obj) {
18
- return Array.from(Object.entries(obj));
19
- }
20
- exports.objEntriesArray = objEntriesArray;
21
- //# sourceMappingURL=objEntriesArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objEntriesArray.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objEntriesArray.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AACH,SAAgB,eAAe,CAAI,GAAyB;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AACxC,CAAC;AAFD,0CAEC"}
@@ -1,16 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * This function attempts to retrieve a value from an object using a provided key.
4
- * If the key does not exist in the object, it uses a callback function to generate a default value.
5
- * @param obj The object from which to retrieve the value.
6
- * @param key The key to use when retrieving the value.
7
- * @param callback The function to call when the key does not exist in the object. This function should return the default value.
8
- * @returns The value associated with the key in the object, or the result of the callback function if the key does not exist in the object.
9
- * @example ```ts
10
- * objGetOrElse({ a: 1, b: 2 }, 'c', (key) => 3);;
11
- * //=> 3
12
- * ```
13
- * @typeparam V - The type of the values in the object.
14
- */
15
- export declare function objGetOrElse<V>(obj: Record<ObjectKey, V>, key: ObjectKey, callback: (key: ObjectKey) => V): V;
16
- //# sourceMappingURL=objGetOrElse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objGetOrElse.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objGetOrElse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,CAI7G"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objGetOrElse = void 0;
4
- /**
5
- * This function attempts to retrieve a value from an object using a provided key.
6
- * If the key does not exist in the object, it uses a callback function to generate a default value.
7
- * @param obj The object from which to retrieve the value.
8
- * @param key The key to use when retrieving the value.
9
- * @param callback The function to call when the key does not exist in the object. This function should return the default value.
10
- * @returns The value associated with the key in the object, or the result of the callback function if the key does not exist in the object.
11
- * @example ```ts
12
- * objGetOrElse({ a: 1, b: 2 }, 'c', (key) => 3);;
13
- * //=> 3
14
- * ```
15
- * @typeparam V - The type of the values in the object.
16
- */
17
- function objGetOrElse(obj, key, callback) {
18
- const value = obj[key];
19
- if (value !== undefined)
20
- return value;
21
- return (obj[key] = callback(key));
22
- }
23
- exports.objGetOrElse = objGetOrElse;
24
- //# sourceMappingURL=objGetOrElse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objGetOrElse.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objGetOrElse.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AACH,SAAgB,YAAY,CAAI,GAAyB,EAAE,GAAc,EAAE,QAA+B;IACxG,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;IACtB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAA;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;AACnC,CAAC;AAJD,oCAIC"}
@@ -1,17 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an iterable of all the keys in the given object.
4
- * @remarks This function is a part of the `utils` module.
5
- * @typeparam V - The type of the values in the object.
6
- * @returns An iterable of the object's keys.
7
- * @param obj The object whose keys to iterate over.
8
- * @example ```ts
9
- * const obj = { a: 1, b: 2, c: 3 };
10
- * const keys = objKeys(obj);
11
- * for (const key of keys) {
12
- * //=> //=> //=> c
13
- * }
14
- * ```
15
- */
16
- export declare function objKeys<V>(obj: Record<ObjectKey, V>): Iterable<string>;
17
- //# sourceMappingURL=objKeys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objKeys.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;GAaG;AACH,wBAAiB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAEvE"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objKeys = void 0;
4
- /**
5
- * Returns an iterable of all the keys in the given object.
6
- * @remarks This function is a part of the `utils` module.
7
- * @typeparam V - The type of the values in the object.
8
- * @returns An iterable of the object's keys.
9
- * @param obj The object whose keys to iterate over.
10
- * @example ```ts
11
- * const obj = { a: 1, b: 2, c: 3 };
12
- * const keys = objKeys(obj);
13
- * for (const key of keys) {
14
- * //=> //=> //=> c
15
- * }
16
- * ```
17
- */
18
- function* objKeys(obj) {
19
- yield* Object.keys(obj);
20
- }
21
- exports.objKeys = objKeys;
22
- //# sourceMappingURL=objKeys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objKeys.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objKeys.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;GAaG;AACH,QAAe,CAAC,CAAC,OAAO,CAAI,GAAyB;IACnD,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACzB,CAAC;AAFD,0BAEC"}
@@ -1,15 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an array of keys from the provided object.
4
- * @remarks This function is a part of Object Utilities.
5
- * @typeparam V - The type of values in the object.
6
- * @returns The array of keys of the input object.
7
- * @param obj The object from which to extract the keys.
8
- * @example ```ts
9
- * const obj = { a: 1, b: 2, c: 3 };
10
- * objKeysArray(obj);
11
- * //=> ['a', 'b', 'c']
12
- * ```
13
- */
14
- export declare function objKeysArray<V>(obj: Record<ObjectKey, V>): string[];
15
- //# sourceMappingURL=objKeysArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objKeysArray.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objKeysArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,MAAM,EAAE,CAEnE"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objKeysArray = void 0;
4
- /**
5
- * Returns an array of keys from the provided object.
6
- * @remarks This function is a part of Object Utilities.
7
- * @typeparam V - The type of values in the object.
8
- * @returns The array of keys of the input object.
9
- * @param obj The object from which to extract the keys.
10
- * @example ```ts
11
- * const obj = { a: 1, b: 2, c: 3 };
12
- * objKeysArray(obj);
13
- * //=> ['a', 'b', 'c']
14
- * ```
15
- */
16
- function objKeysArray(obj) {
17
- return Array.from(Object.keys(obj));
18
- }
19
- exports.objKeysArray = objKeysArray;
20
- //# sourceMappingURL=objKeysArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objKeysArray.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objKeysArray.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,SAAgB,YAAY,CAAI,GAAyB;IACvD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACrC,CAAC;AAFD,oCAEC"}
@@ -1,14 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Reverses the order of the properties in the given object.
4
- * @remarks This function does not mutate the original object. It returns a new object with the properties in reverse order.
5
- * @param obj The object to reverse. The object's keys are of type `ObjectKey` and its values are of type `V`.
6
- * @returns A new object with the properties of the input object in reverse order. The returned object's keys are of type `ObjectKey` and its values are of type `V`.
7
- * @typeparam V - The type of the values in the input object and the returned object.
8
- * @example ```ts
9
- * objReverse({ a: 1, b: 2, c: 3 });;
10
- * //=> { c: 3, b: 2, a: 1 }
11
- * ```
12
- */
13
- export declare function objReverse<V>(obj: Record<ObjectKey, V>): Record<ObjectKey, V>;
14
- //# sourceMappingURL=objReverse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objReverse.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objReverse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAE7E"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objReverse = void 0;
4
- const objEntriesArray_1 = require("./objEntriesArray");
5
- /**
6
- * Reverses the order of the properties in the given object.
7
- * @remarks This function does not mutate the original object. It returns a new object with the properties in reverse order.
8
- * @param obj The object to reverse. The object's keys are of type `ObjectKey` and its values are of type `V`.
9
- * @returns A new object with the properties of the input object in reverse order. The returned object's keys are of type `ObjectKey` and its values are of type `V`.
10
- * @typeparam V - The type of the values in the input object and the returned object.
11
- * @example ```ts
12
- * objReverse({ a: 1, b: 2, c: 3 });;
13
- * //=> { c: 3, b: 2, a: 1 }
14
- * ```
15
- */
16
- function objReverse(obj) {
17
- return Object.fromEntries((0, objEntriesArray_1.objEntriesArray)(obj).reverse());
18
- }
19
- exports.objReverse = objReverse;
20
- //# sourceMappingURL=objReverse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objReverse.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objReverse.ts"],"names":[],"mappings":";;;AACA,uDAAmD;AAEnD;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CAAI,GAAyB;IACrD,OAAO,MAAM,CAAC,WAAW,CAAC,IAAA,iCAAe,EAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;AAC3D,CAAC;AAFD,gCAEC"}
@@ -1,21 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an iterable of the values of the given object.
4
- * @remarks This function uses the `Object.values()` method to get all the values of the object and then yields them one by one.
5
- * @typeparam V - The type of the values in the object.
6
- * @returns An iterable that yields all the values of the given object.
7
- * @param obj The object whose values should be returned.
8
- * @example ```ts
9
- * const obj = { a: 1, b: 2, c: 3 };
10
- * const values = objValues(obj);
11
- * for (const value of values) {
12
- * //=> {value}
13
- * }
14
- * // Output:
15
- * // 1
16
- * // 2
17
- * // 3
18
- * ```
19
- */
20
- export declare function objValues<V>(obj: Record<ObjectKey, V>): Iterable<V>;
21
- //# sourceMappingURL=objValues.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objValues.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAiB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAEpE"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objValues = void 0;
4
- /**
5
- * Returns an iterable of the values of the given object.
6
- * @remarks This function uses the `Object.values()` method to get all the values of the object and then yields them one by one.
7
- * @typeparam V - The type of the values in the object.
8
- * @returns An iterable that yields all the values of the given object.
9
- * @param obj The object whose values should be returned.
10
- * @example ```ts
11
- * const obj = { a: 1, b: 2, c: 3 };
12
- * const values = objValues(obj);
13
- * for (const value of values) {
14
- * //=> {value}
15
- * }
16
- * // Output:
17
- * // 1
18
- * // 2
19
- * // 3
20
- * ```
21
- */
22
- function* objValues(obj) {
23
- yield* Object.values(obj);
24
- }
25
- exports.objValues = objValues;
26
- //# sourceMappingURL=objValues.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objValues.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objValues.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAe,CAAC,CAAC,SAAS,CAAI,GAAyB;IACrD,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAFD,8BAEC"}
@@ -1,15 +0,0 @@
1
- import { ObjectKey } from '@bemoje/types';
2
- /**
3
- * Returns an array containing the values of the given object.
4
- * @remarks This function is a part of Object Utilities.
5
- * @typeparam V - The type of values in the object.
6
- * @returns An array of the values of the object.
7
- * @param obj The object whose values will be extracted.
8
- * @example ```ts
9
- * const obj = { a: 1, b: 2, c: 3 };
10
- * objValuesArray(obj);
11
- * //=> [1, 2, 3]
12
- * ```
13
- */
14
- export declare function objValuesArray<V>(obj: Record<ObjectKey, V>): Array<V>;
15
- //# sourceMappingURL=objValuesArray.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objValuesArray.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objValuesArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAErE"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.objValuesArray = void 0;
4
- /**
5
- * Returns an array containing the values of the given object.
6
- * @remarks This function is a part of Object Utilities.
7
- * @typeparam V - The type of values in the object.
8
- * @returns An array of the values of the object.
9
- * @param obj The object whose values will be extracted.
10
- * @example ```ts
11
- * const obj = { a: 1, b: 2, c: 3 };
12
- * objValuesArray(obj);
13
- * //=> [1, 2, 3]
14
- * ```
15
- */
16
- function objValuesArray(obj) {
17
- return Array.from(Object.values(obj));
18
- }
19
- exports.objValuesArray = objValuesArray;
20
- //# sourceMappingURL=objValuesArray.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objValuesArray.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/objValuesArray.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAAI,GAAyB;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Converts the given data to a JSON string.
3
- * @template T - The type of the data to be converted to JSON.
4
- * @param data The data to be converted to JSON.
5
- * @param pretty Optional parameter that determines whether the resulting JSON string should be pretty-printed. Default is `false`.
6
- * @returns The JSON string representation of the given data.
7
- * @example ```ts
8
- * toJson({ name: 'John', age: 30 }, true);;
9
- * //=> "{\n "name": "John",\n "age": 30\n}"
10
- * ```
11
- */
12
- export declare function toJson<T>(data: T, pretty?: boolean): string;
13
- //# sourceMappingURL=toJson.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../../packages/object/src/lib/toJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,UAAQ,GAAG,MAAM,CAEzD"}
package/cjs/lib/toJson.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toJson = void 0;
4
- /**
5
- * Converts the given data to a JSON string.
6
- * @template T - The type of the data to be converted to JSON.
7
- * @param data The data to be converted to JSON.
8
- * @param pretty Optional parameter that determines whether the resulting JSON string should be pretty-printed. Default is `false`.
9
- * @returns The JSON string representation of the given data.
10
- * @example ```ts
11
- * toJson({ name: 'John', age: 30 }, true);;
12
- * //=> "{\n "name": "John",\n "age": 30\n}"
13
- * ```
14
- */
15
- function toJson(data, pretty = false) {
16
- return pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
17
- }
18
- exports.toJson = toJson;
19
- //# sourceMappingURL=toJson.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toJson.js","sourceRoot":"","sources":["../../../../../packages/object/src/lib/toJson.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,SAAgB,MAAM,CAAI,IAAO,EAAE,MAAM,GAAG,KAAK;IAC/C,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACtE,CAAC;AAFD,wBAEC"}