@flemist/simple-utils 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/build/browser/index.cjs +1 -1
  2. package/build/browser/index.mjs +175 -146
  3. package/build/common/async/Locker.d.ts +28 -0
  4. package/build/common/async/index.d.ts +2 -0
  5. package/build/common/async/promise.d.ts +7 -0
  6. package/build/common/cache/Cache.d.ts +46 -0
  7. package/build/common/cache/CacheStats.d.ts +20 -0
  8. package/build/common/cache/MemoryStorage.d.ts +11 -0
  9. package/build/common/cache/getHashKey.d.ts +1 -0
  10. package/build/common/cache/getJsonKey.d.ts +1 -0
  11. package/build/common/cache/index.d.ts +6 -0
  12. package/build/common/cache/types.d.ts +28 -0
  13. package/build/common/converter/converterErrorToBuffer.d.ts +2 -0
  14. package/build/common/converter/converterJson.d.ts +2 -0
  15. package/build/common/converter/converterJsonBuffer.d.ts +2 -0
  16. package/build/common/converter/converterStringToBuffer.d.ts +2 -0
  17. package/build/common/converter/helpers.d.ts +13 -0
  18. package/build/common/converter/index.d.ts +8 -0
  19. package/build/common/converter/mapObjectConverter.d.ts +2 -0
  20. package/build/common/converter/setArrayConverter.d.ts +2 -0
  21. package/build/common/converter/types.d.ts +41 -0
  22. package/build/common/gzip/compressGzip.d.ts +35 -0
  23. package/build/common/gzip/decompressGzip.d.ts +2 -0
  24. package/build/common/gzip/index.d.ts +2 -0
  25. package/build/common/index.cjs +1 -1
  26. package/build/common/index.d.ts +3 -0
  27. package/build/common/index.mjs +175 -146
  28. package/build/common/string/index.d.ts +1 -1
  29. package/build/node/cache/FileStatStorage.d.ts +23 -0
  30. package/build/node/cache/FileStorage.d.ts +29 -0
  31. package/build/node/cache/createConverterSubPath.d.ts +12 -0
  32. package/build/node/cache/createFileCacheOptions.d.ts +15 -0
  33. package/build/node/cache/generateTempFileName.d.ts +1 -0
  34. package/build/node/cache/index.d.ts +6 -0
  35. package/build/node/cache/writeFileThroughTmp.d.ts +2 -0
  36. package/build/node/fs/index.d.ts +1 -0
  37. package/build/node/fs/readDirRecursive.d.ts +6 -0
  38. package/build/node/index.cjs +8 -8
  39. package/build/node/index.d.ts +1 -0
  40. package/build/node/index.mjs +1063 -606
  41. package/build/node/test/helpers/common.d.ts +2 -0
  42. package/build/node/test/helpers/createTestE2e.d.ts +30 -0
  43. package/build/node/test/helpers/index.d.ts +3 -0
  44. package/build/node/test/helpers/waitPageStable.d.ts +35 -0
  45. package/build/node/test/index.d.ts +1 -0
  46. package/build/urlGet-BoqnOos7.js +17 -0
  47. package/build/urlGet-OHY_Qdk-.mjs +2416 -0
  48. package/package.json +37 -38
  49. package/build/common/time/dateToString.d.ts +0 -2
  50. package/build/urlGet-CerQ1cKh.js +0 -17
  51. package/build/urlGet-DZEwtNXt.mjs +0 -2000
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../urlGet-CerQ1cKh.js");exports.CheckError=t.CheckError;exports.ConsoleMessageLevel=t.ConsoleMessageLevel;exports.Lazy=t.Lazy;exports.LazyWithId=t.LazyWithId;exports.LogLevel=t.LogLevel;exports.MAX_REPORT_ITEMS_DEFAULT=t.MAX_REPORT_ITEMS_DEFAULT;exports.MatchInternalError=t.MatchInternalError;exports.Matcher=t.Matcher;exports.MatcherAny=t.MatcherAny;exports.MatcherArray=t.MatcherArray;exports.MatcherArrayItem=t.MatcherArrayItem;exports.MatcherConvert=t.MatcherConvert;exports.MatcherCustom=t.MatcherCustom;exports.MatcherFew=t.MatcherFew;exports.MatcherIn=t.MatcherIn;exports.MatcherInstanceOf=t.MatcherInstanceOf;exports.MatcherIs=t.MatcherIs;exports.MatcherNever=t.MatcherNever;exports.MatcherNot=t.MatcherNot;exports.MatcherNumber=t.MatcherNumber;exports.MatcherObject=t.MatcherObject;exports.MatcherObjectEntry=t.MatcherObjectEntry;exports.MatcherRef=t.MatcherRef;exports.MatcherString=t.MatcherString;exports.Random=t.Random;exports.Subject=t.Subject;exports.SubjectWithId=t.SubjectWithId;exports.UNIQUE_PSEUDO_RANDOM_MAX_COUNT=t.UNIQUE_PSEUDO_RANDOM_MAX_COUNT;exports.alertConsole=t.alertConsole;exports.alertReplace=t.alertReplace;exports.argsToString=t.argsToString;exports.check=t.check;exports.checkFunc=t.checkFunc;exports.consoleIntercept=t.consoleIntercept;exports.consoleMessageToString=t.consoleMessageToString;exports.consoleReplace=t.consoleReplace;exports.convertTimeZone=t.convertTimeZone;exports.createMatchResult=t.createMatchResult;exports.createMatchResultBoolean=t.createMatchResultBoolean;exports.createMatchResultError=t.createMatchResultError;exports.createTaskDelayRetry=t.createTaskDelayRetry;exports.createUniquePseudoRandom=t.createUniquePseudoRandom;exports.dateNowUnique=t.dateNowUnique;exports.deepCloneJsonLike=t.deepCloneJsonLike;exports.deepEqualJsonLike=t.deepEqualJsonLike;exports.deepEqualJsonLikeMap=t.deepEqualJsonLikeMap;exports.equalArray=t.equalArray;exports.escapeHtml=t.escapeHtml;exports.escapeRegExp=t.escapeRegExp;exports.expectedToString=t.expectedToString;exports.filterMatchResult=t.filterMatchResult;exports.filterMatchResultNested=t.filterMatchResultNested;exports.fixStackTrace=t.fixStackTrace;exports.formatAny=t.formatAny;exports.formatDate=t.formatDate;exports.formatDateFileName=t.formatDateFileName;exports.getConsoleMessages=t.getConsoleMessages;exports.getDateInet=t.getDateInet;exports.getNormalizedObject=t.getNormalizedObject;exports.getObjectId=t.getObjectId;exports.getRandomFunc=t.getRandomFunc;exports.getRandomSeed=t.getRandomSeed;exports.getStackTrace=t.getStackTrace;exports.isMatcher=t.isMatcher;exports.isObservable=t.isObservable;exports.match=t.match;exports.matchAnd=t.matchAnd;exports.matchAndPipe=t.matchAndPipe;exports.matchAny=t.matchAny;exports.matchArray=t.matchArray;exports.matchArrayBuffer=t.matchArrayBuffer;exports.matchArrayIncludes=t.matchArrayIncludes;exports.matchArrayItem=t.matchArrayItem;exports.matchArrayLength=t.matchArrayLength;exports.matchArrayWith=t.matchArrayWith;exports.matchBoolean=t.matchBoolean;exports.matchConstructor=t.matchConstructor;exports.matchConvert=t.matchConvert;exports.matchCustom=t.matchCustom;exports.matchDeep=t.matchDeep;exports.matchEnum=t.matchEnum;exports.matchFloat=t.matchFloat;exports.matchIn=t.matchIn;exports.matchInstanceOf=t.matchInstanceOf;exports.matchInt=t.matchInt;exports.matchIntDate=t.matchIntDate;exports.matchIs=t.matchIs;exports.matchIsNonStrict=t.matchIsNonStrict;exports.matchNever=t.matchNever;exports.matchNot=t.matchNot;exports.matchNotNullish=t.matchNotNullish;exports.matchNullish=t.matchNullish;exports.matchNumber=t.matchNumber;exports.matchObject=t.matchObject;exports.matchObjectEntries=t.matchObjectEntries;exports.matchObjectEntry=t.matchObjectEntry;exports.matchObjectKey=t.matchObjectKey;exports.matchObjectKeyValue=t.matchObjectKeyValue;exports.matchObjectKeys=t.matchObjectKeys;exports.matchObjectKeysNotNull=t.matchObjectKeysNotNull;exports.matchObjectPartial=t.matchObjectPartial;exports.matchObjectValue=t.matchObjectValue;exports.matchObjectValues=t.matchObjectValues;exports.matchObjectWith=t.matchObjectWith;exports.matchOptional=t.matchOptional;exports.matchOr=t.matchOr;exports.matchOrPipe=t.matchOrPipe;exports.matchRange=t.matchRange;exports.matchRangeDate=t.matchRangeDate;exports.matchRef=t.matchRef;exports.matchResultNestedToString=t.matchResultNestedToString;exports.matchResultToString=t.matchResultToString;exports.matchString=t.matchString;exports.matchStringLength=t.matchStringLength;exports.matchTypeOf=t.matchTypeOf;exports.matchUuid=t.matchUuid;exports.matchValueState=t.matchValueState;exports.max=t.max;exports.min=t.min;exports.minMax=t.minMax;exports.numberMod=t.numberMod;exports.randomBoolean=t.randomBoolean;exports.randomEnum=t.randomEnum;exports.randomFloat=t.randomFloat;exports.randomIndexWeighted=t.randomIndexWeighted;exports.randomInt=t.randomInt;exports.randomItem=t.randomItem;exports.randomItems=t.randomItems;exports.setFuncName=t.setFuncName;exports.sha256=t.sha256;exports.sha256Buffer=t.sha256Buffer;exports.timeoutAbortController=t.timeoutAbortController;exports.toHex=t.toHex;exports.truncateString=t.truncateString;exports.urlGetBoolean=t.urlGetBoolean;exports.urlGetFloat=t.urlGetFloat;exports.urlGetInt=t.urlGetInt;exports.urlGetParams=t.urlGetParams;exports.urlGetString=t.urlGetString;exports.urlParamToBoolean=t.urlParamToBoolean;exports.urlParamToFloat=t.urlParamToFloat;exports.urlParamToInt=t.urlParamToInt;exports.validateMatchResult=t.validateMatchResult;exports.waitObservable=t.waitObservable;exports.withConsoleReplace=t.withConsoleReplace;exports.withRetry=t.withRetry;exports.withTimeout=t.withTimeout;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../urlGet-BoqnOos7.js");exports.Cache=e.Cache;exports.CacheStats=e.CacheStats;exports.CheckError=e.CheckError;exports.ConsoleMessageLevel=e.ConsoleMessageLevel;exports.Lazy=e.Lazy;exports.LazyWithId=e.LazyWithId;exports.Locker=e.Locker;exports.LockerWithId=e.LockerWithId;exports.LogLevel=e.LogLevel;exports.MAX_REPORT_ITEMS_DEFAULT=e.MAX_REPORT_ITEMS_DEFAULT;exports.MatchInternalError=e.MatchInternalError;exports.Matcher=e.Matcher;exports.MatcherAny=e.MatcherAny;exports.MatcherArray=e.MatcherArray;exports.MatcherArrayItem=e.MatcherArrayItem;exports.MatcherConvert=e.MatcherConvert;exports.MatcherCustom=e.MatcherCustom;exports.MatcherFew=e.MatcherFew;exports.MatcherIn=e.MatcherIn;exports.MatcherInstanceOf=e.MatcherInstanceOf;exports.MatcherIs=e.MatcherIs;exports.MatcherNever=e.MatcherNever;exports.MatcherNot=e.MatcherNot;exports.MatcherNumber=e.MatcherNumber;exports.MatcherObject=e.MatcherObject;exports.MatcherObjectEntry=e.MatcherObjectEntry;exports.MatcherRef=e.MatcherRef;exports.MatcherString=e.MatcherString;exports.MemoryStorage=e.MemoryStorage;exports.Random=e.Random;exports.Subject=e.Subject;exports.SubjectWithId=e.SubjectWithId;exports.UNIQUE_PSEUDO_RANDOM_MAX_COUNT=e.UNIQUE_PSEUDO_RANDOM_MAX_COUNT;exports.alertConsole=e.alertConsole;exports.alertReplace=e.alertReplace;exports.argsToString=e.argsToString;exports.check=e.check;exports.checkFunc=e.checkFunc;exports.compressGzip=e.compressGzip;exports.consoleIntercept=e.consoleIntercept;exports.consoleMessageToString=e.consoleMessageToString;exports.consoleReplace=e.consoleReplace;exports.convertTimeZone=e.convertTimeZone;exports.converterErrorToBuffer=e.converterErrorToBuffer;exports.converterJson=e.converterJson;exports.converterJsonBuffer=e.converterJsonBuffer;exports.converterStringToBuffer=e.converterStringToBuffer;exports.createMatchResult=e.createMatchResult;exports.createMatchResultBoolean=e.createMatchResultBoolean;exports.createMatchResultError=e.createMatchResultError;exports.createTaskDelayRetry=e.createTaskDelayRetry;exports.createUniquePseudoRandom=e.createUniquePseudoRandom;exports.dateNowUnique=e.dateNowUnique;exports.decompressGzip=e.decompressGzip;exports.deepCloneJsonLike=e.deepCloneJsonLike;exports.deepEqualJsonLike=e.deepEqualJsonLike;exports.deepEqualJsonLikeMap=e.deepEqualJsonLikeMap;exports.equalArray=e.equalArray;exports.escapeHtml=e.escapeHtml;exports.escapeRegExp=e.escapeRegExp;exports.expectedToString=e.expectedToString;exports.filterMatchResult=e.filterMatchResult;exports.filterMatchResultNested=e.filterMatchResultNested;exports.fixStackTrace=e.fixStackTrace;exports.formatAny=e.formatAny;exports.formatDate=e.formatDate;exports.formatDateFileName=e.formatDateFileName;exports.getConsoleMessages=e.getConsoleMessages;exports.getDateInet=e.getDateInet;exports.getHashKey=e.getHashKey;exports.getJsonKey=e.getJsonKey;exports.getNormalizedObject=e.getNormalizedObject;exports.getObjectId=e.getObjectId;exports.getRandomFunc=e.getRandomFunc;exports.getRandomSeed=e.getRandomSeed;exports.getStackTrace=e.getStackTrace;exports.isGzipCompressed=e.isGzipCompressed;exports.isMatcher=e.isMatcher;exports.isObservable=e.isObservable;exports.mapObjectConverter=e.mapObjectConverter;exports.match=e.match;exports.matchAnd=e.matchAnd;exports.matchAndPipe=e.matchAndPipe;exports.matchAny=e.matchAny;exports.matchArray=e.matchArray;exports.matchArrayBuffer=e.matchArrayBuffer;exports.matchArrayIncludes=e.matchArrayIncludes;exports.matchArrayItem=e.matchArrayItem;exports.matchArrayLength=e.matchArrayLength;exports.matchArrayWith=e.matchArrayWith;exports.matchBoolean=e.matchBoolean;exports.matchConstructor=e.matchConstructor;exports.matchConvert=e.matchConvert;exports.matchCustom=e.matchCustom;exports.matchDeep=e.matchDeep;exports.matchEnum=e.matchEnum;exports.matchFloat=e.matchFloat;exports.matchIn=e.matchIn;exports.matchInstanceOf=e.matchInstanceOf;exports.matchInt=e.matchInt;exports.matchIntDate=e.matchIntDate;exports.matchIs=e.matchIs;exports.matchIsNonStrict=e.matchIsNonStrict;exports.matchNever=e.matchNever;exports.matchNot=e.matchNot;exports.matchNotNullish=e.matchNotNullish;exports.matchNullish=e.matchNullish;exports.matchNumber=e.matchNumber;exports.matchObject=e.matchObject;exports.matchObjectEntries=e.matchObjectEntries;exports.matchObjectEntry=e.matchObjectEntry;exports.matchObjectKey=e.matchObjectKey;exports.matchObjectKeyValue=e.matchObjectKeyValue;exports.matchObjectKeys=e.matchObjectKeys;exports.matchObjectKeysNotNull=e.matchObjectKeysNotNull;exports.matchObjectPartial=e.matchObjectPartial;exports.matchObjectValue=e.matchObjectValue;exports.matchObjectValues=e.matchObjectValues;exports.matchObjectWith=e.matchObjectWith;exports.matchOptional=e.matchOptional;exports.matchOr=e.matchOr;exports.matchOrPipe=e.matchOrPipe;exports.matchRange=e.matchRange;exports.matchRangeDate=e.matchRangeDate;exports.matchRef=e.matchRef;exports.matchResultNestedToString=e.matchResultNestedToString;exports.matchResultToString=e.matchResultToString;exports.matchString=e.matchString;exports.matchStringLength=e.matchStringLength;exports.matchTypeOf=e.matchTypeOf;exports.matchUuid=e.matchUuid;exports.matchValueState=e.matchValueState;exports.max=e.max;exports.min=e.min;exports.minMax=e.minMax;exports.numberMod=e.numberMod;exports.promiseAllWait=e.promiseAllWait;exports.randomBoolean=e.randomBoolean;exports.randomEnum=e.randomEnum;exports.randomFloat=e.randomFloat;exports.randomIndexWeighted=e.randomIndexWeighted;exports.randomInt=e.randomInt;exports.randomItem=e.randomItem;exports.randomItems=e.randomItems;exports.setArrayConverter=e.setArrayConverter;exports.setFuncName=e.setFuncName;exports.sha256=e.sha256;exports.sha256Buffer=e.sha256Buffer;exports.timeoutAbortController=e.timeoutAbortController;exports.toConvertFrom=e.toConvertFrom;exports.toConvertTo=e.toConvertTo;exports.toConvertWithDefaultFrom=e.toConvertWithDefaultFrom;exports.toConvertWithDefaultTo=e.toConvertWithDefaultTo;exports.toConverter=e.toConverter;exports.toConverterFrom=e.toConverterFrom;exports.toConverterTo=e.toConverterTo;exports.toConverterWithDefault=e.toConverterWithDefault;exports.toConverterWithDefaultFrom=e.toConverterWithDefaultFrom;exports.toConverterWithDefaultTo=e.toConverterWithDefaultTo;exports.toCorrect=e.toCorrect;exports.toCorrectWithDefault=e.toCorrectWithDefault;exports.toHex=e.toHex;exports.truncateString=e.truncateString;exports.urlGetBoolean=e.urlGetBoolean;exports.urlGetFloat=e.urlGetFloat;exports.urlGetInt=e.urlGetInt;exports.urlGetParams=e.urlGetParams;exports.urlGetString=e.urlGetString;exports.urlParamToBoolean=e.urlParamToBoolean;exports.urlParamToFloat=e.urlParamToFloat;exports.urlParamToInt=e.urlParamToInt;exports.validateMatchResult=e.validateMatchResult;exports.waitObservable=e.waitObservable;exports.withConsoleReplace=e.withConsoleReplace;exports.withRetry=e.withRetry;exports.withTimeout=e.withTimeout;
@@ -1,150 +1,179 @@
1
- import { ac as e, M as s, W as c, X as r, P as h, aj as m, a2 as n, a3 as o, b5 as l, b6 as b, b7 as u, b8 as i, b9 as M, ba as d, bb as g, bk as O, bc as I, bd as R, be as y, bf as N, bg as p, bh as A, bi as S, bj as j, R as T, $ as f, a0 as E, U as C, L, H as k, a6 as v, ad as D, ae as F, K as P, I as x, N as U, q as B, aa as _, a9 as q, a8 as w, Z as G, l as W, o as K, B as V, C as z, D as J, E as H, z as X, A as Q, a5 as Z, ag as Y, af as $, Q as aa, u as ta, v as ea, w as sa, J as ca, p as ra, F as ha, x as ma, d as na, g as oa, S as la, a4 as ba, _ as ua, ab as ia, aH as Ma, aJ as da, am as ga, ak as Oa, b4 as Ia, al as Ra, ap as ya, aL as Na, aO as pa, aD as Aa, aC as Sa, aq as ja, aZ as Ta, ax as fa, aY as Ea, av as Ca, aX as La, aA as ka, au as va, a_ as Da, as as Fa, ar as Pa, ao as xa, b1 as Ua, aF as Ba, aE as _a, at as qa, aw as wa, aR as Ga, aS as Wa, aT as Ka, aV as Va, aP as za, aW as Ja, ay as Ha, aU as Xa, aQ as Qa, aN as Za, aK as Ya, aG as $a, aI as at, a$ as tt, b0 as et, an as st, ah as ct, ai as rt, az as ht, aM as mt, aB as nt, b2 as ot, b3 as lt, b as bt, m as ut, c as it, n as Mt, f as dt, k as gt, r as Ot, h as It, e as Rt, i as yt, j as Nt, G as pt, a as At, s as St, T as jt, t as Tt, y as ft, bq as Et, bs as Ct, br as Lt, bl as kt, bp as vt, bm as Dt, bo as Ft, bn as Pt, a7 as xt, a1 as Ut, O as Bt, Y as _t, V as qt } from "../urlGet-DZEwtNXt.mjs";
1
+ import { C as e, b as s, aF as r, ac as c, ak as o, al as n, am as h, an as m, af as b, aM as l, av as i, aw as u, by as M, bz as d, bA as g, bB as C, bC as f, bD as y, bE as O, bN as I, bF as p, bG as v, bH as R, bI as T, bJ as S, bK as A, bL as N, bM as j, M as E, R as D, as as F, at as L, U as W, ab as k, a7 as B, az as P, aG as x, aH as G, y as U, aa as w, a8 as z, ad as J, V as K, r as _, o as q, q as V, p as H, aD as Q, aC as X, aB as Z, ap as Y, Q as $, S as aa, A as ta, a1 as ea, a2 as sa, a3 as ra, a4 as ca, W as oa, X as na, ay as ha, aJ as ma, aI as ba, ag as la, Y as ia, Z as ua, _ as Ma, a9 as da, T as ga, a as Ca, g as fa, a5 as ya, $ as Oa, H as Ia, G as pa, ah as va, z as Ra, ax as Ta, ar as Sa, s as Aa, aE as Na, b8 as ja, ba as Ea, aP as Da, aN as Fa, bx as La, aO as Wa, aS as ka, bc as Ba, bf as Pa, b4 as xa, b3 as Ga, aT as Ua, bq as wa, a_ as za, bp as Ja, aY as Ka, bo as _a, b1 as qa, aX as Va, br as Ha, aV as Qa, aU as Xa, aR as Za, bu as Ya, b6 as $a, b5 as at, aW as tt, aZ as et, bi as st, bj as rt, bk as ct, bm as ot, bg as nt, bn as ht, a$ as mt, bl as bt, bh as lt, be as it, bb as ut, b7 as Mt, b9 as dt, bs as gt, bt as Ct, aQ as ft, aK as yt, aL as Ot, b0 as It, bd as pt, b2 as vt, bv as Rt, bw as Tt, D as St, B as At, E as Nt, F as jt, aq as Et, K as Dt, P as Ft, I as Lt, L as Wt, J as kt, N as Bt, O as Pt, u as xt, a6 as Gt, w as Ut, v as wt, ai as zt, k as Jt, j as Kt, e as _t, d as qt, n as Vt, m as Ht, l as Qt, i as Xt, h as Zt, f as Yt, c as $t, t as ae, x as te, a0 as ee, bT as se, bV as re, bU as ce, bO as oe, bS as ne, bP as he, bR as me, bQ as be, aA as le, au as ie, ae as ue, ao as Me, aj as de } from "../urlGet-OHY_Qdk-.mjs";
2
2
  export {
3
- e as CheckError,
4
- s as ConsoleMessageLevel,
5
- c as Lazy,
6
- r as LazyWithId,
7
- h as LogLevel,
8
- m as MAX_REPORT_ITEMS_DEFAULT,
9
- n as MatchInternalError,
10
- o as Matcher,
11
- l as MatcherAny,
12
- b as MatcherArray,
13
- u as MatcherArrayItem,
14
- i as MatcherConvert,
15
- M as MatcherCustom,
16
- d as MatcherFew,
17
- g as MatcherIn,
18
- O as MatcherInstanceOf,
19
- I as MatcherIs,
20
- R as MatcherNever,
21
- y as MatcherNot,
22
- N as MatcherNumber,
23
- p as MatcherObject,
3
+ e as Cache,
4
+ s as CacheStats,
5
+ r as CheckError,
6
+ c as ConsoleMessageLevel,
7
+ o as Lazy,
8
+ n as LazyWithId,
9
+ h as Locker,
10
+ m as LockerWithId,
11
+ b as LogLevel,
12
+ l as MAX_REPORT_ITEMS_DEFAULT,
13
+ i as MatchInternalError,
14
+ u as Matcher,
15
+ M as MatcherAny,
16
+ d as MatcherArray,
17
+ g as MatcherArrayItem,
18
+ C as MatcherConvert,
19
+ f as MatcherCustom,
20
+ y as MatcherFew,
21
+ O as MatcherIn,
22
+ I as MatcherInstanceOf,
23
+ p as MatcherIs,
24
+ v as MatcherNever,
25
+ R as MatcherNot,
26
+ T as MatcherNumber,
27
+ S as MatcherObject,
24
28
  A as MatcherObjectEntry,
25
- S as MatcherRef,
29
+ N as MatcherRef,
26
30
  j as MatcherString,
27
- T as Random,
28
- f as Subject,
29
- E as SubjectWithId,
30
- C as UNIQUE_PSEUDO_RANDOM_MAX_COUNT,
31
- L as alertConsole,
32
- k as alertReplace,
33
- v as argsToString,
34
- D as check,
35
- F as checkFunc,
36
- P as consoleIntercept,
37
- x as consoleMessageToString,
38
- U as consoleReplace,
39
- B as convertTimeZone,
40
- _ as createMatchResult,
41
- q as createMatchResultBoolean,
42
- w as createMatchResultError,
43
- G as createTaskDelayRetry,
44
- W as createUniquePseudoRandom,
45
- K as dateNowUnique,
46
- V as deepCloneJsonLike,
47
- z as deepEqualJsonLike,
48
- J as deepEqualJsonLikeMap,
49
- H as equalArray,
50
- X as escapeHtml,
51
- Q as escapeRegExp,
52
- Z as expectedToString,
53
- Y as filterMatchResult,
54
- $ as filterMatchResultNested,
55
- aa as fixStackTrace,
56
- ta as formatAny,
57
- ea as formatDate,
58
- sa as formatDateFileName,
59
- ca as getConsoleMessages,
60
- ra as getDateInet,
61
- ha as getNormalizedObject,
62
- ma as getObjectId,
63
- na as getRandomFunc,
64
- oa as getRandomSeed,
65
- la as getStackTrace,
66
- ba as isMatcher,
67
- ua as isObservable,
68
- ia as match,
69
- Ma as matchAnd,
70
- da as matchAndPipe,
71
- ga as matchAny,
72
- Oa as matchArray,
73
- Ia as matchArrayBuffer,
74
- Ra as matchArrayIncludes,
75
- ya as matchArrayItem,
76
- Na as matchArrayLength,
77
- pa as matchArrayWith,
78
- Aa as matchBoolean,
79
- Sa as matchConstructor,
80
- ja as matchConvert,
81
- Ta as matchCustom,
82
- fa as matchDeep,
83
- Ea as matchEnum,
84
- Ca as matchFloat,
85
- La as matchIn,
86
- ka as matchInstanceOf,
87
- va as matchInt,
88
- Da as matchIntDate,
89
- Fa as matchIs,
90
- Pa as matchIsNonStrict,
91
- xa as matchNever,
92
- Ua as matchNot,
93
- Ba as matchNotNullish,
94
- _a as matchNullish,
95
- qa as matchNumber,
96
- wa as matchObject,
97
- Ga as matchObjectEntries,
98
- Wa as matchObjectEntry,
99
- Ka as matchObjectKey,
100
- Va as matchObjectKeyValue,
101
- za as matchObjectKeys,
102
- Ja as matchObjectKeysNotNull,
103
- Ha as matchObjectPartial,
104
- Xa as matchObjectValue,
105
- Qa as matchObjectValues,
106
- Za as matchObjectWith,
107
- Ya as matchOptional,
108
- $a as matchOr,
109
- at as matchOrPipe,
110
- tt as matchRange,
111
- et as matchRangeDate,
112
- st as matchRef,
113
- ct as matchResultNestedToString,
114
- rt as matchResultToString,
115
- ht as matchString,
116
- mt as matchStringLength,
117
- nt as matchTypeOf,
118
- ot as matchUuid,
119
- lt as matchValueState,
120
- bt as max,
121
- ut as min,
122
- it as minMax,
123
- Mt as numberMod,
124
- dt as randomBoolean,
125
- gt as randomEnum,
126
- Ot as randomFloat,
127
- It as randomIndexWeighted,
128
- Rt as randomInt,
129
- yt as randomItem,
130
- Nt as randomItems,
131
- pt as setFuncName,
132
- At as sha256,
133
- St as sha256Buffer,
134
- jt as timeoutAbortController,
135
- Tt as toHex,
136
- ft as truncateString,
137
- Et as urlGetBoolean,
138
- Ct as urlGetFloat,
139
- Lt as urlGetInt,
140
- kt as urlGetParams,
141
- vt as urlGetString,
142
- Dt as urlParamToBoolean,
143
- Ft as urlParamToFloat,
144
- Pt as urlParamToInt,
145
- xt as validateMatchResult,
146
- Ut as waitObservable,
147
- Bt as withConsoleReplace,
148
- _t as withRetry,
149
- qt as withTimeout
31
+ E as MemoryStorage,
32
+ D as Random,
33
+ F as Subject,
34
+ L as SubjectWithId,
35
+ W as UNIQUE_PSEUDO_RANDOM_MAX_COUNT,
36
+ k as alertConsole,
37
+ B as alertReplace,
38
+ P as argsToString,
39
+ x as check,
40
+ G as checkFunc,
41
+ U as compressGzip,
42
+ w as consoleIntercept,
43
+ z as consoleMessageToString,
44
+ J as consoleReplace,
45
+ K as convertTimeZone,
46
+ _ as converterErrorToBuffer,
47
+ q as converterJson,
48
+ V as converterJsonBuffer,
49
+ H as converterStringToBuffer,
50
+ Q as createMatchResult,
51
+ X as createMatchResultBoolean,
52
+ Z as createMatchResultError,
53
+ Y as createTaskDelayRetry,
54
+ $ as createUniquePseudoRandom,
55
+ aa as dateNowUnique,
56
+ ta as decompressGzip,
57
+ ea as deepCloneJsonLike,
58
+ sa as deepEqualJsonLike,
59
+ ra as deepEqualJsonLikeMap,
60
+ ca as equalArray,
61
+ oa as escapeHtml,
62
+ na as escapeRegExp,
63
+ ha as expectedToString,
64
+ ma as filterMatchResult,
65
+ ba as filterMatchResultNested,
66
+ la as fixStackTrace,
67
+ ia as formatAny,
68
+ ua as formatDate,
69
+ Ma as formatDateFileName,
70
+ da as getConsoleMessages,
71
+ ga as getDateInet,
72
+ Ca as getHashKey,
73
+ fa as getJsonKey,
74
+ ya as getNormalizedObject,
75
+ Oa as getObjectId,
76
+ Ia as getRandomFunc,
77
+ pa as getRandomSeed,
78
+ va as getStackTrace,
79
+ Ra as isGzipCompressed,
80
+ Ta as isMatcher,
81
+ Sa as isObservable,
82
+ Aa as mapObjectConverter,
83
+ Na as match,
84
+ ja as matchAnd,
85
+ Ea as matchAndPipe,
86
+ Da as matchAny,
87
+ Fa as matchArray,
88
+ La as matchArrayBuffer,
89
+ Wa as matchArrayIncludes,
90
+ ka as matchArrayItem,
91
+ Ba as matchArrayLength,
92
+ Pa as matchArrayWith,
93
+ xa as matchBoolean,
94
+ Ga as matchConstructor,
95
+ Ua as matchConvert,
96
+ wa as matchCustom,
97
+ za as matchDeep,
98
+ Ja as matchEnum,
99
+ Ka as matchFloat,
100
+ _a as matchIn,
101
+ qa as matchInstanceOf,
102
+ Va as matchInt,
103
+ Ha as matchIntDate,
104
+ Qa as matchIs,
105
+ Xa as matchIsNonStrict,
106
+ Za as matchNever,
107
+ Ya as matchNot,
108
+ $a as matchNotNullish,
109
+ at as matchNullish,
110
+ tt as matchNumber,
111
+ et as matchObject,
112
+ st as matchObjectEntries,
113
+ rt as matchObjectEntry,
114
+ ct as matchObjectKey,
115
+ ot as matchObjectKeyValue,
116
+ nt as matchObjectKeys,
117
+ ht as matchObjectKeysNotNull,
118
+ mt as matchObjectPartial,
119
+ bt as matchObjectValue,
120
+ lt as matchObjectValues,
121
+ it as matchObjectWith,
122
+ ut as matchOptional,
123
+ Mt as matchOr,
124
+ dt as matchOrPipe,
125
+ gt as matchRange,
126
+ Ct as matchRangeDate,
127
+ ft as matchRef,
128
+ yt as matchResultNestedToString,
129
+ Ot as matchResultToString,
130
+ It as matchString,
131
+ pt as matchStringLength,
132
+ vt as matchTypeOf,
133
+ Rt as matchUuid,
134
+ Tt as matchValueState,
135
+ St as max,
136
+ At as min,
137
+ Nt as minMax,
138
+ jt as numberMod,
139
+ Et as promiseAllWait,
140
+ Dt as randomBoolean,
141
+ Ft as randomEnum,
142
+ Lt as randomFloat,
143
+ Wt as randomIndexWeighted,
144
+ kt as randomInt,
145
+ Bt as randomItem,
146
+ Pt as randomItems,
147
+ xt as setArrayConverter,
148
+ Gt as setFuncName,
149
+ Ut as sha256,
150
+ wt as sha256Buffer,
151
+ zt as timeoutAbortController,
152
+ Jt as toConvertFrom,
153
+ Kt as toConvertTo,
154
+ _t as toConvertWithDefaultFrom,
155
+ qt as toConvertWithDefaultTo,
156
+ Vt as toConverter,
157
+ Ht as toConverterFrom,
158
+ Qt as toConverterTo,
159
+ Xt as toConverterWithDefault,
160
+ Zt as toConverterWithDefaultFrom,
161
+ Yt as toConverterWithDefaultTo,
162
+ $t as toCorrect,
163
+ ae as toCorrectWithDefault,
164
+ te as toHex,
165
+ ee as truncateString,
166
+ se as urlGetBoolean,
167
+ re as urlGetFloat,
168
+ ce as urlGetInt,
169
+ oe as urlGetParams,
170
+ ne as urlGetString,
171
+ he as urlParamToBoolean,
172
+ me as urlParamToFloat,
173
+ be as urlParamToInt,
174
+ le as validateMatchResult,
175
+ ie as waitObservable,
176
+ ue as withConsoleReplace,
177
+ Me as withRetry,
178
+ de as withTimeout
150
179
  };
