ag-common 0.0.45 → 0.0.49
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.
|
@@ -21,6 +21,7 @@ __exportStar(require("./hashCode"), exports);
|
|
|
21
21
|
__exportStar(require("./i18n"), exports);
|
|
22
22
|
__exportStar(require("./log"), exports);
|
|
23
23
|
__exportStar(require("./math"), exports);
|
|
24
|
+
__exportStar(require("./memo"), exports);
|
|
24
25
|
__exportStar(require("./object"), exports);
|
|
25
26
|
__exportStar(require("./random"), exports);
|
|
26
27
|
__exportStar(require("./secondsInNearest"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function memo<T>(func: (...a: any) => T, ...args: any[]): T;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memo = void 0;
|
|
4
|
+
const hashCode_1 = require("./hashCode");
|
|
5
|
+
const memoData = {};
|
|
6
|
+
function memo(func, ...args) {
|
|
7
|
+
const hc = (0, hashCode_1.hashCode)(JSON.stringify(args));
|
|
8
|
+
if (!memoData[hc]) {
|
|
9
|
+
memoData[hc] = func(...args);
|
|
10
|
+
}
|
|
11
|
+
return memoData[hc];
|
|
12
|
+
}
|
|
13
|
+
exports.memo = memo;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ag-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Andrei Gec <@andreigec> (https://gec.dev/)",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"start": "tsc --watch"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"aws-cdk-lib": "2.
|
|
17
|
-
"aws-sdk": "2.
|
|
16
|
+
"aws-cdk-lib": "2.5.0",
|
|
17
|
+
"aws-sdk": "2.1054.0",
|
|
18
18
|
"axios": "0.24.0",
|
|
19
|
-
"constructs": "10.0.
|
|
19
|
+
"constructs": "10.0.30",
|
|
20
20
|
"jsonwebtoken": "8.5.1",
|
|
21
21
|
"jwks-rsa": "2.0.5",
|
|
22
22
|
"openapi-request-validator": "10.0.0",
|