@naturalcycles/js-lib
Advanced tools
Comparing version 14.241.0 to 14.241.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createAbortableSignal = void 0; | ||
exports.createAbortableSignal = createAbortableSignal; | ||
/** | ||
@@ -16,2 +16,1 @@ * Creates AbortableSignal, | ||
} | ||
exports.createAbortableSignal = createAbortableSignal; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._zip = exports._minByOrUndefined = exports._maxByOrUndefined = exports._minBy = exports._maxBy = exports._max = exports._maxOrUndefined = exports._min = exports._minOrUndefined = exports._first = exports._lastOrUndefined = exports._last = exports._shuffle = exports._mapToObject = exports._sumBy = exports._sum = exports._difference = exports._intersectsWith = exports._intersection = exports._countBy = exports._count = exports._countLessThan = exports._countAtLeast = exports._dropRightWhile = exports._dropWhile = exports._takeRightWhile = exports._takeWhile = exports._findLast = exports._find = exports._sortDescBy = exports._sortBy = exports._groupBy = exports._mapBy = exports._by = exports._uniqBy = exports._pushUniqBy = exports._pushUniq = exports._uniq = exports._chunk = void 0; | ||
exports._chunk = _chunk; | ||
exports._uniq = _uniq; | ||
exports._pushUniq = _pushUniq; | ||
exports._pushUniqBy = _pushUniqBy; | ||
exports._uniqBy = _uniqBy; | ||
exports._by = _by; | ||
exports._mapBy = _mapBy; | ||
exports._groupBy = _groupBy; | ||
exports._sortBy = _sortBy; | ||
exports._sortDescBy = _sortDescBy; | ||
exports._find = _find; | ||
exports._findLast = _findLast; | ||
exports._takeWhile = _takeWhile; | ||
exports._takeRightWhile = _takeRightWhile; | ||
exports._dropWhile = _dropWhile; | ||
exports._dropRightWhile = _dropRightWhile; | ||
exports._countAtLeast = _countAtLeast; | ||
exports._countLessThan = _countLessThan; | ||
exports._count = _count; | ||
exports._countBy = _countBy; | ||
exports._intersection = _intersection; | ||
exports._intersectsWith = _intersectsWith; | ||
exports._difference = _difference; | ||
exports._sum = _sum; | ||
exports._sumBy = _sumBy; | ||
exports._mapToObject = _mapToObject; | ||
exports._shuffle = _shuffle; | ||
exports._last = _last; | ||
exports._lastOrUndefined = _lastOrUndefined; | ||
exports._first = _first; | ||
exports._minOrUndefined = _minOrUndefined; | ||
exports._min = _min; | ||
exports._maxOrUndefined = _maxOrUndefined; | ||
exports._max = _max; | ||
exports._maxBy = _maxBy; | ||
exports._minBy = _minBy; | ||
exports._maxByOrUndefined = _maxByOrUndefined; | ||
exports._minByOrUndefined = _minByOrUndefined; | ||
exports._zip = _zip; | ||
const is_util_1 = require("../is.util"); | ||
@@ -23,3 +61,2 @@ const types_1 = require("../types"); | ||
} | ||
exports._chunk = _chunk; | ||
/** | ||
@@ -31,3 +68,2 @@ * Removes duplicates from given array. | ||
} | ||
exports._uniq = _uniq; | ||
/** | ||
@@ -53,3 +89,2 @@ * Pushes an item to an array if it's not already there. | ||
} | ||
exports._pushUniq = _pushUniq; | ||
/** | ||
@@ -70,3 +105,2 @@ * Like _pushUniq but uses a mapper to determine uniqueness (like _uniqBy). | ||
} | ||
exports._pushUniqBy = _pushUniqBy; | ||
/** | ||
@@ -101,3 +135,2 @@ * This method is like `_.uniq` except that it accepts `iteratee` which is | ||
} | ||
exports._uniqBy = _uniqBy; | ||
/** | ||
@@ -126,3 +159,2 @@ * const a = [ | ||
} | ||
exports._by = _by; | ||
/** | ||
@@ -134,3 +166,2 @@ * Map an array of items by a key, that is calculated by a Mapper. | ||
} | ||
exports._mapBy = _mapBy; | ||
/** | ||
@@ -156,3 +187,2 @@ * const a = [1, 2, 3, 4, 5] | ||
} | ||
exports._groupBy = _groupBy; | ||
/** | ||
@@ -174,3 +204,2 @@ * _sortBy([{age: 20}, {age: 10}], 'age') | ||
} | ||
exports._sortBy = _sortBy; | ||
/** | ||
@@ -182,3 +211,2 @@ * Alias for _sortBy with descending order. | ||
} | ||
exports._sortDescBy = _sortDescBy; | ||
/** | ||
@@ -198,3 +226,2 @@ * Similar to `Array.find`, but the `predicate` may return `END` to stop the iteration early. | ||
} | ||
exports._find = _find; | ||
/** | ||
@@ -210,3 +237,2 @@ * Similar to `Array.findLast`, but the `predicate` may return `END` to stop the iteration early. | ||
} | ||
exports._findLast = _findLast; | ||
function _takeWhile(items, predicate) { | ||
@@ -216,3 +242,2 @@ let proceed = true; | ||
} | ||
exports._takeWhile = _takeWhile; | ||
function _takeRightWhile(items, predicate) { | ||
@@ -222,3 +247,2 @@ let proceed = true; | ||
} | ||
exports._takeRightWhile = _takeRightWhile; | ||
function _dropWhile(items, predicate) { | ||
@@ -228,3 +252,2 @@ let proceed = false; | ||
} | ||
exports._dropWhile = _dropWhile; | ||
function _dropRightWhile(items, predicate) { | ||
@@ -237,3 +260,2 @@ let proceed = false; | ||
} | ||
exports._dropRightWhile = _dropRightWhile; | ||
/** | ||
@@ -247,3 +269,2 @@ * Returns true if the _count >= limit. | ||
} | ||
exports._countAtLeast = _countAtLeast; | ||
/** | ||
@@ -257,3 +278,2 @@ * Returns true if the _count <> limit. | ||
} | ||
exports._countLessThan = _countLessThan; | ||
/** | ||
@@ -281,3 +301,2 @@ * Counts how many items match the predicate. | ||
} | ||
exports._count = _count; | ||
function _countBy(items, mapper) { | ||
@@ -292,3 +311,2 @@ const map = {}; | ||
} | ||
exports._countBy = _countBy; | ||
// investigate: _groupBy | ||
@@ -310,3 +328,2 @@ /** | ||
} | ||
exports._intersection = _intersection; | ||
/** | ||
@@ -324,3 +341,2 @@ * Returns true if there is at least 1 item common between 2 arrays. | ||
} | ||
exports._intersectsWith = _intersectsWith; | ||
/** | ||
@@ -334,3 +350,2 @@ * @example | ||
} | ||
exports._difference = _difference; | ||
/** | ||
@@ -346,3 +361,2 @@ * Returns the sum of items, or 0 for empty array. | ||
} | ||
exports._sum = _sum; | ||
function _sumBy(items, mapper) { | ||
@@ -360,3 +374,2 @@ let sum = 0; | ||
} | ||
exports._sumBy = _sumBy; | ||
/** | ||
@@ -385,3 +398,2 @@ * Map an array of T to a StringMap<V>, | ||
} | ||
exports._mapToObject = _mapToObject; | ||
/** | ||
@@ -400,3 +412,2 @@ * Randomly shuffle an array values. | ||
} | ||
exports._shuffle = _shuffle; | ||
/** | ||
@@ -411,3 +422,2 @@ * Returns last item of non-empty array. | ||
} | ||
exports._last = _last; | ||
/** | ||
@@ -419,3 +429,2 @@ * Returns last item of the array (or undefined if array is empty). | ||
} | ||
exports._lastOrUndefined = _lastOrUndefined; | ||
/** | ||
@@ -430,3 +439,2 @@ * Returns the first item of non-empty array. | ||
} | ||
exports._first = _first; | ||
function _minOrUndefined(array) { | ||
@@ -438,3 +446,2 @@ const a = array.filter(is_util_1._isNotNullish); | ||
} | ||
exports._minOrUndefined = _minOrUndefined; | ||
/** | ||
@@ -449,3 +456,2 @@ * Filters out nullish values (undefined and null). | ||
} | ||
exports._min = _min; | ||
function _maxOrUndefined(array) { | ||
@@ -457,3 +463,2 @@ const a = array.filter(is_util_1._isNotNullish); | ||
} | ||
exports._maxOrUndefined = _maxOrUndefined; | ||
/** | ||
@@ -468,3 +473,2 @@ * Filters out nullish values (undefined and null). | ||
} | ||
exports._max = _max; | ||
function _maxBy(array, mapper) { | ||
@@ -476,3 +480,2 @@ const max = _maxByOrUndefined(array, mapper); | ||
} | ||
exports._maxBy = _maxBy; | ||
function _minBy(array, mapper) { | ||
@@ -484,3 +487,2 @@ const min = _minByOrUndefined(array, mapper); | ||
} | ||
exports._minBy = _minBy; | ||
// todo: looks like it _maxByOrUndefined/_minByOrUndefined can be DRYer | ||
@@ -501,3 +503,2 @@ function _maxByOrUndefined(array, mapper) { | ||
} | ||
exports._maxByOrUndefined = _maxByOrUndefined; | ||
function _minByOrUndefined(array, mapper) { | ||
@@ -517,3 +518,2 @@ if (!array.length) | ||
} | ||
exports._minByOrUndefined = _minByOrUndefined; | ||
function _zip(array1, array2) { | ||
@@ -527,2 +527,1 @@ const len = Math.min(array1.length, array2.length); | ||
} | ||
exports._zip = _zip; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._rangeAsyncIterable = exports._rangeIterable = exports._range = void 0; | ||
exports._range = _range; | ||
exports._rangeIterable = _rangeIterable; | ||
exports._rangeAsyncIterable = _rangeAsyncIterable; | ||
const asyncIterable2_1 = require("../iter/asyncIterable2"); | ||
@@ -12,3 +14,2 @@ const iterable2_1 = require("../iter/iterable2"); | ||
} | ||
exports._range = _range; | ||
function _rangeIterable(fromIncl, toExcl, step = 1) { | ||
@@ -27,3 +28,2 @@ if (toExcl === undefined) { | ||
} | ||
exports._rangeIterable = _rangeIterable; | ||
function _rangeAsyncIterable(fromIncl, toExcl, step = 1) { | ||
@@ -42,2 +42,1 @@ if (toExcl === undefined) { | ||
} | ||
exports._rangeAsyncIterable = _rangeAsyncIterable; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.todayString = exports.localDate = exports.LocalDate = void 0; | ||
exports.localDate = exports.LocalDate = void 0; | ||
exports.todayString = todayString; | ||
const assert_1 = require("../error/assert"); | ||
@@ -629,2 +630,1 @@ const is_util_1 = require("../is.util"); | ||
} | ||
exports.todayString = todayString; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nowUnix = exports.localTime = exports.LocalTime = exports.ISODayOfWeek = void 0; | ||
exports.localTime = exports.LocalTime = exports.ISODayOfWeek = void 0; | ||
exports.nowUnix = nowUnix; | ||
const assert_1 = require("../error/assert"); | ||
@@ -826,2 +827,1 @@ const is_util_1 = require("../is.util"); | ||
} | ||
exports.nowUnix = nowUnix; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._getAsyncMemo = exports._AsyncMemo = void 0; | ||
exports._AsyncMemo = void 0; | ||
exports._getAsyncMemo = _getAsyncMemo; | ||
const assert_1 = require("../error/assert"); | ||
@@ -118,2 +119,1 @@ const types_1 = require("../types"); | ||
} | ||
exports._getAsyncMemo = _getAsyncMemo; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._createPromiseDecorator = void 0; | ||
exports._createPromiseDecorator = _createPromiseDecorator; | ||
const decorator_util_1 = require("./decorator.util"); | ||
@@ -86,2 +86,1 @@ /** | ||
} | ||
exports._createPromiseDecorator = _createPromiseDecorator; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._Throttle = exports._Debounce = void 0; | ||
exports._Debounce = _Debounce; | ||
exports._Throttle = _Throttle; | ||
const debounce_1 = require("./debounce"); | ||
@@ -13,3 +14,2 @@ // eslint-disable-next-line @typescript-eslint/naming-convention | ||
} | ||
exports._Debounce = _Debounce; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
@@ -23,2 +23,1 @@ function _Throttle(wait, opt = {}) { | ||
} | ||
exports._Throttle = _Throttle; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._throttle = exports._debounce = void 0; | ||
exports._debounce = _debounce; | ||
exports._throttle = _throttle; | ||
function _debounce(func, wait, opt = {}) { | ||
@@ -110,3 +111,2 @@ let lastArgs; | ||
} | ||
exports._debounce = _debounce; | ||
function _throttle(func, wait, opt = {}) { | ||
@@ -120,2 +120,1 @@ return _debounce(func, wait, { | ||
} | ||
exports._throttle = _throttle; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._getArgsSignature = exports._getTargetMethodSignature = exports._getMethodSignature = void 0; | ||
exports._getMethodSignature = _getMethodSignature; | ||
exports._getTargetMethodSignature = _getTargetMethodSignature; | ||
exports._getArgsSignature = _getArgsSignature; | ||
/** | ||
@@ -13,3 +15,2 @@ * @returns | ||
} | ||
exports._getMethodSignature = _getMethodSignature; | ||
/** | ||
@@ -21,3 +22,2 @@ * @returns `NameOfYourClass.methodName` | ||
} | ||
exports._getTargetMethodSignature = _getTargetMethodSignature; | ||
/** | ||
@@ -39,2 +39,1 @@ * @example | ||
} | ||
exports._getArgsSignature = _getArgsSignature; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._LogMethod = void 0; | ||
exports._LogMethod = _LogMethod; | ||
const __1 = require(".."); | ||
@@ -74,3 +74,2 @@ const time_util_1 = require("../time/time.util"); | ||
} | ||
exports._LogMethod = _LogMethod; | ||
// eslint-disable-next-line max-params | ||
@@ -77,0 +76,0 @@ function logFinished(logger, callSignature, started, sma, logResultFn, res, err) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._getMemo = exports._Memo = void 0; | ||
exports._Memo = void 0; | ||
exports._getMemo = _getMemo; | ||
const assert_1 = require("../error/assert"); | ||
@@ -87,2 +88,1 @@ const types_1 = require("../types"); | ||
} | ||
exports._getMemo = _getMemo; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._memoFn = void 0; | ||
exports._memoFn = _memoFn; | ||
const memo_util_1 = require("./memo.util"); | ||
@@ -33,2 +33,1 @@ /** | ||
} | ||
exports._memoFn = _memoFn; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._memoFnAsync = void 0; | ||
exports._memoFnAsync = _memoFnAsync; | ||
const types_1 = require("../types"); | ||
@@ -39,2 +39,1 @@ const memo_util_1 = require("./memo.util"); | ||
} | ||
exports._memoFnAsync = _memoFnAsync; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._Retry = void 0; | ||
exports._Retry = _Retry; | ||
const __1 = require(".."); | ||
@@ -13,2 +13,1 @@ // eslint-disable-next-line @typescript-eslint/naming-convention | ||
} | ||
exports._Retry = _Retry; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._Timeout = void 0; | ||
exports._Timeout = _Timeout; | ||
const assert_1 = require("../error/assert"); | ||
@@ -23,2 +23,1 @@ const pTimeout_1 = require("../promise/pTimeout"); | ||
} | ||
exports._Timeout = _Timeout; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._defineNonNullishProps = exports._defineProps = exports._defineProperty = exports._defineLazyProps = exports._defineLazyProperty = exports._lazyValue = void 0; | ||
exports._lazyValue = _lazyValue; | ||
exports._defineLazyProperty = _defineLazyProperty; | ||
exports._defineLazyProps = _defineLazyProps; | ||
exports._defineProperty = _defineProperty; | ||
exports._defineProps = _defineProps; | ||
exports._defineNonNullishProps = _defineNonNullishProps; | ||
const object_util_1 = require("./object/object.util"); | ||
@@ -26,3 +31,2 @@ const types_1 = require("./types"); | ||
} | ||
exports._lazyValue = _lazyValue; | ||
/** | ||
@@ -60,3 +64,2 @@ * interface Obj { | ||
} | ||
exports._defineLazyProperty = _defineLazyProperty; | ||
/** | ||
@@ -69,3 +72,2 @@ * Like _defineLazyProperty, but allows to define multiple props at once. | ||
} | ||
exports._defineLazyProps = _defineLazyProps; | ||
/** | ||
@@ -96,3 +98,2 @@ * Same as Object.defineProperty, but with better (least restricting) defaults. | ||
} | ||
exports._defineProperty = _defineProperty; | ||
/** | ||
@@ -111,3 +112,2 @@ * Object.defineProperties with better defaults. | ||
} | ||
exports._defineProps = _defineProps; | ||
/** | ||
@@ -123,2 +123,1 @@ * Like _defineProps, but skips props with nullish values. | ||
} | ||
exports._defineNonNullishProps = _defineNonNullishProps; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._stringEnumKey = exports._stringEnumKeyOrUndefined = exports._numberEnumKey = exports._numberEnumKeyOrUndefined = exports._numberEnumNormalizeOrUndefined = exports._numberEnumNormalize = exports._numberEnumValueOrUndefined = exports._numberEnumValue = exports._stringEnumAsMapReversed = exports._stringEnumAsMap = exports._stringEnumEntriesReversed = exports._stringEnumEntries = exports._numberEnumAsMapReversed = exports._numberEnumAsMap = exports._numberEnumEntriesReversed = exports._numberEnumEntries = exports._stringEnumValues = exports._stringEnumKeys = exports._numberEnumValues = exports._numberEnumKeys = void 0; | ||
exports._numberEnumKeys = _numberEnumKeys; | ||
exports._numberEnumValues = _numberEnumValues; | ||
exports._stringEnumKeys = _stringEnumKeys; | ||
exports._stringEnumValues = _stringEnumValues; | ||
exports._numberEnumEntries = _numberEnumEntries; | ||
exports._numberEnumEntriesReversed = _numberEnumEntriesReversed; | ||
exports._numberEnumAsMap = _numberEnumAsMap; | ||
exports._numberEnumAsMapReversed = _numberEnumAsMapReversed; | ||
exports._stringEnumEntries = _stringEnumEntries; | ||
exports._stringEnumEntriesReversed = _stringEnumEntriesReversed; | ||
exports._stringEnumAsMap = _stringEnumAsMap; | ||
exports._stringEnumAsMapReversed = _stringEnumAsMapReversed; | ||
exports._numberEnumValue = _numberEnumValue; | ||
exports._numberEnumValueOrUndefined = _numberEnumValueOrUndefined; | ||
exports._numberEnumNormalize = _numberEnumNormalize; | ||
exports._numberEnumNormalizeOrUndefined = _numberEnumNormalizeOrUndefined; | ||
exports._numberEnumKeyOrUndefined = _numberEnumKeyOrUndefined; | ||
exports._numberEnumKey = _numberEnumKey; | ||
exports._stringEnumKeyOrUndefined = _stringEnumKeyOrUndefined; | ||
exports._stringEnumKey = _stringEnumKey; | ||
/** | ||
@@ -10,3 +29,2 @@ * Returns all String keys of a number-enum. | ||
} | ||
exports._numberEnumKeys = _numberEnumKeys; | ||
/** | ||
@@ -18,3 +36,2 @@ * Returns all Number values of a number-enum. | ||
} | ||
exports._numberEnumValues = _numberEnumValues; | ||
/** | ||
@@ -26,3 +43,2 @@ * Returns all String keys of a string-enum. | ||
} | ||
exports._stringEnumKeys = _stringEnumKeys; | ||
/** | ||
@@ -35,3 +51,2 @@ * Returns all String values of a string-enum. | ||
} | ||
exports._stringEnumValues = _stringEnumValues; | ||
/** | ||
@@ -48,3 +63,2 @@ * Returns all number-enum "entries", where entry is a tuple of [key, value], | ||
} | ||
exports._numberEnumEntries = _numberEnumEntries; | ||
/** | ||
@@ -59,3 +73,2 @@ * Like _numberEnumEntries, but reversed. | ||
} | ||
exports._numberEnumEntriesReversed = _numberEnumEntriesReversed; | ||
/** | ||
@@ -70,3 +83,2 @@ * Like _numberEnumEntries, but as a Map. | ||
} | ||
exports._numberEnumAsMap = _numberEnumAsMap; | ||
/** | ||
@@ -81,3 +93,2 @@ * Like _numberEnumEntriesReversed, but as a Map. | ||
} | ||
exports._numberEnumAsMapReversed = _numberEnumAsMapReversed; | ||
/** | ||
@@ -92,3 +103,2 @@ * Returns all string-enum "entries", where entry is a tuple of [key, value], | ||
} | ||
exports._stringEnumEntries = _stringEnumEntries; | ||
/** | ||
@@ -100,3 +110,2 @@ * Like _stringEnumEntries, but keys and values are reversed. | ||
} | ||
exports._stringEnumEntriesReversed = _stringEnumEntriesReversed; | ||
/** | ||
@@ -108,3 +117,2 @@ * Return String enum as Map (with the same keys and values). | ||
} | ||
exports._stringEnumAsMap = _stringEnumAsMap; | ||
/** | ||
@@ -116,3 +124,2 @@ * Return String enum as Map, with keys and values reversed. | ||
} | ||
exports._stringEnumAsMapReversed = _stringEnumAsMapReversed; | ||
/** | ||
@@ -132,3 +139,2 @@ * Allows to return a Number enum value (typed as Enum itself) based on it's String key. | ||
} | ||
exports._numberEnumValue = _numberEnumValue; | ||
/** | ||
@@ -140,3 +146,2 @@ * _numberEnumKey, but allows to get/return undefined output. | ||
} | ||
exports._numberEnumValueOrUndefined = _numberEnumValueOrUndefined; | ||
/** | ||
@@ -154,3 +159,2 @@ * Takes number or string enum input, returns normalized Enum output (Number). | ||
} | ||
exports._numberEnumNormalize = _numberEnumNormalize; | ||
/** | ||
@@ -162,3 +166,2 @@ * Same as _numberEnumNormalize, but allows to return undefined values. | ||
} | ||
exports._numberEnumNormalizeOrUndefined = _numberEnumNormalizeOrUndefined; | ||
/** | ||
@@ -172,3 +175,2 @@ * Returns a String key for given NumberEnum value, or undefined if not found. | ||
} | ||
exports._numberEnumKeyOrUndefined = _numberEnumKeyOrUndefined; | ||
/** | ||
@@ -184,3 +186,2 @@ * Returns a String key for given NumberEnum value, throws if not found. | ||
} | ||
exports._numberEnumKey = _numberEnumKey; | ||
function _stringEnumKeyOrUndefined(en, | ||
@@ -191,3 +192,2 @@ // v: T[keyof T] | undefined | null, // cannot make it type-safe :( | ||
} | ||
exports._stringEnumKeyOrUndefined = _stringEnumKeyOrUndefined; | ||
function _stringEnumKey(en, v) { | ||
@@ -199,2 +199,1 @@ const r = _stringEnumKeyOrUndefined(en, v); | ||
} | ||
exports._stringEnumKey = _stringEnumKey; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isClientSide = exports.isServerSide = void 0; | ||
exports.isServerSide = isServerSide; | ||
exports.isClientSide = isClientSide; | ||
/** | ||
@@ -13,3 +14,2 @@ * Use it to detect SSR/Node.js environment. | ||
} | ||
exports.isServerSide = isServerSide; | ||
/** | ||
@@ -24,2 +24,1 @@ * Use it to detect Browser (not SSR/Node) environment. | ||
} | ||
exports.isClientSide = isClientSide; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateBuildInfoDev = void 0; | ||
exports.generateBuildInfoDev = generateBuildInfoDev; | ||
const localTime_1 = require("../datetime/localTime"); | ||
@@ -23,2 +23,1 @@ function generateBuildInfoDev() { | ||
} | ||
exports.generateBuildInfoDev = generateBuildInfoDev; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._assertTypeOf = exports._assertIsNumber = exports._assertIsString = exports._assertIsErrorObject = exports._assertErrorClassOrRethrow = exports._assertIsError = exports._assertDeepEquals = exports._assertEquals = exports._assert = void 0; | ||
exports._assert = _assert; | ||
exports._assertEquals = _assertEquals; | ||
exports._assertDeepEquals = _assertDeepEquals; | ||
exports._assertIsError = _assertIsError; | ||
exports._assertErrorClassOrRethrow = _assertErrorClassOrRethrow; | ||
exports._assertIsErrorObject = _assertIsErrorObject; | ||
exports._assertIsString = _assertIsString; | ||
exports._assertIsNumber = _assertIsNumber; | ||
exports._assertTypeOf = _assertTypeOf; | ||
const __1 = require(".."); | ||
@@ -29,3 +37,2 @@ /** | ||
} | ||
exports._assert = _assert; | ||
/** | ||
@@ -49,3 +56,2 @@ * Like _assert(), but prints more helpful error message. | ||
} | ||
exports._assertEquals = _assertEquals; | ||
/** | ||
@@ -69,3 +75,2 @@ * Like _assert(), but prints more helpful error message. | ||
} | ||
exports._assertDeepEquals = _assertDeepEquals; | ||
function _assertIsError(err, errorClass = Error) { | ||
@@ -78,3 +83,2 @@ if (!(err instanceof errorClass)) { | ||
} | ||
exports._assertIsError = _assertIsError; | ||
/** | ||
@@ -91,3 +95,2 @@ * Asserts that passed object is indeed an Error of defined ErrorClass. | ||
} | ||
exports._assertErrorClassOrRethrow = _assertErrorClassOrRethrow; | ||
function _assertIsErrorObject(obj) { | ||
@@ -100,11 +103,8 @@ if (!(0, __1._isErrorObject)(obj)) { | ||
} | ||
exports._assertIsErrorObject = _assertIsErrorObject; | ||
function _assertIsString(v, message) { | ||
_assertTypeOf(v, 'string', message); | ||
} | ||
exports._assertIsString = _assertIsString; | ||
function _assertIsNumber(v, message) { | ||
_assertTypeOf(v, 'number', message); | ||
} | ||
exports._assertIsNumber = _assertIsNumber; | ||
function _assertTypeOf(v, expectedType, message) { | ||
@@ -118,2 +118,1 @@ if (typeof v !== expectedType) { | ||
} | ||
exports._assertTypeOf = _assertTypeOf; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UnexpectedPassError = exports.TimeoutError = exports.JsonParseError = exports.AssertionError = exports.HttpRequestError = exports.AppError = exports._errorDataAppend = exports._isErrorLike = exports._isErrorObject = exports._isHttpRequestErrorObject = exports._isBackendErrorResponseObject = exports._errorSnippet = exports._errorObjectToError = exports._errorLikeToErrorObject = exports._anyToErrorObject = exports._anyToError = void 0; | ||
exports.UnexpectedPassError = exports.TimeoutError = exports.JsonParseError = exports.AssertionError = exports.HttpRequestError = exports.AppError = void 0; | ||
exports._anyToError = _anyToError; | ||
exports._anyToErrorObject = _anyToErrorObject; | ||
exports._errorLikeToErrorObject = _errorLikeToErrorObject; | ||
exports._errorObjectToError = _errorObjectToError; | ||
exports._errorSnippet = _errorSnippet; | ||
exports._isBackendErrorResponseObject = _isBackendErrorResponseObject; | ||
exports._isHttpRequestErrorObject = _isHttpRequestErrorObject; | ||
exports._isErrorObject = _isErrorObject; | ||
exports._isErrorLike = _isErrorLike; | ||
exports._errorDataAppend = _errorDataAppend; | ||
const __1 = require(".."); | ||
@@ -32,3 +42,2 @@ /** | ||
} | ||
exports._anyToError = _anyToError; | ||
/** | ||
@@ -72,3 +81,2 @@ * Converts "anything" to ErrorObject. | ||
} | ||
exports._anyToErrorObject = _anyToErrorObject; | ||
function _errorLikeToErrorObject(e) { | ||
@@ -95,3 +103,2 @@ // If it's already an ErrorObject - just return it | ||
} | ||
exports._errorLikeToErrorObject = _errorLikeToErrorObject; | ||
function _errorObjectToError(o, errorClass = Error) { | ||
@@ -141,3 +148,2 @@ if (o instanceof errorClass) | ||
} | ||
exports._errorObjectToError = _errorObjectToError; | ||
// These "common" error classes will not be printed as part of the Error snippet | ||
@@ -184,11 +190,8 @@ const commonErrorClasses = new Set([ | ||
} | ||
exports._errorSnippet = _errorSnippet; | ||
function _isBackendErrorResponseObject(o) { | ||
return _isErrorObject(o?.error); | ||
} | ||
exports._isBackendErrorResponseObject = _isBackendErrorResponseObject; | ||
function _isHttpRequestErrorObject(o) { | ||
return !!o && o.name === 'HttpRequestError' && typeof o.data?.requestUrl === 'string'; | ||
} | ||
exports._isHttpRequestErrorObject = _isHttpRequestErrorObject; | ||
/** | ||
@@ -204,7 +207,5 @@ * Note: any instance of AppError is also automatically an ErrorObject | ||
} | ||
exports._isErrorObject = _isErrorObject; | ||
function _isErrorLike(o) { | ||
return !!o && typeof o === 'object' && typeof o.name === 'string' && typeof o.message === 'string'; | ||
} | ||
exports._isErrorLike = _isErrorLike; | ||
/** | ||
@@ -233,3 +234,2 @@ * Convenience function to safely add properties to Error's `data` object | ||
} | ||
exports._errorDataAppend = _errorDataAppend; | ||
/** | ||
@@ -236,0 +236,0 @@ * Base class for all our (not system) errors. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._expectedErrorString = exports.pExpectedErrorString = exports.pExpectedError = exports._expectedError = exports.pTry = exports._try = void 0; | ||
exports._try = _try; | ||
exports.pTry = pTry; | ||
exports._expectedError = _expectedError; | ||
exports.pExpectedError = pExpectedError; | ||
exports.pExpectedErrorString = pExpectedErrorString; | ||
exports._expectedErrorString = _expectedErrorString; | ||
const stringify_1 = require("../string/stringify"); | ||
@@ -37,3 +42,2 @@ const assert_1 = require("./assert"); | ||
} | ||
exports._try = _try; | ||
/** | ||
@@ -53,3 +57,2 @@ * Like _try, but for Promises. | ||
} | ||
exports.pTry = pTry; | ||
/** | ||
@@ -77,3 +80,2 @@ * Calls `fn`, expects is to throw, catches the expected error and returns. | ||
} | ||
exports._expectedError = _expectedError; | ||
/** | ||
@@ -101,3 +103,2 @@ * Awaits passed `promise`, expects is to throw (reject), catches the expected error and returns. | ||
} | ||
exports.pExpectedError = pExpectedError; | ||
/** | ||
@@ -110,3 +111,2 @@ * Shortcut function to simplify error snapshot-matching in tests. | ||
} | ||
exports.pExpectedErrorString = pExpectedErrorString; | ||
/** | ||
@@ -119,2 +119,1 @@ * Shortcut function to simplify error snapshot-matching in tests. | ||
} | ||
exports._expectedErrorString = _expectedErrorString; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._TryCatch = exports._tryCatch = void 0; | ||
exports._TryCatch = void 0; | ||
exports._tryCatch = _tryCatch; | ||
const index_1 = require("../index"); | ||
@@ -39,3 +40,2 @@ /** | ||
} | ||
exports._tryCatch = _tryCatch; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
@@ -42,0 +42,0 @@ const _TryCatch = (opt = {}) => (target, key, descriptor) => { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formDataToObject = exports.objectToFormData = void 0; | ||
exports.objectToFormData = objectToFormData; | ||
exports.formDataToObject = formDataToObject; | ||
/** | ||
@@ -17,6 +18,4 @@ * Convert any object to FormData. | ||
} | ||
exports.objectToFormData = objectToFormData; | ||
function formDataToObject(formData) { | ||
return Object.fromEntries(formData); | ||
} | ||
exports.formDataToObject = formDataToObject; |
@@ -1,4 +0,1 @@ | ||
/// <reference lib="es2022" /> | ||
/// <reference lib="dom" /> | ||
/// <reference lib="dom.iterable" /> | ||
import { HttpRequestError } from '../error/error.util'; | ||
@@ -5,0 +2,0 @@ import { ErrorDataTuple } from '../types'; |
@@ -6,3 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFetcher = exports.Fetcher = void 0; | ||
exports.Fetcher = void 0; | ||
exports.getFetcher = getFetcher; | ||
const env_1 = require("../env"); | ||
@@ -624,2 +625,1 @@ const assert_1 = require("../error/assert"); | ||
} | ||
exports.getFetcher = getFetcher; |
@@ -1,3 +0,1 @@ | ||
/// <reference lib="es2022" /> | ||
/// <reference lib="dom" /> | ||
import type { CommonLogger } from '../log/commonLogger'; | ||
@@ -4,0 +2,0 @@ import type { Promisable } from '../typeFest'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._isNotEmpty = exports._isEmpty = exports._isNotEmptyObject = exports._isEmptyObject = exports._isPrimitive = exports._isObject = exports._isFalsy = exports._isTruthy = exports._isNotNullish = exports._isNullish = exports._isUndefined = exports._isNull = void 0; | ||
exports._isFalsy = exports._isTruthy = exports._isNotNullish = exports._isNullish = exports._isUndefined = exports._isNull = void 0; | ||
exports._isObject = _isObject; | ||
exports._isPrimitive = _isPrimitive; | ||
exports._isEmptyObject = _isEmptyObject; | ||
exports._isNotEmptyObject = _isNotEmptyObject; | ||
exports._isEmpty = _isEmpty; | ||
exports._isNotEmpty = _isNotEmpty; | ||
const _isNull = (v) => v === null; | ||
@@ -35,3 +41,2 @@ exports._isNull = _isNull; | ||
} | ||
exports._isObject = _isObject; | ||
function _isPrimitive(v) { | ||
@@ -46,11 +51,8 @@ return (v === null || | ||
} | ||
exports._isPrimitive = _isPrimitive; | ||
function _isEmptyObject(obj) { | ||
return Object.keys(obj).length === 0; | ||
} | ||
exports._isEmptyObject = _isEmptyObject; | ||
function _isNotEmptyObject(obj) { | ||
return Object.keys(obj).length > 0; | ||
} | ||
exports._isNotEmptyObject = _isNotEmptyObject; | ||
/** | ||
@@ -80,3 +82,2 @@ * Object is considered empty if it's one of: | ||
} | ||
exports._isEmpty = _isEmpty; | ||
/** | ||
@@ -88,2 +89,1 @@ * @see _isEmpty | ||
} | ||
exports._isNotEmpty = _isNotEmpty; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateJsonSchemaFromData = void 0; | ||
exports.generateJsonSchemaFromData = generateJsonSchemaFromData; | ||
const __1 = require("../.."); | ||
@@ -13,3 +13,2 @@ /** | ||
} | ||
exports.generateJsonSchemaFromData = generateJsonSchemaFromData; | ||
function objectToJsonSchema(rows) { | ||
@@ -16,0 +15,0 @@ const typesByKey = {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mergeJsonSchemaObjects = void 0; | ||
exports.mergeJsonSchemaObjects = mergeJsonSchemaObjects; | ||
const index_1 = require("../index"); | ||
@@ -31,2 +31,1 @@ const object_util_1 = require("../object/object.util"); | ||
} | ||
exports.mergeJsonSchemaObjects = mergeJsonSchemaObjects; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple, AnyObject } from '../index'; | ||
@@ -13,6 +12,6 @@ import type { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model'; | ||
any<T = unknown>(): JsonSchemaAnyBuilder<T, JsonSchemaAny<T>>; | ||
const<T_1 = unknown>(value: T_1): JsonSchemaAnyBuilder<T_1, JsonSchemaConst<T_1>>; | ||
const<T = unknown>(value: T): JsonSchemaAnyBuilder<T, JsonSchemaConst<T>>; | ||
null(): JsonSchemaAnyBuilder<null, JsonSchemaNull>; | ||
ref<T_2 = unknown>($ref: string): JsonSchemaAnyBuilder<T_2, JsonSchemaRef<T_2>>; | ||
enum<T_3 = unknown>(enumValues: T_3[]): JsonSchemaAnyBuilder<T_3, JsonSchemaEnum<T_3>>; | ||
ref<T = unknown>($ref: string): JsonSchemaAnyBuilder<T, JsonSchemaRef<T>>; | ||
enum<T = unknown>(enumValues: T[]): JsonSchemaAnyBuilder<T, JsonSchemaEnum<T>>; | ||
boolean(): JsonSchemaAnyBuilder<boolean, JsonSchemaBoolean>; | ||
@@ -26,8 +25,8 @@ buffer(): JsonSchemaAnyBuilder<Buffer, JsonSchemaAny<Buffer>>; | ||
dateString(): JsonSchemaStringBuilder; | ||
object<T_4 extends AnyObject>(props: { [k in keyof T_4]: JsonSchemaAnyBuilder<T_4[k], JsonSchema<T_4[k]>>; }): JsonSchemaObjectBuilder<T_4>; | ||
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>; | ||
object<T extends AnyObject>(props: { [k in keyof T]: JsonSchemaAnyBuilder<T[k]>; }): JsonSchemaObjectBuilder<T>; | ||
rootObject<T extends AnyObject>(props: { [k in keyof T]: JsonSchemaAnyBuilder<T[k]>; }): JsonSchemaObjectBuilder<T>; | ||
array<ITEM = unknown>(itemSchema: JsonSchemaAnyBuilder<ITEM>): JsonSchemaArrayBuilder<ITEM>; | ||
tuple<T_6 extends any[] = unknown[]>(items: JsonSchemaAnyBuilder[]): JsonSchemaTupleBuilder<T_6>; | ||
oneOf<T_7 = unknown>(items: JsonSchemaAnyBuilder[]): JsonSchemaAnyBuilder<T_7, JsonSchemaOneOf<T_7>>; | ||
allOf<T_8 = unknown>(items: JsonSchemaAnyBuilder[]): JsonSchemaAnyBuilder<T_8, JsonSchemaAllOf<T_8>>; | ||
tuple<T extends any[] = unknown[]>(items: JsonSchemaAnyBuilder[]): JsonSchemaTupleBuilder<T>; | ||
oneOf<T = unknown>(items: JsonSchemaAnyBuilder[]): JsonSchemaAnyBuilder<T, JsonSchemaOneOf<T>>; | ||
allOf<T = unknown>(items: JsonSchemaAnyBuilder[]): JsonSchemaAnyBuilder<T, JsonSchemaAllOf<T>>; | ||
}; | ||
@@ -34,0 +33,0 @@ export declare class JsonSchemaAnyBuilder<T = unknown, SCHEMA_TYPE extends JsonSchema<T> = JsonSchema<T>> implements JsonSchemaBuilder<T> { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.commonLoggerCreate = exports.commonLoggerPrefix = exports.commonLoggerPipe = exports.commonLoggerMinLevel = exports.commonLoggerNoop = exports.commonLogLevelNumber = void 0; | ||
exports.commonLoggerNoop = exports.commonLogLevelNumber = void 0; | ||
exports.commonLoggerMinLevel = commonLoggerMinLevel; | ||
exports.commonLoggerPipe = commonLoggerPipe; | ||
exports.commonLoggerPrefix = commonLoggerPrefix; | ||
exports.commonLoggerCreate = commonLoggerCreate; | ||
const index_1 = require("../index"); | ||
@@ -51,3 +55,2 @@ exports.commonLogLevelNumber = { | ||
} | ||
exports.commonLoggerMinLevel = commonLoggerMinLevel; | ||
/** | ||
@@ -63,3 +66,2 @@ * Creates a "proxy" CommonLogger that pipes log messages to all provided sub-loggers. | ||
} | ||
exports.commonLoggerPipe = commonLoggerPipe; | ||
/** | ||
@@ -75,3 +77,2 @@ * Creates a "child" CommonLogger with prefix (one or multiple). | ||
} | ||
exports.commonLoggerPrefix = commonLoggerPrefix; | ||
/** | ||
@@ -87,2 +88,1 @@ * Creates a CommonLogger from a single function that takes `level` and `args`. | ||
} | ||
exports.commonLoggerCreate = commonLoggerCreate; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._median = exports._percentiles = exports._percentile = exports._averageWeighted = exports._averageOrNull = exports._average = void 0; | ||
exports._average = _average; | ||
exports._averageOrNull = _averageOrNull; | ||
exports._averageWeighted = _averageWeighted; | ||
exports._percentile = _percentile; | ||
exports._percentiles = _percentiles; | ||
exports._median = _median; | ||
const number_util_1 = require("../number/number.util"); | ||
@@ -16,3 +21,2 @@ /** | ||
} | ||
exports._average = _average; | ||
/** | ||
@@ -24,3 +28,2 @@ * Same as _average, but safely returns null if input array is empty or nullish. | ||
} | ||
exports._averageOrNull = _averageOrNull; | ||
/** | ||
@@ -34,3 +37,2 @@ * valuesArray and weightsArray length is expected to be the same. | ||
} | ||
exports._averageWeighted = _averageWeighted; | ||
/** | ||
@@ -57,3 +59,2 @@ * @example | ||
} | ||
exports._percentile = _percentile; | ||
/** | ||
@@ -75,3 +76,2 @@ * A tiny bit more efficient function than calling _percentile individually. | ||
} | ||
exports._percentiles = _percentiles; | ||
/** | ||
@@ -89,2 +89,1 @@ * @example | ||
} | ||
exports._median = _median; |
"use strict"; | ||
/* eslint-disable no-bitwise */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._createDeterministicRandom = void 0; | ||
exports._createDeterministicRandom = _createDeterministicRandom; | ||
/** | ||
@@ -23,2 +23,1 @@ * Returns a "deterministic Math.random() function" | ||
} | ||
exports._createDeterministicRandom = _createDeterministicRandom; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._round = exports._toPrecision = exports._toFixed = exports._sortNumbers = exports._clamp = exports._isBetween = exports._runLessOften = exports._randomArrayItem = exports._randomInt = void 0; | ||
exports._randomInt = _randomInt; | ||
exports._randomArrayItem = _randomArrayItem; | ||
exports._runLessOften = _runLessOften; | ||
exports._isBetween = _isBetween; | ||
exports._clamp = _clamp; | ||
exports._sortNumbers = _sortNumbers; | ||
exports._toFixed = _toFixed; | ||
exports._toPrecision = _toPrecision; | ||
exports._round = _round; | ||
function _randomInt(minIncl, maxIncl) { | ||
return Math.floor(Math.random() * (maxIncl - minIncl + 1) + minIncl); | ||
} | ||
exports._randomInt = _randomInt; | ||
/** | ||
@@ -16,3 +23,2 @@ * Returns random item from an array. | ||
} | ||
exports._randomArrayItem = _randomArrayItem; | ||
/** | ||
@@ -30,3 +36,2 @@ * Convenience function to "throttle" some code - run it less often. | ||
} | ||
exports._runLessOften = _runLessOften; | ||
// todo: _.random to support floats | ||
@@ -55,7 +60,5 @@ /** | ||
} | ||
exports._isBetween = _isBetween; | ||
function _clamp(x, minIncl, maxIncl) { | ||
return x <= minIncl ? minIncl : x >= maxIncl ? maxIncl : x; | ||
} | ||
exports._clamp = _clamp; | ||
/** | ||
@@ -74,3 +77,2 @@ * This function exists, because in JS you cannot just .sort() numbers, | ||
} | ||
exports._sortNumbers = _sortNumbers; | ||
/** | ||
@@ -90,3 +92,2 @@ * Same as .toFixed(), but conveniently casts the output to Number. | ||
} | ||
exports._toFixed = _toFixed; | ||
/** | ||
@@ -106,3 +107,2 @@ * Same as .toPrecision(), but conveniently casts the output to Number. | ||
} | ||
exports._toPrecision = _toPrecision; | ||
/** | ||
@@ -126,2 +126,1 @@ * @example | ||
} | ||
exports._round = _round; |
"use strict"; | ||
// Heavily inspired by https://github.com/epoberezkin/fast-deep-equal | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._jsonEquals = exports._deepJsonEquals = exports._deepEquals = void 0; | ||
exports._deepEquals = _deepEquals; | ||
exports._deepJsonEquals = _deepJsonEquals; | ||
exports._jsonEquals = _jsonEquals; | ||
/** | ||
@@ -94,3 +96,2 @@ Returns true if a and b are deeply equal. | ||
} | ||
exports._deepEquals = _deepEquals; | ||
/** | ||
@@ -160,3 +161,2 @@ Returns true if a and b are deeply equal. | ||
} | ||
exports._deepJsonEquals = _deepJsonEquals; | ||
/** | ||
@@ -171,2 +171,1 @@ * Shortcut for JSON.stringify(a) === JSON.stringify(b) | ||
} | ||
exports._jsonEquals = _jsonEquals; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._objectAssignExact = exports._deepFreeze = exports._has = exports._set = exports._get = exports._invertMap = exports._invert = exports._unset = exports._deepTrim = exports._merge = exports._filterEmptyValues = exports._undefinedIfEmpty = exports._deepCopy = exports._objectNullValuesToUndefined = exports._findKeyByValue = exports._mapObject = exports._mapKeys = exports._mapValues = exports._filterObject = exports._filterEmptyArrays = exports._filterUndefinedValues = exports._filterNullishValues = exports._filterFalsyValues = exports._mask = exports._omit = exports._pick = void 0; | ||
exports._pick = _pick; | ||
exports._omit = _omit; | ||
exports._mask = _mask; | ||
exports._filterFalsyValues = _filterFalsyValues; | ||
exports._filterNullishValues = _filterNullishValues; | ||
exports._filterUndefinedValues = _filterUndefinedValues; | ||
exports._filterEmptyArrays = _filterEmptyArrays; | ||
exports._filterObject = _filterObject; | ||
exports._mapValues = _mapValues; | ||
exports._mapKeys = _mapKeys; | ||
exports._mapObject = _mapObject; | ||
exports._findKeyByValue = _findKeyByValue; | ||
exports._objectNullValuesToUndefined = _objectNullValuesToUndefined; | ||
exports._deepCopy = _deepCopy; | ||
exports._undefinedIfEmpty = _undefinedIfEmpty; | ||
exports._filterEmptyValues = _filterEmptyValues; | ||
exports._merge = _merge; | ||
exports._deepTrim = _deepTrim; | ||
exports._unset = _unset; | ||
exports._invert = _invert; | ||
exports._invertMap = _invertMap; | ||
exports._get = _get; | ||
exports._set = _set; | ||
exports._has = _has; | ||
exports._deepFreeze = _deepFreeze; | ||
exports._objectAssignExact = _objectAssignExact; | ||
const is_util_1 = require("../is.util"); | ||
@@ -26,3 +51,2 @@ const types_1 = require("../types"); | ||
} | ||
exports._pick = _pick; | ||
/** | ||
@@ -38,3 +62,2 @@ * Returns clone of `obj` with `props` omitted. | ||
} | ||
exports._omit = _omit; | ||
/** | ||
@@ -54,3 +77,2 @@ * Returns object with filtered keys from `props` array. | ||
} | ||
exports._mask = _mask; | ||
/** | ||
@@ -62,3 +84,2 @@ * Removes "falsy" values from the object. | ||
} | ||
exports._filterFalsyValues = _filterFalsyValues; | ||
/** | ||
@@ -70,3 +91,2 @@ * Removes values from the object that are `null` or `undefined`. | ||
} | ||
exports._filterNullishValues = _filterNullishValues; | ||
/** | ||
@@ -79,7 +99,5 @@ * Removes values from the object that are `undefined`. | ||
} | ||
exports._filterUndefinedValues = _filterUndefinedValues; | ||
function _filterEmptyArrays(obj, mutate = false) { | ||
return _filterObject(obj, (_k, v) => !Array.isArray(v) || v.length > 0, mutate); | ||
} | ||
exports._filterEmptyArrays = _filterEmptyArrays; | ||
/** | ||
@@ -96,3 +114,2 @@ * Returns clone of `obj` without properties that does not pass `predicate`. | ||
} | ||
exports._filterObject = _filterObject; | ||
/** | ||
@@ -115,3 +132,2 @@ * var users = { | ||
} | ||
exports._mapValues = _mapValues; | ||
/** | ||
@@ -131,3 +147,2 @@ * _.mapKeys({ 'a': 1, 'b': 2 }, (key, value) => key + value) | ||
} | ||
exports._mapKeys = _mapKeys; | ||
/** | ||
@@ -158,11 +173,8 @@ * Maps object through predicate - a function that receives (k, v, obj) | ||
} | ||
exports._mapObject = _mapObject; | ||
function _findKeyByValue(obj, v) { | ||
return Object.entries(obj).find(([_, value]) => value === v)?.[0]; | ||
} | ||
exports._findKeyByValue = _findKeyByValue; | ||
function _objectNullValuesToUndefined(obj, mutate = false) { | ||
return _mapValues(obj, (_k, v) => (v === null ? undefined : v), mutate); | ||
} | ||
exports._objectNullValuesToUndefined = _objectNullValuesToUndefined; | ||
/** | ||
@@ -174,3 +186,2 @@ * Deep copy object (by json parse/stringify, since it has unbeatable performance+simplicity combo). | ||
} | ||
exports._deepCopy = _deepCopy; | ||
/** | ||
@@ -183,3 +194,2 @@ * Returns `undefined` if it's empty (according to `_isEmpty()` specification), | ||
} | ||
exports._undefinedIfEmpty = _undefinedIfEmpty; | ||
/** | ||
@@ -191,3 +201,2 @@ * Filters the object by removing all key-value pairs where Value is Empty (according to _isEmpty() specification). | ||
} | ||
exports._filterEmptyValues = _filterEmptyValues; | ||
/** | ||
@@ -242,3 +251,2 @@ * Recursively merges own and inherited enumerable properties of source | ||
} | ||
exports._merge = _merge; | ||
/** | ||
@@ -262,3 +270,2 @@ * Trims all object VALUES deeply. | ||
} | ||
exports._deepTrim = _deepTrim; | ||
// from: https://github.com/jonschlinkert/unset-value | ||
@@ -288,3 +295,2 @@ // mutates obj | ||
} | ||
exports._unset = _unset; | ||
function _invert(o) { | ||
@@ -297,3 +303,2 @@ const inv = {}; | ||
} | ||
exports._invert = _invert; | ||
function _invertMap(m) { | ||
@@ -304,3 +309,2 @@ const inv = new Map(); | ||
} | ||
exports._invertMap = _invertMap; | ||
/** | ||
@@ -322,3 +326,2 @@ * Gets the property value at path of object. | ||
} | ||
exports._get = _get; | ||
/** | ||
@@ -358,3 +361,2 @@ * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for | ||
} | ||
exports._set = _set; | ||
/** | ||
@@ -388,3 +390,2 @@ * Checks if `path` is a direct property of `object` (not null, not undefined). | ||
} | ||
exports._has = _has; | ||
/** | ||
@@ -406,3 +407,2 @@ * Does Object.freeze recursively for given object. | ||
} | ||
exports._deepFreeze = _deepFreeze; | ||
/** | ||
@@ -434,2 +434,1 @@ * let target: T = { a: 'a', n: 1} | ||
} | ||
exports._objectAssignExact = _objectAssignExact; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._sortObject = void 0; | ||
exports._sortObject = _sortObject; | ||
const index_1 = require("../index"); | ||
@@ -22,2 +22,1 @@ /** | ||
} | ||
exports._sortObject = _sortObject; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._sortObjectDeep = void 0; | ||
exports._sortObjectDeep = _sortObjectDeep; | ||
const __1 = require(".."); | ||
@@ -24,2 +24,1 @@ /** | ||
} | ||
exports._sortObjectDeep = _sortObjectDeep; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.polyfillDispose = void 0; | ||
exports.polyfillDispose = polyfillDispose; | ||
function polyfillDispose() { | ||
@@ -10,2 +10,1 @@ // @ts-expect-error polyfill | ||
} | ||
exports.polyfillDispose = polyfillDispose; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.abortable = exports.Abortable = void 0; | ||
exports.Abortable = void 0; | ||
exports.abortable = abortable; | ||
/** | ||
@@ -36,2 +37,1 @@ * Similar to AbortController and AbortSignal. | ||
} | ||
exports.abortable = abortable; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pDefer = void 0; | ||
exports.pDefer = pDefer; | ||
/* eslint-disable @typescript-eslint/promise-function-async */ | ||
@@ -21,2 +21,1 @@ /** | ||
} | ||
exports.pDefer = pDefer; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pDelayFn = exports.pDelay = void 0; | ||
exports.pDelay = pDelay; | ||
exports.pDelayFn = pDelayFn; | ||
const pDefer_1 = require("./pDefer"); | ||
@@ -14,3 +15,2 @@ /** | ||
} | ||
exports.pDelay = pDelay; | ||
/* eslint-disable @typescript-eslint/promise-function-async */ | ||
@@ -43,2 +43,1 @@ /** | ||
} | ||
exports.pDelayFn = pDelayFn; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pFilter = void 0; | ||
exports.pFilter = pFilter; | ||
async function pFilter(iterable, filterFn) { | ||
@@ -9,2 +9,1 @@ const items = [...iterable]; | ||
} | ||
exports.pFilter = pFilter; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pHang = void 0; | ||
exports.pHang = pHang; | ||
/** | ||
@@ -10,2 +10,1 @@ * Returns Promise that never resolves ("hanging"). | ||
} | ||
exports.pHang = pHang; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pMap = void 0; | ||
exports.pMap = pMap; | ||
const __1 = require(".."); | ||
@@ -117,3 +117,2 @@ /** | ||
} | ||
exports.pMap = pMap; | ||
/** | ||
@@ -120,0 +119,0 @@ pMap with serial (non-concurrent) execution. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pProps = void 0; | ||
exports.pProps = pProps; | ||
/** | ||
@@ -24,2 +24,1 @@ * Promise.all for Object instead of Array. | ||
} | ||
exports.pProps = pProps; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pRetry = exports.pRetryFn = void 0; | ||
exports.pRetryFn = pRetryFn; | ||
exports.pRetry = pRetry; | ||
const __1 = require(".."); | ||
@@ -14,3 +15,2 @@ /** | ||
} | ||
exports.pRetryFn = pRetryFn; | ||
async function pRetry(fn, opt = {}) { | ||
@@ -68,2 +68,1 @@ const { maxAttempts = 4, delay: initialDelay = 1000, delayMultiplier = 2, predicate, logger = console, name, timeout, } = opt; | ||
} | ||
exports.pRetry = pRetry; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pState = void 0; | ||
exports.pState = pState; | ||
const UNIQUE_VALUE = Symbol('unique'); | ||
@@ -18,2 +18,1 @@ /** | ||
} | ||
exports.pState = pState; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pTimeout = exports.pTimeoutFn = void 0; | ||
exports.pTimeoutFn = pTimeoutFn; | ||
exports.pTimeout = pTimeout; | ||
const error_util_1 = require("../error/error.util"); | ||
@@ -21,3 +22,2 @@ /** | ||
} | ||
exports.pTimeoutFn = pTimeoutFn; | ||
/** | ||
@@ -68,2 +68,1 @@ * Decorates a Function with a timeout and immediately calls it. | ||
} | ||
exports.pTimeout = pTimeout; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._quickSemverCompare = exports.semver2 = exports.Semver = void 0; | ||
exports.semver2 = exports.Semver = void 0; | ||
exports._quickSemverCompare = _quickSemverCompare; | ||
const range_1 = require("./array/range"); | ||
@@ -144,2 +145,1 @@ const assert_1 = require("./error/assert"); | ||
} | ||
exports._quickSemverCompare = _quickSemverCompare; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._kebabCase = exports._snakeCase = exports._camelCase = void 0; | ||
exports._camelCase = _camelCase; | ||
exports._snakeCase = _snakeCase; | ||
exports._kebabCase = _kebabCase; | ||
const words_1 = require("./lodash/words"); | ||
@@ -13,10 +15,7 @@ const string_util_1 = require("./string.util"); | ||
} | ||
exports._camelCase = _camelCase; | ||
function _snakeCase(s) { | ||
return (0, words_1.words)(s.replaceAll(/['\u2019]/g, '')).reduce((result, word, index) => result + (index ? '_' : '') + word.toLowerCase(), ''); | ||
} | ||
exports._snakeCase = _snakeCase; | ||
function _kebabCase(s) { | ||
return (0, words_1.words)(s.replaceAll(/['\u2019]/g, '')).reduce((result, word, index) => result + (index ? '-' : '') + word.toLowerCase(), ''); | ||
} | ||
exports._kebabCase = _kebabCase; |
@@ -15,3 +15,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.htmlUnescape = exports.htmlEscape = void 0; | ||
exports.htmlEscape = htmlEscape; | ||
exports.htmlUnescape = htmlUnescape; | ||
// Multiple `.replace()` calls are actually faster than using replacer functions | ||
@@ -44,3 +45,2 @@ function _htmlEscape(s) { | ||
} | ||
exports.htmlEscape = htmlEscape; | ||
function htmlUnescape(strings, ...values) { | ||
@@ -56,2 +56,1 @@ if (typeof strings === 'string') { | ||
} | ||
exports.htmlUnescape = htmlUnescape; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hashCode = exports.hashCode64 = exports.hashCode36 = exports.hashCode16 = void 0; | ||
exports.hashCode16 = hashCode16; | ||
exports.hashCode36 = hashCode36; | ||
exports.hashCode64 = hashCode64; | ||
exports.hashCode = hashCode; | ||
const BASE62 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | ||
@@ -27,3 +30,2 @@ // const BASE64 = BASE62 + '+/' | ||
} | ||
exports.hashCode16 = hashCode16; | ||
/** | ||
@@ -38,3 +40,2 @@ * Returns hashCode as "radix 36", using "Base36 alphabet". | ||
} | ||
exports.hashCode36 = hashCode36; | ||
/** | ||
@@ -47,3 +48,2 @@ * Returns hashCode as "radix 64", using Base64url alphabet. | ||
} | ||
exports.hashCode64 = hashCode64; | ||
/** | ||
@@ -65,3 +65,2 @@ * Generates a stable integer hashCode for a given String. | ||
} | ||
exports.hashCode = hashCode; | ||
/** | ||
@@ -68,0 +67,0 @@ * Source: https://gist.github.com/alkaruno/b84162bae5115f4ca99b |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._jsonParse = exports._jsonParseOrUndefined = exports._jsonParseIfPossible = void 0; | ||
exports._jsonParseIfPossible = _jsonParseIfPossible; | ||
exports._jsonParseOrUndefined = _jsonParseOrUndefined; | ||
exports._jsonParse = _jsonParse; | ||
const error_util_1 = require("../error/error.util"); | ||
@@ -21,3 +23,2 @@ // const possibleJsonStartTokens = ['{', '[', '"'] | ||
} | ||
exports._jsonParseIfPossible = _jsonParseIfPossible; | ||
/** | ||
@@ -36,3 +37,2 @@ * Convenience function that does JSON.parse, but doesn't throw on error, | ||
} | ||
exports._jsonParseOrUndefined = _jsonParseOrUndefined; | ||
/** | ||
@@ -54,2 +54,1 @@ * Same as JSON.parse, but throws JsonParseError: | ||
} | ||
exports._jsonParse = _jsonParse; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._leven = void 0; | ||
exports._leven = _leven; | ||
const array = []; | ||
@@ -81,2 +81,1 @@ const characterCodeCache = []; | ||
} | ||
exports._leven = _leven; |
@@ -5,3 +5,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unicodeWords = void 0; | ||
exports.unicodeWords = unicodeWords; | ||
/** Used to compose unicode character classes. */ | ||
@@ -73,2 +73,1 @@ const rsAstralRange = '\\ud800-\\udfff'; | ||
} | ||
exports.unicodeWords = unicodeWords; |
"use strict"; | ||
// from: https://github.com/lodash/lodash/blob/master/words.js | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.words = void 0; | ||
exports.words = words; | ||
/* eslint-disable */ | ||
@@ -34,2 +34,1 @@ const unicodeWords_1 = require("./unicodeWords"); | ||
} | ||
exports.words = words; |
@@ -15,3 +15,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pupa = exports.MissingValueError = void 0; | ||
exports.MissingValueError = void 0; | ||
exports.pupa = pupa; | ||
const escape_1 = require("./escape"); | ||
@@ -61,2 +62,1 @@ class MissingValueError extends Error { | ||
} | ||
exports.pupa = pupa; |
@@ -13,3 +13,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readingTime = void 0; | ||
exports.readingTime = readingTime; | ||
function codeIsInRanges(num, arrayOfRanges) { | ||
@@ -107,2 +107,1 @@ return arrayOfRanges.some(([lowerBound, upperBound]) => lowerBound <= num && num <= upperBound); | ||
} | ||
exports.readingTime = readingTime; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._safeJsonStringify = void 0; | ||
exports._safeJsonStringify = _safeJsonStringify; | ||
/** | ||
@@ -19,3 +19,2 @@ * JSON.stringify that avoids circular references, prints them as [Circular ~] | ||
} | ||
exports._safeJsonStringify = _safeJsonStringify; | ||
/* eslint-disable @typescript-eslint/no-unused-expressions, no-bitwise, no-implicit-coercion */ | ||
@@ -22,0 +21,0 @@ function serializer(replacer, cycleReplacer) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._nl2br = exports._substringBetweenLast = exports._substringAfterLast = exports._substringAfter = exports._substringBeforeLast = exports._substringBefore = exports._truncateMiddle = exports._truncate = exports._removeWhitespace = exports._split = exports._lowerFirst = exports._upperFirst = exports._capitalize = void 0; | ||
exports._capitalize = _capitalize; | ||
exports._upperFirst = _upperFirst; | ||
exports._lowerFirst = _lowerFirst; | ||
exports._split = _split; | ||
exports._removeWhitespace = _removeWhitespace; | ||
exports._truncate = _truncate; | ||
exports._truncateMiddle = _truncateMiddle; | ||
exports._substringBefore = _substringBefore; | ||
exports._substringBeforeLast = _substringBeforeLast; | ||
exports._substringAfter = _substringAfter; | ||
exports._substringAfterLast = _substringAfterLast; | ||
exports._substringBetweenLast = _substringBetweenLast; | ||
exports._nl2br = _nl2br; | ||
/** | ||
@@ -10,11 +22,8 @@ * Converts the first character of string to upper case and the remaining to lower case. | ||
} | ||
exports._capitalize = _capitalize; | ||
function _upperFirst(s = '') { | ||
return s.charAt(0).toUpperCase() + s.slice(1); | ||
} | ||
exports._upperFirst = _upperFirst; | ||
function _lowerFirst(s) { | ||
return s.charAt(0).toLowerCase() + s.slice(1); | ||
} | ||
exports._lowerFirst = _lowerFirst; | ||
/** | ||
@@ -31,7 +40,5 @@ * Like String.split(), but with limit, returning the tail together with last element. | ||
} | ||
exports._split = _split; | ||
function _removeWhitespace(s) { | ||
return s.replaceAll(/\s/g, ''); | ||
} | ||
exports._removeWhitespace = _removeWhitespace; | ||
/** | ||
@@ -48,3 +55,2 @@ * _.truncate('hi-diddly-ho there, neighborino') | ||
} | ||
exports._truncate = _truncate; | ||
/** | ||
@@ -63,3 +69,2 @@ * _.truncateMiddle('abcdefghijklmnopqrstuvwxyz', 10) | ||
} | ||
exports._truncateMiddle = _truncateMiddle; | ||
// These functions are modeled after Kotlin's String API | ||
@@ -70,3 +75,2 @@ function _substringBefore(s, delimiter) { | ||
} | ||
exports._substringBefore = _substringBefore; | ||
function _substringBeforeLast(s, delimiter) { | ||
@@ -76,3 +80,2 @@ const pos = s.lastIndexOf(delimiter); | ||
} | ||
exports._substringBeforeLast = _substringBeforeLast; | ||
function _substringAfter(s, delimiter) { | ||
@@ -82,3 +85,2 @@ const pos = s.indexOf(delimiter); | ||
} | ||
exports._substringAfter = _substringAfter; | ||
function _substringAfterLast(s, delimiter) { | ||
@@ -88,3 +90,2 @@ const pos = s.lastIndexOf(delimiter); | ||
} | ||
exports._substringAfterLast = _substringAfterLast; | ||
/** | ||
@@ -102,3 +103,2 @@ * Returns the substring between LAST `leftDelimiter` and then FIRST `rightDelimiter`. | ||
} | ||
exports._substringBetweenLast = _substringBetweenLast; | ||
/** | ||
@@ -111,2 +111,1 @@ * Converts `\n` (aka new-line) to `<br>`, to be presented in HTML. | ||
} | ||
exports._nl2br = _nl2br; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._stringify = exports.setGlobalStringifyFunction = void 0; | ||
exports.setGlobalStringifyFunction = setGlobalStringifyFunction; | ||
exports._stringify = _stringify; | ||
const error_util_1 = require("../error/error.util"); | ||
@@ -25,3 +26,2 @@ const json_util_1 = require("./json.util"); | ||
} | ||
exports.setGlobalStringifyFunction = setGlobalStringifyFunction; | ||
/** | ||
@@ -139,2 +139,1 @@ * Inspired by `_inspect` from nodejs-lib, which is based on util.inpect that is not available in the Browser. | ||
} | ||
exports._stringify = _stringify; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._parseQueryString = void 0; | ||
exports._parseQueryString = _parseQueryString; | ||
/** | ||
@@ -30,2 +30,1 @@ * Parses `location.search` string (e.g `?a=1&b=2`) into a StringMap, e.g: | ||
} | ||
exports._parseQueryString = _parseQueryString; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._ms = exports._since = exports._blockTimer = void 0; | ||
exports._blockTimer = _blockTimer; | ||
exports._since = _since; | ||
exports._ms = _ms; | ||
/** | ||
@@ -21,3 +23,2 @@ * using _ = blockTimer() | ||
} | ||
exports._blockTimer = _blockTimer; | ||
/** | ||
@@ -29,3 +30,2 @@ * Returns time passed since `from` until `until` (default to Date.now()) | ||
} | ||
exports._since = _since; | ||
/** | ||
@@ -67,2 +67,1 @@ * Returns, e.g: | ||
} | ||
exports._ms = _ms; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { Promisable } from './typeFest'; | ||
@@ -3,0 +2,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._objectAssign = exports._typeCast = exports._objectEntries = exports._objectKeys = exports._stringMapEntries = exports._stringMapValues = exports._passNothingPredicate = exports._passthroughPredicate = exports._noop = exports._passUndefinedMapper = exports._passthroughMapper = exports.MISS = exports.SKIP = exports.END = void 0; | ||
exports._objectAssign = exports._objectEntries = exports._objectKeys = exports._stringMapEntries = exports._stringMapValues = exports._passNothingPredicate = exports._passthroughPredicate = exports._noop = exports._passUndefinedMapper = exports._passthroughMapper = exports.MISS = exports.SKIP = exports.END = void 0; | ||
exports._typeCast = _typeCast; | ||
/** | ||
@@ -64,3 +65,2 @@ * Symbol to indicate END of Sequence. | ||
function _typeCast(v) { } | ||
exports._typeCast = _typeCast; | ||
/** | ||
@@ -67,0 +67,0 @@ * Type-safe Object.assign that checks that part is indeed a Partial<T> |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._hc = exports._hb = exports._kb = exports._mb = exports._gb = void 0; | ||
exports._gb = _gb; | ||
exports._mb = _mb; | ||
exports._kb = _kb; | ||
exports._hb = _hb; | ||
exports._hc = _hc; | ||
function _gb(b) { | ||
return Math.round(b / 1024 ** 3); | ||
} | ||
exports._gb = _gb; | ||
function _mb(b) { | ||
return Math.round(b / 1024 ** 2); | ||
} | ||
exports._mb = _mb; | ||
function _kb(b) { | ||
return Math.round(b / 1024); | ||
} | ||
exports._kb = _kb; | ||
/** | ||
@@ -32,3 +33,2 @@ * Byte size to Human byte size string | ||
} | ||
exports._hb = _hb; | ||
/** | ||
@@ -52,2 +52,1 @@ * hc stands for "human count", similar to "human bytes" `_hb` function. | ||
} | ||
exports._hc = _hc; |
@@ -1,3 +0,1 @@ | ||
/// <reference lib="es2022" /> | ||
/// <reference lib="dom" /> | ||
import { StringMap } from './types'; | ||
@@ -4,0 +2,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ZodValidationError = exports.zSafeValidate = exports.zValidate = exports.zIsValid = void 0; | ||
exports.ZodValidationError = void 0; | ||
exports.zIsValid = zIsValid; | ||
exports.zValidate = zValidate; | ||
exports.zSafeValidate = zSafeValidate; | ||
const zod_1 = require("zod"); | ||
@@ -10,3 +13,2 @@ const stringify_1 = require("../string/stringify"); | ||
} | ||
exports.zIsValid = zIsValid; | ||
function zValidate(value, schema) { | ||
@@ -19,3 +21,2 @@ const r = zSafeValidate(value, schema); | ||
} | ||
exports.zValidate = zValidate; | ||
function zSafeValidate(value, schema) { | ||
@@ -31,3 +32,2 @@ const r = schema.safeParse(value); | ||
} | ||
exports.zSafeValidate = zSafeValidate; | ||
class ZodValidationError extends zod_1.ZodError { | ||
@@ -34,0 +34,0 @@ constructor(issues, value, schema) { |
{ | ||
"name": "@naturalcycles/js-lib", | ||
"version": "14.241.0", | ||
"version": "14.241.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "prepare": "husky", |
@@ -7,3 +7,3 @@ import type { NumberEnum, StringEnum } from './types' | ||
export function _numberEnumKeys<T extends NumberEnum>(en: T): (keyof T)[] { | ||
return Object.values(en).filter(k => typeof k === 'string') as string[] | ||
return Object.values(en).filter(k => typeof k === 'string') | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -35,3 +35,3 @@ import type { | ||
typesByKey[key] ||= new Set<Type>() | ||
typesByKey[key]!.add(getTypeOfValue(r[key])) | ||
typesByKey[key].add(getTypeOfValue(r[key])) | ||
}) | ||
@@ -38,0 +38,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1047380
31618