@naturalcycles/js-lib 14.54.0 → 14.57.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/error/app.error.js +7 -3
- package/dist/error/assert.d.ts +1 -1
- package/dist/error/assert.js +1 -16
- package/dist/error/http.error.js +0 -15
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -1
- package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +2 -2
- package/dist/json-schema/jsonSchema.model.d.ts +3 -3
- package/dist/json-schema/jsonSchemaBuilder.d.ts +5 -5
- package/dist/lazy.d.ts +26 -0
- package/dist/lazy.js +55 -0
- package/dist/object/object.util.d.ts +23 -23
- package/dist/object/sortObject.d.ts +2 -1
- package/dist/promise/AggregatedError.js +1 -2
- package/dist/string/url.util.d.ts +15 -0
- package/dist/string/url.util.js +30 -0
- package/dist/types.d.ts +1 -1
- package/dist-esm/error/app.error.js +7 -3
- package/dist-esm/error/assert.js +1 -16
- package/dist-esm/error/http.error.js +0 -15
- package/dist-esm/index.js +3 -1
- package/dist-esm/lazy.js +50 -0
- package/dist-esm/promise/AggregatedError.js +1 -2
- package/dist-esm/string/url.util.js +26 -0
- package/package.json +2 -3
- package/src/error/app.error.ts +11 -3
- package/src/error/assert.ts +1 -17
- package/src/error/http.error.ts +0 -16
- package/src/index.ts +5 -0
- package/src/json-schema/from-data/generateJsonSchemaFromData.ts +3 -2
- package/src/json-schema/jsonSchema.model.ts +3 -5
- package/src/json-schema/jsonSchemaBuilder.ts +5 -6
- package/src/lazy.ts +62 -0
- package/src/object/object.util.ts +23 -31
- package/src/object/sortObject.ts +2 -2
- package/src/promise/AggregatedError.ts +1 -2
- package/src/string/url.util.ts +27 -0
- package/src/types.ts +1 -1
- package/CHANGELOG.md +0 -1328
package/dist/error/app.error.js
CHANGED
|
@@ -13,19 +13,23 @@ exports.AppError = void 0;
|
|
|
13
13
|
class AppError extends Error {
|
|
14
14
|
constructor(message, data = {}) {
|
|
15
15
|
super(message);
|
|
16
|
-
this.data = data;
|
|
17
|
-
this.constructor = AppError;
|
|
18
|
-
this.__proto__ = AppError.prototype;
|
|
19
16
|
Object.defineProperty(this, 'name', {
|
|
20
17
|
value: this.constructor.name,
|
|
21
18
|
configurable: true,
|
|
22
19
|
});
|
|
20
|
+
Object.defineProperty(this, 'data', {
|
|
21
|
+
value: data,
|
|
22
|
+
writable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
enumerable: false,
|
|
25
|
+
});
|
|
23
26
|
if (Error.captureStackTrace) {
|
|
24
27
|
Error.captureStackTrace(this, this.constructor);
|
|
25
28
|
}
|
|
26
29
|
else {
|
|
27
30
|
Object.defineProperty(this, 'stack', {
|
|
28
31
|
value: new Error().stack,
|
|
32
|
+
writable: true,
|
|
29
33
|
configurable: true,
|
|
30
34
|
});
|
|
31
35
|
}
|
package/dist/error/assert.d.ts
CHANGED
|
@@ -36,5 +36,5 @@ export declare function _assertIsString(v: any, message?: string): asserts v is
|
|
|
36
36
|
export declare function _assertIsNumber(v: any, message?: string): asserts v is number;
|
|
37
37
|
export declare function _assertTypeOf<T>(v: any, expectedType: string, message?: string): asserts v is T;
|
|
38
38
|
export declare class AssertionError extends AppError {
|
|
39
|
-
constructor(message: string, data
|
|
39
|
+
constructor(message: string, data?: ErrorData);
|
|
40
40
|
}
|
package/dist/error/assert.js
CHANGED
|
@@ -103,23 +103,8 @@ function _assertTypeOf(v, expectedType, message) {
|
|
|
103
103
|
}
|
|
104
104
|
exports._assertTypeOf = _assertTypeOf;
|
|
105
105
|
class AssertionError extends app_error_1.AppError {
|
|
106
|
-
constructor(message, data) {
|
|
106
|
+
constructor(message, data = {}) {
|
|
107
107
|
super(message, data);
|
|
108
|
-
this.constructor = AssertionError;
|
|
109
|
-
this.__proto__ = AssertionError.prototype;
|
|
110
|
-
Object.defineProperty(this, 'name', {
|
|
111
|
-
value: this.constructor.name,
|
|
112
|
-
configurable: true, // otherwise throws with "TypeError: Cannot redefine property: name"
|
|
113
|
-
});
|
|
114
|
-
if (Error.captureStackTrace) {
|
|
115
|
-
Error.captureStackTrace(this, this.constructor);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
Object.defineProperty(this, 'stack', {
|
|
119
|
-
value: new Error().stack,
|
|
120
|
-
configurable: true,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
108
|
}
|
|
124
109
|
}
|
|
125
110
|
exports.AssertionError = AssertionError;
|
package/dist/error/http.error.js
CHANGED
|
@@ -8,21 +8,6 @@ const app_error_1 = require("./app.error");
|
|
|
8
8
|
class HttpError extends app_error_1.AppError {
|
|
9
9
|
constructor(message, data) {
|
|
10
10
|
super(message, data);
|
|
11
|
-
this.constructor = HttpError;
|
|
12
|
-
this.__proto__ = HttpError.prototype;
|
|
13
|
-
Object.defineProperty(this, 'name', {
|
|
14
|
-
value: this.constructor.name,
|
|
15
|
-
configurable: true, // otherwise throws with "TypeError: Cannot redefine property: name"
|
|
16
|
-
});
|
|
17
|
-
if (Error.captureStackTrace) {
|
|
18
|
-
Error.captureStackTrace(this, this.constructor);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
Object.defineProperty(this, 'stack', {
|
|
22
|
-
value: new Error().stack,
|
|
23
|
-
configurable: true,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
11
|
}
|
|
27
12
|
}
|
|
28
13
|
exports.HttpError = HttpError;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { _by, _chunk, _countBy, _difference, _dropRightWhile, _dropWhile, _findLast, _flatten, _flattenDeep, _groupBy, _intersection, _last, _mapToObject, _shuffle, _sortBy, _sum, _sumBy, _takeRightWhile, _takeWhile, _uniq, _uniqBy } from './array/array.util';
|
|
2
|
+
import { _defineLazyProperty, _lazyValue } from './lazy';
|
|
3
|
+
import { _parseQueryString } from './string/url.util';
|
|
2
4
|
import { _range } from './array/range';
|
|
3
5
|
import { PromiseDecoratorCfg, PromiseDecoratorResp, _createPromiseDecorator } from './decorators/createPromiseDecorator';
|
|
4
6
|
import { _debounce, _throttle } from './decorators/debounce';
|
|
@@ -53,4 +55,4 @@ import { AsyncMapper, AsyncPredicate, BaseDBEntity, CreatedUpdated, CreatedUpdat
|
|
|
53
55
|
import { _gb, _hb, _kb, _mb } from './unit/size.util';
|
|
54
56
|
import { is } from './vendor/is';
|
|
55
57
|
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, };
|
|
56
|
-
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, };
|
|
58
|
+
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, _lazyValue, };
|
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.generateJsonSchemaFromData = void 0;
|
|
6
|
+
exports._lazyValue = 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; } });
|
|
@@ -26,6 +26,11 @@ Object.defineProperty(exports, "_takeRightWhile", { enumerable: true, get: funct
|
|
|
26
26
|
Object.defineProperty(exports, "_takeWhile", { enumerable: true, get: function () { return array_util_1._takeWhile; } });
|
|
27
27
|
Object.defineProperty(exports, "_uniq", { enumerable: true, get: function () { return array_util_1._uniq; } });
|
|
28
28
|
Object.defineProperty(exports, "_uniqBy", { enumerable: true, get: function () { return array_util_1._uniqBy; } });
|
|
29
|
+
const lazy_1 = require("./lazy");
|
|
30
|
+
Object.defineProperty(exports, "_defineLazyProperty", { enumerable: true, get: function () { return lazy_1._defineLazyProperty; } });
|
|
31
|
+
Object.defineProperty(exports, "_lazyValue", { enumerable: true, get: function () { return lazy_1._lazyValue; } });
|
|
32
|
+
const url_util_1 = require("./string/url.util");
|
|
33
|
+
Object.defineProperty(exports, "_parseQueryString", { enumerable: true, get: function () { return url_util_1._parseQueryString; } });
|
|
29
34
|
const range_1 = require("./array/range");
|
|
30
35
|
Object.defineProperty(exports, "_range", { enumerable: true, get: function () { return range_1._range; } });
|
|
31
36
|
const createPromiseDecorator_1 = require("./decorators/createPromiseDecorator");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonSchemaObject } from '../..';
|
|
1
|
+
import { JsonSchemaObject, AnyObject } from '../..';
|
|
2
2
|
/**
|
|
3
3
|
* Each row must be an object (current limitation).
|
|
4
4
|
*
|
|
5
5
|
* `additionalProperties` is set to `true`, cause it's safer.
|
|
6
6
|
*/
|
|
7
|
-
export declare function generateJsonSchemaFromData<T = unknown>(rows:
|
|
7
|
+
export declare function generateJsonSchemaFromData<T = unknown>(rows: AnyObject[]): JsonSchemaObject<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StringMap } from '../types';
|
|
1
|
+
import { AnyObject, StringMap } from '../types';
|
|
2
2
|
export declare type JsonSchema<T = unknown> = JsonSchemaAny<T> | JsonSchemaOneOf<T> | JsonSchemaAllOf<T> | JsonSchemaAnyOf<T> | JsonSchemaNot<T> | JsonSchemaRef<T> | JsonSchemaConst<T> | JsonSchemaEnum<T> | JsonSchemaString | JsonSchemaNumber | JsonSchemaBoolean | JsonSchemaNull | JsonSchemaObject<T> | JsonSchemaArray<T> | JsonSchemaTuple<T>;
|
|
3
3
|
export interface JsonSchemaAny<T = unknown> {
|
|
4
4
|
$schema?: string;
|
|
@@ -81,10 +81,10 @@ export interface JsonSchemaEnum<T = unknown> extends JsonSchemaAny<T> {
|
|
|
81
81
|
export interface JsonSchemaRef<T = unknown> extends JsonSchemaAny<T> {
|
|
82
82
|
$ref: string;
|
|
83
83
|
}
|
|
84
|
-
export interface JsonSchemaRootObject<T extends
|
|
84
|
+
export interface JsonSchemaRootObject<T extends AnyObject = AnyObject> extends JsonSchemaObject<T> {
|
|
85
85
|
$id: string;
|
|
86
86
|
}
|
|
87
|
-
export interface JsonSchemaObject<T extends
|
|
87
|
+
export interface JsonSchemaObject<T extends AnyObject = AnyObject> extends JsonSchemaAny<T> {
|
|
88
88
|
type: 'object';
|
|
89
89
|
properties: {
|
|
90
90
|
[k in keyof T]: JsonSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple, SavedDBEntity } from '../index';
|
|
2
|
+
import { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple, SavedDBEntity, AnyObject } from '../index';
|
|
3
3
|
import { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model';
|
|
4
4
|
export interface JsonSchemaBuilder<T = unknown> {
|
|
5
5
|
build(): JsonSchema<T>;
|
|
@@ -21,8 +21,8 @@ export declare const jsonSchema: {
|
|
|
21
21
|
unixTimestamp(): JsonSchemaNumberBuilder;
|
|
22
22
|
string(): JsonSchemaStringBuilder;
|
|
23
23
|
dateString(): JsonSchemaStringBuilder;
|
|
24
|
-
object<T_4 extends
|
|
25
|
-
rootObject<T_5 extends
|
|
24
|
+
object<T_4 extends AnyObject>(props: { [k in keyof T_4]: JsonSchemaAnyBuilder<T_4[k], JsonSchema<T_4[k]>>; }): JsonSchemaObjectBuilder<T_4>;
|
|
25
|
+
rootObject<T_5 extends AnyObject>(props: { [k_1 in keyof T_5]: JsonSchemaAnyBuilder<T_5[k_1], JsonSchema<T_5[k_1]>>; }): JsonSchemaObjectBuilder<T_5>;
|
|
26
26
|
array<ITEM = unknown>(itemSchema: JsonSchemaAnyBuilder<ITEM, JsonSchema<ITEM>>): JsonSchemaArrayBuilder<ITEM>;
|
|
27
27
|
tuple<T_6 extends any[] = unknown[]>(items: JsonSchemaAnyBuilder[]): JsonSchemaTupleBuilder<T_6>;
|
|
28
28
|
oneOf<T_7 = unknown>(items: JsonSchemaAnyBuilder[]): JsonSchemaAnyBuilder<T_7, JsonSchemaOneOf<T_7>>;
|
|
@@ -100,7 +100,7 @@ export declare class JsonSchemaStringBuilder extends JsonSchemaAnyBuilder<string
|
|
|
100
100
|
toUpperCase: (toUpperCase?: boolean) => this;
|
|
101
101
|
private transformModify;
|
|
102
102
|
}
|
|
103
|
-
export declare class JsonSchemaObjectBuilder<T extends
|
|
103
|
+
export declare class JsonSchemaObjectBuilder<T extends AnyObject> extends JsonSchemaAnyBuilder<T, JsonSchemaObject<T>> {
|
|
104
104
|
constructor();
|
|
105
105
|
addProperties(props: {
|
|
106
106
|
[k in keyof T]: JsonSchemaBuilder<T[k]>;
|
|
@@ -115,7 +115,7 @@ export declare class JsonSchemaObjectBuilder<T extends Record<any, any>> extends
|
|
|
115
115
|
additionalProps(additionalProperties: boolean): this;
|
|
116
116
|
baseDBEntity(): JsonSchemaObjectBuilder<T & BaseDBEntity>;
|
|
117
117
|
savedDBEntity(): JsonSchemaObjectBuilder<T & SavedDBEntity>;
|
|
118
|
-
extend<T2 extends
|
|
118
|
+
extend<T2 extends AnyObject>(s2: JsonSchemaObjectBuilder<T2>): JsonSchemaObjectBuilder<T & T2>;
|
|
119
119
|
}
|
|
120
120
|
export declare class JsonSchemaArrayBuilder<ITEM> extends JsonSchemaAnyBuilder<ITEM[], JsonSchemaArray<ITEM>> {
|
|
121
121
|
constructor(itemsSchema: JsonSchemaBuilder<ITEM>);
|
package/dist/lazy.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AnyFunction, AnyObject } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* const value = lazyValue(() => expensiveComputation())
|
|
4
|
+
*
|
|
5
|
+
* value() // calls expensiveComputation() once
|
|
6
|
+
* value() // returns cached result
|
|
7
|
+
* value() // returns cached result
|
|
8
|
+
*
|
|
9
|
+
* Based on: https://github.com/sindresorhus/lazy-value
|
|
10
|
+
*/
|
|
11
|
+
export declare function _lazyValue<T extends AnyFunction>(fn: T): T;
|
|
12
|
+
/**
|
|
13
|
+
* interface Obj {
|
|
14
|
+
* v: number
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* const obj = {} as Obj
|
|
18
|
+
*
|
|
19
|
+
* _defineLazyProperty(obj, 'v', () => expensiveComputation())
|
|
20
|
+
* obj.v // runs expensiveComputation() once
|
|
21
|
+
* obj.v // cached value
|
|
22
|
+
* obj.v // cached value
|
|
23
|
+
*
|
|
24
|
+
* Based on: https://github.com/sindresorhus/define-lazy-prop
|
|
25
|
+
*/
|
|
26
|
+
export declare function _defineLazyProperty<OBJ extends AnyObject>(obj: OBJ, propertyName: keyof OBJ, fn: AnyFunction): OBJ;
|
package/dist/lazy.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._defineLazyProperty = exports._lazyValue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* const value = lazyValue(() => expensiveComputation())
|
|
6
|
+
*
|
|
7
|
+
* value() // calls expensiveComputation() once
|
|
8
|
+
* value() // returns cached result
|
|
9
|
+
* value() // returns cached result
|
|
10
|
+
*
|
|
11
|
+
* Based on: https://github.com/sindresorhus/lazy-value
|
|
12
|
+
*/
|
|
13
|
+
function _lazyValue(fn) {
|
|
14
|
+
let isCalled = false;
|
|
15
|
+
let result;
|
|
16
|
+
return (() => {
|
|
17
|
+
if (!isCalled) {
|
|
18
|
+
isCalled = true;
|
|
19
|
+
result = fn();
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports._lazyValue = _lazyValue;
|
|
25
|
+
/**
|
|
26
|
+
* interface Obj {
|
|
27
|
+
* v: number
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* const obj = {} as Obj
|
|
31
|
+
*
|
|
32
|
+
* _defineLazyProperty(obj, 'v', () => expensiveComputation())
|
|
33
|
+
* obj.v // runs expensiveComputation() once
|
|
34
|
+
* obj.v // cached value
|
|
35
|
+
* obj.v // cached value
|
|
36
|
+
*
|
|
37
|
+
* Based on: https://github.com/sindresorhus/define-lazy-prop
|
|
38
|
+
*/
|
|
39
|
+
function _defineLazyProperty(obj, propertyName, fn) {
|
|
40
|
+
const define = (value) => Object.defineProperty(obj, propertyName, { value, enumerable: true, writable: true });
|
|
41
|
+
Object.defineProperty(obj, propertyName, {
|
|
42
|
+
configurable: true,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get() {
|
|
45
|
+
const result = fn();
|
|
46
|
+
define(result);
|
|
47
|
+
return result;
|
|
48
|
+
},
|
|
49
|
+
set(value) {
|
|
50
|
+
define(value);
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
exports._defineLazyProperty = _defineLazyProperty;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PropertyPath } from '../lodash.types';
|
|
2
|
-
import { ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types';
|
|
2
|
+
import { AnyObject, ObjectMapper, ObjectPredicate, StringMap, ValueOf } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Returns clone of `obj` with only `props` preserved.
|
|
5
5
|
* Opposite of Omit.
|
|
6
6
|
*/
|
|
7
|
-
export declare function _pick<T extends
|
|
7
|
+
export declare function _pick<T extends AnyObject, K extends keyof T>(obj: T, props: readonly K[], mutate?: boolean): T;
|
|
8
8
|
/**
|
|
9
9
|
* Returns clone of `obj` with `props` omitted.
|
|
10
10
|
* Opposite of Pick.
|
|
11
11
|
*/
|
|
12
|
-
export declare function _omit<T extends
|
|
12
|
+
export declare function _omit<T extends AnyObject, K extends keyof T>(obj: T, props: readonly K[], mutate?: boolean): T;
|
|
13
13
|
/**
|
|
14
14
|
* Returns object with filtered keys from `props` array.
|
|
15
15
|
* E.g:
|
|
@@ -18,26 +18,26 @@ export declare function _omit<T extends Record<string, any>, K extends keyof T>(
|
|
|
18
18
|
* 'account.updated',
|
|
19
19
|
* ])
|
|
20
20
|
*/
|
|
21
|
-
export declare function _mask<T extends
|
|
21
|
+
export declare function _mask<T extends AnyObject>(obj: T, props: string[], mutate?: boolean): T;
|
|
22
22
|
/**
|
|
23
23
|
* Removes "falsy" values from the object.
|
|
24
24
|
*/
|
|
25
|
-
export declare function _filterFalsyValues<T extends
|
|
25
|
+
export declare function _filterFalsyValues<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
26
26
|
/**
|
|
27
27
|
* Removes values from the object that are `null` or `undefined`.
|
|
28
28
|
*/
|
|
29
|
-
export declare function _filterNullishValues<T extends
|
|
29
|
+
export declare function _filterNullishValues<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
30
30
|
/**
|
|
31
31
|
* Removes values from the object that are `undefined`.
|
|
32
32
|
* Only `undefined` values are removed. `null` values are kept!
|
|
33
33
|
*/
|
|
34
|
-
export declare function _filterUndefinedValues<T extends
|
|
35
|
-
export declare function _filterEmptyArrays<T extends
|
|
34
|
+
export declare function _filterUndefinedValues<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
35
|
+
export declare function _filterEmptyArrays<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
36
36
|
/**
|
|
37
37
|
* Returns clone of `obj` without properties that does not pass `predicate`.
|
|
38
38
|
* Allows filtering by both key and value.
|
|
39
39
|
*/
|
|
40
|
-
export declare function _filterObject<T extends
|
|
40
|
+
export declare function _filterObject<T extends AnyObject>(obj: T, predicate: ObjectPredicate<T>, mutate?: boolean): T;
|
|
41
41
|
/**
|
|
42
42
|
* var users = {
|
|
43
43
|
* 'fred': { 'user': 'fred', 'age': 40 },
|
|
@@ -51,14 +51,14 @@ export declare function _filterObject<T extends Record<string, any>>(obj: T, pre
|
|
|
51
51
|
* _.mapValues(users, 'age')
|
|
52
52
|
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
|
|
53
53
|
*/
|
|
54
|
-
export declare function _mapValues<T extends
|
|
54
|
+
export declare function _mapValues<T extends AnyObject, OUT = T>(obj: T, mapper: ObjectMapper<T, any>, mutate?: boolean): OUT;
|
|
55
55
|
/**
|
|
56
56
|
* _.mapKeys({ 'a': 1, 'b': 2 }, (key, value) => key + value)
|
|
57
57
|
* // => { 'a1': 1, 'b2': 2 }
|
|
58
58
|
*
|
|
59
59
|
* Does not support `mutate` flag.
|
|
60
60
|
*/
|
|
61
|
-
export declare function _mapKeys<T extends
|
|
61
|
+
export declare function _mapKeys<T extends AnyObject>(obj: T, mapper: ObjectMapper<T, string>): StringMap<T[keyof T]>;
|
|
62
62
|
/**
|
|
63
63
|
* Maps object through predicate - a function that receives (k, v, obj)
|
|
64
64
|
* k - key
|
|
@@ -75,11 +75,11 @@ export declare function _mapKeys<T extends Record<string, any>>(obj: T, mapper:
|
|
|
75
75
|
*
|
|
76
76
|
* Non-string keys are passed via String(...)
|
|
77
77
|
*/
|
|
78
|
-
export declare function _mapObject<IN extends
|
|
78
|
+
export declare function _mapObject<IN extends AnyObject, OUT>(obj: IN, mapper: ObjectMapper<IN, [key: string, value: any]>): {
|
|
79
79
|
[P in keyof IN]: OUT;
|
|
80
80
|
};
|
|
81
|
-
export declare function _findKeyByValue<T extends
|
|
82
|
-
export declare function _objectNullValuesToUndefined<T extends
|
|
81
|
+
export declare function _findKeyByValue<T extends AnyObject>(obj: T, v: ValueOf<T>): keyof T | undefined;
|
|
82
|
+
export declare function _objectNullValuesToUndefined<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
83
83
|
/**
|
|
84
84
|
* Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo).
|
|
85
85
|
*/
|
|
@@ -87,7 +87,7 @@ export declare function _deepCopy<T>(o: T): T;
|
|
|
87
87
|
/**
|
|
88
88
|
* Returns true if item is Object, not null and not Array.
|
|
89
89
|
*/
|
|
90
|
-
export declare function _isObject(item: any): item is
|
|
90
|
+
export declare function _isObject(item: any): item is AnyObject;
|
|
91
91
|
export declare function _isPrimitive(v: any): v is null | undefined | number | boolean | string;
|
|
92
92
|
export declare function _isEmptyObject(obj: any): boolean;
|
|
93
93
|
/**
|
|
@@ -109,7 +109,7 @@ export declare function _undefinedIfEmpty<T>(obj: T | undefined): T | undefined;
|
|
|
109
109
|
/**
|
|
110
110
|
* Filters the object by removing all key-value pairs where Value is Empty (according to _isEmpty() specification).
|
|
111
111
|
*/
|
|
112
|
-
export declare function _filterEmptyValues<T extends
|
|
112
|
+
export declare function _filterEmptyValues<T extends AnyObject>(obj: T, mutate?: boolean): T;
|
|
113
113
|
/**
|
|
114
114
|
* Recursively merges own and inherited enumerable properties of source
|
|
115
115
|
* objects into the destination object, skipping source properties that resolve
|
|
@@ -139,15 +139,15 @@ export declare function _filterEmptyValues<T extends Record<string, any>>(obj: T
|
|
|
139
139
|
*
|
|
140
140
|
* Based on: https://gist.github.com/Salakar/1d7137de9cb8b704e48a
|
|
141
141
|
*/
|
|
142
|
-
export declare function _merge<T extends
|
|
142
|
+
export declare function _merge<T extends AnyObject>(target: T, ...sources: any[]): T;
|
|
143
143
|
/**
|
|
144
144
|
* Trims all object VALUES deeply.
|
|
145
145
|
* Doesn't touch object KEYS.
|
|
146
146
|
* Mutates.
|
|
147
147
|
*/
|
|
148
|
-
export declare function _deepTrim<T extends
|
|
149
|
-
export declare function _unset<T extends
|
|
150
|
-
export declare function _invert<T extends
|
|
148
|
+
export declare function _deepTrim<T extends AnyObject | string>(o: T): T;
|
|
149
|
+
export declare function _unset<T extends AnyObject>(obj: T, prop: string): void;
|
|
150
|
+
export declare function _invert<T extends AnyObject>(o: T): {
|
|
151
151
|
[k in ValueOf<T>]: keyof T | undefined;
|
|
152
152
|
};
|
|
153
153
|
export declare function _invertMap<K, V>(m: ReadonlyMap<K, V>): Map<V, K>;
|
|
@@ -160,7 +160,7 @@ export declare function _invertMap<K, V>(m: ReadonlyMap<K, V>): Map<V, K>;
|
|
|
160
160
|
* @param def The value returned if the resolved value is undefined.
|
|
161
161
|
* @return Returns the resolved value.
|
|
162
162
|
*/
|
|
163
|
-
export declare function _get<T extends
|
|
163
|
+
export declare function _get<T extends AnyObject>(obj?: T, path?: string, def?: any): any;
|
|
164
164
|
/**
|
|
165
165
|
* Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for
|
|
166
166
|
* missing index properties while objects are created for all other missing properties. Use _.setWith to
|
|
@@ -173,7 +173,7 @@ export declare function _get<T extends Record<string, any>>(obj?: T, path?: stri
|
|
|
173
173
|
*
|
|
174
174
|
* Based on: https://stackoverflow.com/a/54733755/4919972
|
|
175
175
|
*/
|
|
176
|
-
export declare function _set<IN extends
|
|
176
|
+
export declare function _set<IN extends AnyObject, OUT = IN>(obj: IN, path: PropertyPath, value?: any): OUT;
|
|
177
177
|
/**
|
|
178
178
|
* Checks if `path` is a direct property of `object` (not null, not undefined).
|
|
179
179
|
*
|
|
@@ -198,4 +198,4 @@ export declare function _set<IN extends Record<string, any>, OUT = IN>(obj: IN,
|
|
|
198
198
|
* _.has(other, 'a');
|
|
199
199
|
* // => false
|
|
200
200
|
*/
|
|
201
|
-
export declare function _has<T extends
|
|
201
|
+
export declare function _has<T extends AnyObject>(obj: T, path?: string): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AnyObject } from '../index';
|
|
1
2
|
/**
|
|
2
3
|
* Returns new object with keys sorder in the given order.
|
|
3
4
|
* All keys that are not listed in `keyOrder` go last.
|
|
4
5
|
* Does not mutate original object.
|
|
5
6
|
*/
|
|
6
|
-
export declare function _sortObject<T extends
|
|
7
|
+
export declare function _sortObject<T extends AnyObject>(obj: T, keyOrder: (keyof T)[]): T;
|
|
@@ -20,8 +20,6 @@ class AggregatedError extends Error {
|
|
|
20
20
|
super(message);
|
|
21
21
|
this.errors = mappedErrors;
|
|
22
22
|
this.results = results;
|
|
23
|
-
this.constructor = AggregatedError;
|
|
24
|
-
this.__proto__ = AggregatedError.prototype;
|
|
25
23
|
Object.defineProperty(this, 'name', {
|
|
26
24
|
value: this.constructor.name,
|
|
27
25
|
configurable: true,
|
|
@@ -32,6 +30,7 @@ class AggregatedError extends Error {
|
|
|
32
30
|
else {
|
|
33
31
|
Object.defineProperty(this, 'stack', {
|
|
34
32
|
value: new Error().stack,
|
|
33
|
+
writable: true,
|
|
35
34
|
configurable: true,
|
|
36
35
|
});
|
|
37
36
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StringMap } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses `location.search` string (e.g `?a=1&b=2`) into a StringMap, e.g:
|
|
4
|
+
* `{ a: '1', b: '2' }`
|
|
5
|
+
*
|
|
6
|
+
* Pass `location.search` to it in the Frontend, or any other string on the Backend (where `location.search` is not available).
|
|
7
|
+
*
|
|
8
|
+
* Works both with and without leading `?` character.
|
|
9
|
+
*
|
|
10
|
+
* Yes, there's `URLSearchParams` existing in the Frontend (not in Node yet), but it's API is not
|
|
11
|
+
* as convenient. And the implementation here is super-small.
|
|
12
|
+
*
|
|
13
|
+
* Goal of this function is to produce exactly same output as URLSearchParams would.
|
|
14
|
+
*/
|
|
15
|
+
export declare function _parseQueryString(search: string): StringMap;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._parseQueryString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Parses `location.search` string (e.g `?a=1&b=2`) into a StringMap, e.g:
|
|
6
|
+
* `{ a: '1', b: '2' }`
|
|
7
|
+
*
|
|
8
|
+
* Pass `location.search` to it in the Frontend, or any other string on the Backend (where `location.search` is not available).
|
|
9
|
+
*
|
|
10
|
+
* Works both with and without leading `?` character.
|
|
11
|
+
*
|
|
12
|
+
* Yes, there's `URLSearchParams` existing in the Frontend (not in Node yet), but it's API is not
|
|
13
|
+
* as convenient. And the implementation here is super-small.
|
|
14
|
+
*
|
|
15
|
+
* Goal of this function is to produce exactly same output as URLSearchParams would.
|
|
16
|
+
*/
|
|
17
|
+
function _parseQueryString(search) {
|
|
18
|
+
const qs = {};
|
|
19
|
+
search
|
|
20
|
+
.substr(search[0] === '?' ? 1 : 0)
|
|
21
|
+
.split('&')
|
|
22
|
+
.forEach(p => {
|
|
23
|
+
const [k, v] = p.split('=');
|
|
24
|
+
if (!k)
|
|
25
|
+
return;
|
|
26
|
+
qs[decodeURIComponent(k)] = decodeURIComponent(v || '');
|
|
27
|
+
});
|
|
28
|
+
return qs;
|
|
29
|
+
}
|
|
30
|
+
exports._parseQueryString = _parseQueryString;
|
package/dist/types.d.ts
CHANGED
|
@@ -155,4 +155,4 @@ export declare function _stringMapEntries<T>(m: StringMap<T>): [k: string, v: T]
|
|
|
155
155
|
*
|
|
156
156
|
* @experimental
|
|
157
157
|
*/
|
|
158
|
-
export declare function _objectKeys<T extends
|
|
158
|
+
export declare function _objectKeys<T extends AnyObject>(obj: T): (keyof T)[];
|
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
export class AppError extends Error {
|
|
11
11
|
constructor(message, data = {}) {
|
|
12
12
|
super(message);
|
|
13
|
-
this.data = data;
|
|
14
|
-
this.constructor = AppError;
|
|
15
|
-
this.__proto__ = AppError.prototype;
|
|
16
13
|
Object.defineProperty(this, 'name', {
|
|
17
14
|
value: this.constructor.name,
|
|
18
15
|
configurable: true,
|
|
19
16
|
});
|
|
17
|
+
Object.defineProperty(this, 'data', {
|
|
18
|
+
value: data,
|
|
19
|
+
writable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
enumerable: false,
|
|
22
|
+
});
|
|
20
23
|
if (Error.captureStackTrace) {
|
|
21
24
|
Error.captureStackTrace(this, this.constructor);
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
24
27
|
Object.defineProperty(this, 'stack', {
|
|
25
28
|
value: new Error().stack,
|
|
29
|
+
writable: true,
|
|
26
30
|
configurable: true,
|
|
27
31
|
});
|
|
28
32
|
}
|
package/dist-esm/error/assert.js
CHANGED
|
@@ -84,22 +84,7 @@ export function _assertTypeOf(v, expectedType, message) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
export class AssertionError extends AppError {
|
|
87
|
-
constructor(message, data) {
|
|
87
|
+
constructor(message, data = {}) {
|
|
88
88
|
super(message, data);
|
|
89
|
-
this.constructor = AssertionError;
|
|
90
|
-
this.__proto__ = AssertionError.prototype;
|
|
91
|
-
Object.defineProperty(this, 'name', {
|
|
92
|
-
value: this.constructor.name,
|
|
93
|
-
configurable: true, // otherwise throws with "TypeError: Cannot redefine property: name"
|
|
94
|
-
});
|
|
95
|
-
if (Error.captureStackTrace) {
|
|
96
|
-
Error.captureStackTrace(this, this.constructor);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
Object.defineProperty(this, 'stack', {
|
|
100
|
-
value: new Error().stack,
|
|
101
|
-
configurable: true,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
89
|
}
|
|
105
90
|
}
|
|
@@ -5,20 +5,5 @@ import { AppError } from './app.error';
|
|
|
5
5
|
export class HttpError extends AppError {
|
|
6
6
|
constructor(message, data) {
|
|
7
7
|
super(message, data);
|
|
8
|
-
this.constructor = HttpError;
|
|
9
|
-
this.__proto__ = HttpError.prototype;
|
|
10
|
-
Object.defineProperty(this, 'name', {
|
|
11
|
-
value: this.constructor.name,
|
|
12
|
-
configurable: true, // otherwise throws with "TypeError: Cannot redefine property: name"
|
|
13
|
-
});
|
|
14
|
-
if (Error.captureStackTrace) {
|
|
15
|
-
Error.captureStackTrace(this, this.constructor);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
Object.defineProperty(this, 'stack', {
|
|
19
|
-
value: new Error().stack,
|
|
20
|
-
configurable: true,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
8
|
}
|
|
24
9
|
}
|
package/dist-esm/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { _by, _chunk, _countBy, _difference, _dropRightWhile, _dropWhile, _findLast, _flatten, _flattenDeep, _groupBy, _intersection, _last, _mapToObject, _shuffle, _sortBy, _sum, _sumBy, _takeRightWhile, _takeWhile, _uniq, _uniqBy, } from './array/array.util';
|
|
2
|
+
import { _defineLazyProperty, _lazyValue } from './lazy';
|
|
3
|
+
import { _parseQueryString } from './string/url.util';
|
|
2
4
|
import { _range } from './array/range';
|
|
3
5
|
import { _createPromiseDecorator, } from './decorators/createPromiseDecorator';
|
|
4
6
|
import { _debounce, _throttle } from './decorators/debounce';
|
|
@@ -48,4 +50,4 @@ import { _ms, _since } from './time/time.util';
|
|
|
48
50
|
import { _noop, _objectKeys, _passNothingPredicate, _passthroughMapper, _passthroughPredicate, _passUndefinedMapper, _stringMapEntries, _stringMapValues, } from './types';
|
|
49
51
|
import { _gb, _hb, _kb, _mb } from './unit/size.util';
|
|
50
52
|
import { is } from './vendor/is';
|
|
51
|
-
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, };
|
|
53
|
+
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, _lazyValue, };
|