@naturalcycles/js-lib 14.59.0 → 14.60.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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/string/safeJsonStringify.d.ts +7 -0
- package/dist/string/safeJsonStringify.js +38 -0
- package/dist/types.d.ts +1 -1
- package/dist-esm/index.js +2 -1
- package/dist-esm/string/safeJsonStringify.js +34 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/string/safeJsonStringify.ts +44 -0
- package/src/types.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,5 +55,6 @@ import { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdat
|
|
|
55
55
|
import { _gb, _hb, _kb, _mb } from './unit/size.util';
|
|
56
56
|
import { is } from './vendor/is';
|
|
57
57
|
import { CommonLogLevel, CommonLogFunction, CommonLogger, SimpleLogger, createSimpleLogger, noopLogger } from './log/commonLogger';
|
|
58
|
+
import { _safeJsonStringify } from './string/safeJsonStringify';
|
|
58
59
|
export type { MemoCache, PromiseDecoratorCfg, PromiseDecoratorResp, ErrorData, ErrorObject, HttpErrorData, HttpErrorResponse, Admin401ErrorData, Admin403ErrorData, StringMap, PromiseMap, AnyObject, AnyFunction, ValuesOf, ValueOf, KeyValueTuple, ObjectMapper, ObjectPredicate, InstanceId, IsoDate, IsoDateTime, Reviver, PMapOptions, Mapper, AsyncMapper, Predicate, AsyncPredicate, BatchResult, DeferredPromise, PRetryOptions, PTimeoutOptions, TryCatchOptions, StringifyAnyOptions, JsonStringifyFunction, Merge, ReadonlyDeep, Promisable, PromiseValue, Simplify, ConditionalPick, ConditionalExcept, Class, UnixTimestamp, BaseDBEntity, SavedDBEntity, Saved, Unsaved, CreatedUpdated, CreatedUpdatedId, ObjectWithId, AnyObjectWithId, JsonSchema, JsonSchemaAny, JsonSchemaOneOf, JsonSchemaAllOf, JsonSchemaAnyOf, JsonSchemaNot, JsonSchemaRef, JsonSchemaConst, JsonSchemaEnum, JsonSchemaString, JsonSchemaNumber, JsonSchemaBoolean, JsonSchemaNull, JsonSchemaRootObject, JsonSchemaObject, JsonSchemaArray, JsonSchemaTuple, JsonSchemaBuilder, CommonLogLevel, CommonLogFunction, CommonLogger, SimpleLogger, };
|
|
59
|
-
export { is, _Memo, _memoFn, _LogMethod, _getArgsSignature, _createPromiseDecorator, AppError, HttpError, AssertionError, _isErrorObject, _isHttpErrorObject, _isHttpErrorResponse, _assert, _assertEquals, _assertDeepEquals, _assertIsError, _assertIsString, _assertIsNumber, _assertTypeOf, _randomInt, _randomArrayItem, _createDeterministicRandom, _inRange, _stringMapValues, _stringMapEntries, _objectKeys, _capitalize, _upperFirst, _lowerFirst, _split, _removeWhitespace, _substringBefore, _substringBeforeLast, _substringAfter, _substringAfterLast, _substringBetweenLast, _replaceAll, _nl2br, _truncate, _truncateMiddle, _pick, _omit, _filterFalsyValues, _filterUndefinedValues, _filterNullishValues, _filterEmptyArrays, _filterEmptyValues, _filterObject, _undefinedIfEmpty, _isObject, _isPrimitive, _mapKeys, _mapValues, _mapObject, _objectNullValuesToUndefined, _deepEquals, _deepCopy, _isEmptyObject, _isEmpty, _merge, _deepTrim, _sortObjectDeep, _sortObject, _get, _set, _has, _unset, _mask, _invert, _invertMap, _by, _groupBy, _sortBy, _sortNumbers, _toFixed, _toPrecision, _round, _findLast, _takeWhile, _takeRightWhile, _dropWhile, _dropRightWhile, _countBy, _intersection, _difference, _shuffle, _mapToObject, _findKeyByValue, _anyToError, _anyToErrorObject, _errorToErrorObject, _errorObjectToAppError, _range, _uniq, _uniqBy, _flatten, _flattenDeep, _chunk, SimpleMovingAverage, _average, _averageWeighted, _percentile, _median, _debounce, _throttle, _Debounce, _Throttle, pMap, _passthroughMapper, _passUndefinedMapper, _passthroughPredicate, _passNothingPredicate, _noop, pBatch, ErrorMode, pFilter, pProps, pDelay, pDefer, pHang, pState, AggregatedError, pRetry, pTimeout, pTuple, _Retry, _Timeout, _tryCatch, _TryCatch, _try, pTry, _jsonParseIfPossible, _stringifyAny, _ms, _since, _hb, _gb, _mb, _kb, _snakeCase, _camelCase, _kebabCase, _sum, _sumBy, _clamp, _last, mergeJsonSchemaObjects, jsonSchema, JsonSchemaAnyBuilder, JSON_SCHEMA_ORDER, generateJsonSchemaFromData, _parseQueryString, _defineLazyProperty, _defineLazyProps, _lazyValue, createSimpleLogger, noopLogger, };
|
|
60
|
+
export { is, _Memo, _memoFn, _LogMethod, _getArgsSignature, _createPromiseDecorator, AppError, HttpError, AssertionError, _isErrorObject, _isHttpErrorObject, _isHttpErrorResponse, _assert, _assertEquals, _assertDeepEquals, _assertIsError, _assertIsString, _assertIsNumber, _assertTypeOf, _randomInt, _randomArrayItem, _createDeterministicRandom, _inRange, _stringMapValues, _stringMapEntries, _objectKeys, _capitalize, _upperFirst, _lowerFirst, _split, _removeWhitespace, _substringBefore, _substringBeforeLast, _substringAfter, _substringAfterLast, _substringBetweenLast, _replaceAll, _nl2br, _truncate, _truncateMiddle, _pick, _omit, _filterFalsyValues, _filterUndefinedValues, _filterNullishValues, _filterEmptyArrays, _filterEmptyValues, _filterObject, _undefinedIfEmpty, _isObject, _isPrimitive, _mapKeys, _mapValues, _mapObject, _objectNullValuesToUndefined, _deepEquals, _deepCopy, _isEmptyObject, _isEmpty, _merge, _deepTrim, _sortObjectDeep, _sortObject, _get, _set, _has, _unset, _mask, _invert, _invertMap, _by, _groupBy, _sortBy, _sortNumbers, _toFixed, _toPrecision, _round, _findLast, _takeWhile, _takeRightWhile, _dropWhile, _dropRightWhile, _countBy, _intersection, _difference, _shuffle, _mapToObject, _findKeyByValue, _anyToError, _anyToErrorObject, _errorToErrorObject, _errorObjectToAppError, _range, _uniq, _uniqBy, _flatten, _flattenDeep, _chunk, SimpleMovingAverage, _average, _averageWeighted, _percentile, _median, _debounce, _throttle, _Debounce, _Throttle, pMap, _passthroughMapper, _passUndefinedMapper, _passthroughPredicate, _passNothingPredicate, _noop, pBatch, ErrorMode, pFilter, pProps, pDelay, pDefer, pHang, pState, AggregatedError, pRetry, pTimeout, pTuple, _Retry, _Timeout, _tryCatch, _TryCatch, _try, pTry, _jsonParseIfPossible, _stringifyAny, _ms, _since, _hb, _gb, _mb, _kb, _snakeCase, _camelCase, _kebabCase, _sum, _sumBy, _clamp, _last, mergeJsonSchemaObjects, jsonSchema, JsonSchemaAnyBuilder, JSON_SCHEMA_ORDER, generateJsonSchemaFromData, _parseQueryString, _defineLazyProperty, _defineLazyProps, _lazyValue, createSimpleLogger, noopLogger, _safeJsonStringify, };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports._isObject = exports._undefinedIfEmpty = exports._filterObject = exports._filterEmptyValues = exports._filterEmptyArrays = exports._filterNullishValues = exports._filterUndefinedValues = exports._filterFalsyValues = exports._omit = exports._pick = exports._truncateMiddle = exports._truncate = exports._nl2br = exports._replaceAll = exports._substringBetweenLast = exports._substringAfterLast = exports._substringAfter = exports._substringBeforeLast = exports._substringBefore = exports._removeWhitespace = exports._split = exports._lowerFirst = exports._upperFirst = exports._capitalize = exports._objectKeys = exports._stringMapEntries = exports._stringMapValues = exports._inRange = exports._createDeterministicRandom = exports._randomArrayItem = exports._randomInt = exports._assertTypeOf = exports._assertIsNumber = exports._assertIsString = exports._assertIsError = exports._assertDeepEquals = exports._assertEquals = exports._assert = exports._isHttpErrorResponse = exports._isHttpErrorObject = exports._isErrorObject = exports.AssertionError = exports.HttpError = exports.AppError = exports._createPromiseDecorator = exports._getArgsSignature = exports._LogMethod = exports._memoFn = exports._Memo = exports.is = void 0;
|
|
4
4
|
exports._average = exports.SimpleMovingAverage = exports._chunk = exports._flattenDeep = exports._flatten = exports._uniqBy = exports._uniq = exports._range = exports._errorObjectToAppError = exports._errorToErrorObject = exports._anyToErrorObject = exports._anyToError = exports._findKeyByValue = exports._mapToObject = exports._shuffle = exports._difference = exports._intersection = exports._countBy = exports._dropRightWhile = exports._dropWhile = exports._takeRightWhile = exports._takeWhile = exports._findLast = exports._round = exports._toPrecision = exports._toFixed = exports._sortNumbers = exports._sortBy = exports._groupBy = exports._by = exports._invertMap = exports._invert = exports._mask = exports._unset = exports._has = exports._set = exports._get = exports._sortObject = exports._sortObjectDeep = exports._deepTrim = exports._merge = exports._isEmpty = exports._isEmptyObject = exports._deepCopy = exports._deepEquals = exports._objectNullValuesToUndefined = exports._mapObject = exports._mapValues = exports._mapKeys = exports._isPrimitive = void 0;
|
|
5
5
|
exports.JSON_SCHEMA_ORDER = exports.JsonSchemaAnyBuilder = exports.jsonSchema = exports.mergeJsonSchemaObjects = exports._last = exports._clamp = exports._sumBy = exports._sum = exports._kebabCase = exports._camelCase = exports._snakeCase = exports._kb = exports._mb = exports._gb = exports._hb = exports._since = exports._ms = exports._stringifyAny = exports._jsonParseIfPossible = exports.pTry = exports._try = exports._TryCatch = exports._tryCatch = exports._Timeout = exports._Retry = exports.pTuple = exports.pTimeout = exports.pRetry = exports.AggregatedError = exports.pState = exports.pHang = exports.pDefer = exports.pDelay = exports.pProps = exports.pFilter = exports.ErrorMode = exports.pBatch = exports._noop = exports._passNothingPredicate = exports._passthroughPredicate = exports._passUndefinedMapper = exports._passthroughMapper = exports.pMap = exports._Throttle = exports._Debounce = exports._throttle = exports._debounce = exports._median = exports._percentile = exports._averageWeighted = void 0;
|
|
6
|
-
exports.noopLogger = exports.createSimpleLogger = exports._lazyValue = exports._defineLazyProps = exports._defineLazyProperty = exports._parseQueryString = exports.generateJsonSchemaFromData = void 0;
|
|
6
|
+
exports._safeJsonStringify = exports.noopLogger = exports.createSimpleLogger = exports._lazyValue = exports._defineLazyProps = exports._defineLazyProperty = exports._parseQueryString = exports.generateJsonSchemaFromData = void 0;
|
|
7
7
|
const array_util_1 = require("./array/array.util");
|
|
8
8
|
Object.defineProperty(exports, "_by", { enumerable: true, get: function () { return array_util_1._by; } });
|
|
9
9
|
Object.defineProperty(exports, "_chunk", { enumerable: true, get: function () { return array_util_1._chunk; } });
|
|
@@ -214,3 +214,5 @@ Object.defineProperty(exports, "is", { enumerable: true, get: function () { retu
|
|
|
214
214
|
const commonLogger_1 = require("./log/commonLogger");
|
|
215
215
|
Object.defineProperty(exports, "createSimpleLogger", { enumerable: true, get: function () { return commonLogger_1.createSimpleLogger; } });
|
|
216
216
|
Object.defineProperty(exports, "noopLogger", { enumerable: true, get: function () { return commonLogger_1.noopLogger; } });
|
|
217
|
+
const safeJsonStringify_1 = require("./string/safeJsonStringify");
|
|
218
|
+
Object.defineProperty(exports, "_safeJsonStringify", { enumerable: true, get: function () { return safeJsonStringify_1._safeJsonStringify; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Reviver } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* JSON.stringify that avoids circular references, prints them as [Circular ~]
|
|
4
|
+
*
|
|
5
|
+
* Based on: https://github.com/moll/json-stringify-safe/
|
|
6
|
+
*/
|
|
7
|
+
export declare function _safeJsonStringify(obj: any, replacer?: Reviver, spaces?: number, cycleReplacer?: Reviver): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._safeJsonStringify = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* JSON.stringify that avoids circular references, prints them as [Circular ~]
|
|
6
|
+
*
|
|
7
|
+
* Based on: https://github.com/moll/json-stringify-safe/
|
|
8
|
+
*/
|
|
9
|
+
function _safeJsonStringify(obj, replacer, spaces, cycleReplacer) {
|
|
10
|
+
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
|
|
11
|
+
}
|
|
12
|
+
exports._safeJsonStringify = _safeJsonStringify;
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions, no-bitwise */
|
|
14
|
+
function serializer(replacer, cycleReplacer) {
|
|
15
|
+
const stack = [];
|
|
16
|
+
const keys = [];
|
|
17
|
+
if (cycleReplacer == null) {
|
|
18
|
+
cycleReplacer = function (key, value) {
|
|
19
|
+
if (stack[0] === value)
|
|
20
|
+
return '[Circular ~]';
|
|
21
|
+
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']';
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return function (key, value) {
|
|
25
|
+
if (stack.length > 0) {
|
|
26
|
+
const thisPos = stack.indexOf(this);
|
|
27
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
|
|
28
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
|
|
29
|
+
if (~stack.indexOf(value)) {
|
|
30
|
+
value = cycleReplacer.call(this, key, value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
stack.push(value);
|
|
35
|
+
}
|
|
36
|
+
return replacer == null ? value : replacer.call(this, key, value);
|
|
37
|
+
};
|
|
38
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -136,7 +136,7 @@ export declare type BaseDBEntity = Partial<SavedDBEntity>;
|
|
|
136
136
|
export declare type Saved<E> = Merge<E, SavedDBEntity>;
|
|
137
137
|
export declare type Unsaved<E> = Merge<E, BaseDBEntity>;
|
|
138
138
|
/**
|
|
139
|
-
* Named type for JSON.parse second argument
|
|
139
|
+
* Named type for JSON.parse / JSON.stringify second argument
|
|
140
140
|
*/
|
|
141
141
|
export declare type Reviver = (this: any, key: string, value: any) => any;
|
|
142
142
|
/**
|
package/dist-esm/index.js
CHANGED
|
@@ -51,4 +51,5 @@ import { _noop, _objectKeys, _passNothingPredicate, _passthroughMapper, _passthr
|
|
|
51
51
|
import { _gb, _hb, _kb, _mb } from './unit/size.util';
|
|
52
52
|
import { is } from './vendor/is';
|
|
53
53
|
import { createSimpleLogger, noopLogger, } from './log/commonLogger';
|
|
54
|
-
|
|
54
|
+
import { _safeJsonStringify } from './string/safeJsonStringify';
|
|
55
|
+
export { is, _Memo, _memoFn, _LogMethod, _getArgsSignature, _createPromiseDecorator, AppError, HttpError, AssertionError, _isErrorObject, _isHttpErrorObject, _isHttpErrorResponse, _assert, _assertEquals, _assertDeepEquals, _assertIsError, _assertIsString, _assertIsNumber, _assertTypeOf, _randomInt, _randomArrayItem, _createDeterministicRandom, _inRange, _stringMapValues, _stringMapEntries, _objectKeys, _capitalize, _upperFirst, _lowerFirst, _split, _removeWhitespace, _substringBefore, _substringBeforeLast, _substringAfter, _substringAfterLast, _substringBetweenLast, _replaceAll, _nl2br, _truncate, _truncateMiddle, _pick, _omit, _filterFalsyValues, _filterUndefinedValues, _filterNullishValues, _filterEmptyArrays, _filterEmptyValues, _filterObject, _undefinedIfEmpty, _isObject, _isPrimitive, _mapKeys, _mapValues, _mapObject, _objectNullValuesToUndefined, _deepEquals, _deepCopy, _isEmptyObject, _isEmpty, _merge, _deepTrim, _sortObjectDeep, _sortObject, _get, _set, _has, _unset, _mask, _invert, _invertMap, _by, _groupBy, _sortBy, _sortNumbers, _toFixed, _toPrecision, _round, _findLast, _takeWhile, _takeRightWhile, _dropWhile, _dropRightWhile, _countBy, _intersection, _difference, _shuffle, _mapToObject, _findKeyByValue, _anyToError, _anyToErrorObject, _errorToErrorObject, _errorObjectToAppError, _range, _uniq, _uniqBy, _flatten, _flattenDeep, _chunk, SimpleMovingAverage, _average, _averageWeighted, _percentile, _median, _debounce, _throttle, _Debounce, _Throttle, pMap, _passthroughMapper, _passUndefinedMapper, _passthroughPredicate, _passNothingPredicate, _noop, pBatch, ErrorMode, pFilter, pProps, pDelay, pDefer, pHang, pState, AggregatedError, pRetry, pTimeout, pTuple, _Retry, _Timeout, _tryCatch, _TryCatch, _try, pTry, _jsonParseIfPossible, _stringifyAny, _ms, _since, _hb, _gb, _mb, _kb, _snakeCase, _camelCase, _kebabCase, _sum, _sumBy, _clamp, _last, mergeJsonSchemaObjects, jsonSchema, JsonSchemaAnyBuilder, JSON_SCHEMA_ORDER, generateJsonSchemaFromData, _parseQueryString, _defineLazyProperty, _defineLazyProps, _lazyValue, createSimpleLogger, noopLogger, _safeJsonStringify, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON.stringify that avoids circular references, prints them as [Circular ~]
|
|
3
|
+
*
|
|
4
|
+
* Based on: https://github.com/moll/json-stringify-safe/
|
|
5
|
+
*/
|
|
6
|
+
export function _safeJsonStringify(obj, replacer, spaces, cycleReplacer) {
|
|
7
|
+
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
|
|
8
|
+
}
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions, no-bitwise */
|
|
10
|
+
function serializer(replacer, cycleReplacer) {
|
|
11
|
+
const stack = [];
|
|
12
|
+
const keys = [];
|
|
13
|
+
if (cycleReplacer == null) {
|
|
14
|
+
cycleReplacer = function (key, value) {
|
|
15
|
+
if (stack[0] === value)
|
|
16
|
+
return '[Circular ~]';
|
|
17
|
+
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']';
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return function (key, value) {
|
|
21
|
+
if (stack.length > 0) {
|
|
22
|
+
const thisPos = stack.indexOf(this);
|
|
23
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
|
|
24
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
|
|
25
|
+
if (~stack.indexOf(value)) {
|
|
26
|
+
value = cycleReplacer.call(this, key, value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
stack.push(value);
|
|
31
|
+
}
|
|
32
|
+
return replacer == null ? value : replacer.call(this, key, value);
|
|
33
|
+
};
|
|
34
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -232,6 +232,7 @@ import {
|
|
|
232
232
|
createSimpleLogger,
|
|
233
233
|
noopLogger,
|
|
234
234
|
} from './log/commonLogger'
|
|
235
|
+
import { _safeJsonStringify } from './string/safeJsonStringify'
|
|
235
236
|
|
|
236
237
|
export type {
|
|
237
238
|
MemoCache,
|
|
@@ -467,4 +468,5 @@ export {
|
|
|
467
468
|
_lazyValue,
|
|
468
469
|
createSimpleLogger,
|
|
469
470
|
noopLogger,
|
|
471
|
+
_safeJsonStringify,
|
|
470
472
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Reviver } from '../types'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* JSON.stringify that avoids circular references, prints them as [Circular ~]
|
|
5
|
+
*
|
|
6
|
+
* Based on: https://github.com/moll/json-stringify-safe/
|
|
7
|
+
*/
|
|
8
|
+
export function _safeJsonStringify(
|
|
9
|
+
obj: any,
|
|
10
|
+
replacer?: Reviver,
|
|
11
|
+
spaces?: number,
|
|
12
|
+
cycleReplacer?: Reviver,
|
|
13
|
+
): string {
|
|
14
|
+
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions, no-bitwise */
|
|
18
|
+
|
|
19
|
+
function serializer(replacer?: Reviver, cycleReplacer?: Reviver): Reviver {
|
|
20
|
+
const stack: any[] = []
|
|
21
|
+
const keys: string[] = []
|
|
22
|
+
|
|
23
|
+
if (cycleReplacer == null) {
|
|
24
|
+
cycleReplacer = function (key, value) {
|
|
25
|
+
if (stack[0] === value) return '[Circular ~]'
|
|
26
|
+
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return function (key, value) {
|
|
31
|
+
if (stack.length > 0) {
|
|
32
|
+
const thisPos = stack.indexOf(this)
|
|
33
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
|
|
34
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
|
|
35
|
+
if (~stack.indexOf(value)) {
|
|
36
|
+
value = cycleReplacer!.call(this, key, value)
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
stack.push(value)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return replacer == null ? value : replacer.call(this, key, value)
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -165,7 +165,7 @@ export type Saved<E> = Merge<E, SavedDBEntity>
|
|
|
165
165
|
export type Unsaved<E> = Merge<E, BaseDBEntity>
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
|
-
* Named type for JSON.parse second argument
|
|
168
|
+
* Named type for JSON.parse / JSON.stringify second argument
|
|
169
169
|
*/
|
|
170
170
|
export type Reviver = (this: any, key: string, value: any) => any
|
|
171
171
|
|