@naturalcycles/js-lib 14.206.2 → 14.207.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import type { PropertyPath } from '../lodash.types';
2
- import { KeyValueTuple, SKIP } from '../types';
2
+ import { KeyValueTuple, Reviver, SKIP } from '../types';
3
3
  import type { AnyObject, ObjectMapper, ObjectPredicate, ValueOf } from '../types';
4
4
  /**
5
5
  * Returns clone of `obj` with only `props` preserved.
@@ -82,7 +82,7 @@ export declare function _objectNullValuesToUndefined<T extends AnyObject>(obj: T
82
82
  /**
83
83
  * Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo).
84
84
  */
85
- export declare function _deepCopy<T>(o: T): T;
85
+ export declare function _deepCopy<T>(o: T, reviver?: Reviver): T;
86
86
  /**
87
87
  * Returns `undefined` if it's empty (according to `_isEmpty()` specification),
88
88
  * otherwise returns the original object.
@@ -158,8 +158,8 @@ exports._objectNullValuesToUndefined = _objectNullValuesToUndefined;
158
158
  /**
159
159
  * Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo).
160
160
  */
161
- function _deepCopy(o) {
162
- return JSON.parse(JSON.stringify(o));
161
+ function _deepCopy(o, reviver) {
162
+ return JSON.parse(JSON.stringify(o), reviver);
163
163
  }
164
164
  exports._deepCopy = _deepCopy;
165
165
  /**
@@ -143,8 +143,8 @@ export function _objectNullValuesToUndefined(obj, mutate = false) {
143
143
  /**
144
144
  * Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo).
145
145
  */
146
- export function _deepCopy(o) {
147
- return JSON.parse(JSON.stringify(o));
146
+ export function _deepCopy(o, reviver) {
147
+ return JSON.parse(JSON.stringify(o), reviver);
148
148
  }
149
149
  /**
150
150
  * Returns `undefined` if it's empty (according to `_isEmpty()` specification),
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.206.2",
3
+ "version": "14.207.0",
4
4
  "scripts": {
5
- "prepare": "husky install",
5
+ "prepare": "husky",
6
6
  "build-prod": "build-prod-esm-cjs",
7
7
  "docs-dev": "vitepress dev docs --open",
8
8
  "docs-build": "vitepress build docs",
@@ -1,6 +1,6 @@
1
1
  import { _isEmpty, _isObject } from '../is.util'
2
2
  import type { PropertyPath } from '../lodash.types'
3
- import { _objectEntries, KeyValueTuple, SKIP } from '../types'
3
+ import { _objectEntries, KeyValueTuple, Reviver, SKIP } from '../types'
4
4
  import type { AnyObject, ObjectMapper, ObjectPredicate, ValueOf } from '../types'
5
5
 
6
6
  /**
@@ -186,8 +186,8 @@ export function _objectNullValuesToUndefined<T extends AnyObject>(obj: T, mutate
186
186
  /**
187
187
  * Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo).
188
188
  */
189
- export function _deepCopy<T>(o: T): T {
190
- return JSON.parse(JSON.stringify(o))
189
+ export function _deepCopy<T>(o: T, reviver?: Reviver): T {
190
+ return JSON.parse(JSON.stringify(o), reviver)
191
191
  }
192
192
 
193
193
  /**