@@ -0,0 +1,28 @@
1
+ import { PromiseLikeOrValue } from '@flemist/async-utils';
2
+ import { PromiseOrValue } from '../types/common';
3
+ export type LockFunc = {
4
+ <T>(handler: () => PromiseLike<T>): Promise<T>;
5
+ <T>(handler: () => PromiseLikeOrValue<T>): PromiseOrValue<T>;
6
+ };
7
+ export interface ILocker {
8
+ lock: LockFunc;
9
+ hasQueued: boolean;
10
+ }
11
+ export declare class Locker implements ILocker {
12
+ private _lockPromise;
13
+ get hasQueued(): boolean;
14
+ lock<T>(handler: () => PromiseLikeOrValue<T>): PromiseOrValue<T>;
15
+ }
16
+ export type LockWithIdFunc<Id> = {
17
+ <T>(id: Id, handler: () => PromiseLike<T>): Promise<T>;
18
+ <T>(id: Id, handler: () => PromiseLikeOrValue<T>): PromiseOrValue<T>;
19
+ };
20
+ export interface ILockerWithId<Id> {
21
+ lock: LockWithIdFunc<Id>;
22
+ hasQueued(id: Id): boolean;
23
+ }
24
+ export declare class LockerWithId<Id> implements ILockerWithId<Id> {
25
+ private readonly _lockers;
26
+ lock<T>(id: Id, handler: () => PromiseLikeOrValue<T>): PromiseOrValue<T>;
27
+ hasQueued(id: Id): boolean;
28
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './abort';
2
2
  export * from './lazy';
3
+ export * from './Locker';
3
4
  export * from './retry';
5
+ export * from './promise';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Same as Promise.all but waits for all promises to settle
3
+ * and throws if any promise is rejected.
4
+ */
5
+ export declare function promiseAllWait<T extends readonly unknown[] | []>(promises: T): Promise<{
6
+ -readonly [P in keyof T]: Awaited<T[P]>;
7
+ }>;
@@ -0,0 +1,46 @@
1
+ import { PromiseLikeOrValue } from '@flemist/async-utils';
2
+ import { CacheStat, ICache, IStorage, IStorageDb } from './types';
3
+ import { ConverterAsync, ConvertToAsync } from '../converter';
4
+ import { ITimeController } from '@flemist/time-controller';
5
+ import { NumberRange } from '../types';
6
+ export type CacheStorages<Key, Value, Error, Stat> = {
7
+ value: IStorage<Key, Value>;
8
+ error: IStorage<Key, Error>;
9
+ stat: IStorageDb<Key, Stat>;
10
+ };
11
+ export type CacheOptions<Input, Value, Error, Stat extends CacheStat, Key = Input, ValueStored = Value, ErrorStored = Error, StatStored = Stat> = {
12
+ converterInput?: null | ConvertToAsync<Input, Key>;
13
+ converterValue?: null | ConverterAsync<Value, ValueStored>;
14
+ converterError?: null | ConverterAsync<Error, ErrorStored>;
15
+ converterStat?: null | ConverterAsync<Stat, StatStored>;
16
+ storages: CacheStorages<Key, ValueStored, ErrorStored, StatStored>;
17
+ /**
18
+ * 1) When adding a new value to the cache, the cache size should not exceed totalSize[1]
19
+ * 2) After freeing up space, the cache size should not become less than totalSize[0]
20
+ * If both conditions cannot be met at the same time, priority is given to the first condition
21
+ * If it is not possible to meet even the first condition, an error is thrown
22
+ */
23
+ totalSize?: null | NumberRange;
24
+ getSize: {
25
+ value: (value: ValueStored) => number;
26
+ error: (error: ErrorStored) => number;
27
+ stat: () => number;
28
+ };
29
+ isExpired?: null | ((stat: Stat) => boolean);
30
+ timeController?: null | ITimeController;
31
+ };
32
+ export declare class Cache<Input, Value, Error, Key, ValueStored, ErrorStored, StatStored> implements ICache<Input, Value> {
33
+ private readonly _options;
34
+ private readonly _timeController;
35
+ private readonly _locker;
36
+ private readonly _stats;
37
+ constructor(options: CacheOptions<Input, Value, Error, CacheStat, Key, ValueStored, ErrorStored, StatStored>);
38
+ private freeUpSpace;
39
+ getOrCreate<T extends Value>(input: Input, func: (input: Input) => PromiseLikeOrValue<T>): Promise<T>;
40
+ delete(input: Input): Promise<void>;
41
+ /**
42
+ * Deletes all cache entries at this moment.
43
+ * But does not prevent new entries from being added during the clearing process
44
+ */
45
+ clear(): Promise<void>;
46
+ }
@@ -0,0 +1,20 @@
1
+ import { CacheStat, ICacheStats, IStorageDb } from './types';
2
+ import { ConverterAsync } from '../converter';
3
+ export type CacheStatOptions<Key, Stat extends CacheStat, StatStored> = {
4
+ storage: IStorageDb<Key, StatStored>;
5
+ converter?: null | ConverterAsync<Stat, StatStored>;
6
+ };
7
+ export declare class CacheStats<Key, Stat extends CacheStat, StatStored> implements ICacheStats<Key, Stat> {
8
+ private readonly _options;
9
+ private _statsMap;
10
+ private _totalSize;
11
+ private _initPromise;
12
+ constructor(options: CacheStatOptions<Key, Stat, StatStored>);
13
+ private loadStatsMap;
14
+ private init;
15
+ private _init;
16
+ getTotalSize(): Promise<number>;
17
+ get(key: Key): Promise<Stat | null>;
18
+ set(key: Key, statNew: Stat | null | undefined): Promise<void>;
19
+ getEntries(): Promise<ReadonlyMap<Key, Stat>>;
20
+ }
@@ -0,0 +1,11 @@
1
+ import { PromiseLikeOrValue } from '@flemist/async-utils';
2
+ import { IStorageDb } from './types';
3
+ export declare class MemoryStorage<Key, Value> implements IStorageDb<Key, Value> {
4
+ private readonly _cache;
5
+ set<T extends Value>(key: Key, value: T): PromiseLikeOrValue<void>;
6
+ get<T extends Value>(key: Key): PromiseLikeOrValue<T | undefined>;
7
+ delete(key: Key): PromiseLikeOrValue<void>;
8
+ clear(): PromiseLikeOrValue<void>;
9
+ getKeys(): PromiseLikeOrValue<Key[]>;
10
+ getEntries(): PromiseLikeOrValue<Map<Key, Value>>;
11
+ }
@@ -0,0 +1 @@
1
+ export declare function getHashKey(obj?: any): string;
@@ -0,0 +1 @@
1
+ export declare function getJsonKey<T>(obj: T): string;
@@ -0,0 +1,6 @@
1
+ export * from './types';
2
+ export * from './Cache';
3
+ export * from './MemoryStorage';
4
+ export * from './getJsonKey';
5
+ export * from './getHashKey';
6
+ export * from './CacheStats';
@@ -0,0 +1,28 @@
1
+ import { PromiseLikeOrValue, PromiseOrValue } from '@flemist/async-utils';
2
+ export type IStorage<Key, Value> = {
3
+ set(key: Key, value: Value): PromiseLikeOrValue<void>;
4
+ get(key: Key): PromiseLikeOrValue<Value | undefined>;
5
+ delete(key: Key): PromiseLikeOrValue<void>;
6
+ getKeys(): PromiseLikeOrValue<Key[]>;
7
+ };
8
+ export type IStorageDb<Key, Value> = IStorage<Key, Value> & {
9
+ getEntries(): PromiseLikeOrValue<ReadonlyMap<Key, Value>>;
10
+ };
11
+ export type ICache<Input, Value> = {
12
+ getOrCreate: <T extends Value>(input: Input, func: (input: Input) => PromiseLikeOrValue<T>) => PromiseOrValue<T>;
13
+ delete(input: Input): PromiseOrValue<void>;
14
+ clear(): PromiseOrValue<void>;
15
+ };
16
+ export type CacheStat = {
17
+ /** Date when the value or error was created last time */
18
+ dateModified: number;
19
+ dateUsed: number;
20
+ size: number;
21
+ hasError?: null | boolean;
22
+ };
23
+ export interface ICacheStats<Key, Stat extends CacheStat> {
24
+ getTotalSize(): PromiseLikeOrValue<number>;
25
+ get(key: Key): PromiseLikeOrValue<Stat | null>;
26
+ set(key: Key, statNew: Stat | null | undefined): PromiseLikeOrValue<void>;
27
+ getEntries(): PromiseLikeOrValue<ReadonlyMap<Key, Stat>>;
28
+ }
@@ -0,0 +1,2 @@
1
+ import { ConverterAsync } from './types';
2
+ export declare const converterErrorToBuffer: ConverterAsync<any, Uint8Array>;
@@ -0,0 +1,2 @@
1
+ import { Converter } from './types';
2
+ export declare const converterJson: Converter<any, string>;
@@ -0,0 +1,2 @@
1
+ import { ConverterAsync } from './types';
2
+ export declare const converterJsonBuffer: ConverterAsync<any, Uint8Array>;
@@ -0,0 +1,2 @@
1
+ import { Converter } from './types';
2
+ export declare const converterStringToBuffer: Converter<string, Uint8Array>;
@@ -0,0 +1,13 @@
1
+ import { Correct, CorrectWithDefault, ConvertWithDefaultTo, ConvertWithDefaultFrom, ConverterWithDefaultTo, ConverterWithDefaultFrom, ConverterWithDefault, ConvertTo, ConvertFrom, ConverterTo, ConverterFrom, Converter } from './types';
2
+ export declare function toCorrectWithDefault<T>(correct: CorrectWithDefault<T> | undefined | null, correctDefault: CorrectWithDefault<T>): CorrectWithDefault<T>;
3
+ export declare function toCorrect<T>(correct: CorrectWithDefault<T> | undefined | null, correctDefault: Correct<T>): Correct<T>;
4
+ export declare function toConvertWithDefaultTo<From, To>(converter: ConvertWithDefaultTo<From, To> | undefined | null, convertDefault: ConvertWithDefaultTo<From, To>): ConvertWithDefaultTo<From, To>;
5
+ export declare function toConvertWithDefaultFrom<From, To>(converter: ConvertWithDefaultFrom<From, To> | undefined | null, convertDefault: ConvertWithDefaultFrom<From, To>): ConvertWithDefaultFrom<From, To>;
6
+ export declare function toConverterWithDefaultTo<From, To>(converter: ConverterWithDefaultTo<From, To> | undefined | null, converterDefault: ConverterWithDefaultTo<From, To>): ConverterWithDefaultTo<From, To>;
7
+ export declare function toConverterWithDefaultFrom<From, To>(converter: ConverterWithDefaultFrom<From, To>, converterDefault: ConverterWithDefaultFrom<From, To>): ConverterWithDefaultFrom<From, To>;
8
+ export declare function toConverterWithDefault<From, To>(converter: ConverterWithDefault<From, To> | undefined | null, converterDefault: ConverterWithDefault<From, To>): ConverterWithDefault<From, To>;
9
+ export declare function toConvertTo<From, To>(converter: ConvertWithDefaultTo<From, To> | undefined | null, convertDefault: ConvertTo<From, To>): ConvertTo<From, To>;
10
+ export declare function toConvertFrom<From, To>(converter: ConvertWithDefaultFrom<From, To> | undefined | null, convertDefault: ConvertFrom<From, To>): ConvertFrom<From, To>;
11
+ export declare function toConverterTo<From, To>(converter: ConverterWithDefaultTo<From, To> | undefined | null, converterDefault: ConverterTo<From, To>): ConverterTo<From, To>;
12
+ export declare function toConverterFrom<From, To>(converter: ConverterWithDefaultFrom<From, To>, converterDefault: ConverterFrom<From, To>): ConverterFrom<From, To>;
13
+ export declare function toConverter<From, To>(converter: ConverterWithDefault<From, To> | undefined | null, converterDefault: Converter<From, To>): Converter<From, To>;
@@ -0,0 +1,8 @@
1
+ export * from './types';
2
+ export * from './helpers';
3
+ export * from './converterJson';
4
+ export * from './converterStringToBuffer';
5
+ export * from './converterJsonBuffer';
6
+ export * from './converterErrorToBuffer';
7
+ export * from './mapObjectConverter';
8
+ export * from './setArrayConverter';
@@ -0,0 +1,2 @@
1
+ import { Converter } from './types';
2
+ export declare const mapObjectConverter: Converter<Map<string, any>, Record<string, any>>;
@@ -0,0 +1,2 @@
1
+ import { Converter } from './types';
2
+ export declare const setArrayConverter: Converter<Set<any>, Array<any>>;