@neovici/cosmoz-utils 6.13.1 → 6.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/memoize.js +4 -3
- package/package.json +5 -5
package/dist/memoize.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const sym = Symbol('memo');
|
|
1
2
|
export const memize = (fn) => {
|
|
2
3
|
let called = false, lastResult;
|
|
3
4
|
return function () {
|
|
@@ -10,7 +11,7 @@ export const memize = (fn) => {
|
|
|
10
11
|
return result;
|
|
11
12
|
};
|
|
12
13
|
}, memoize = (fn) => {
|
|
13
|
-
let lastArg, lastResult;
|
|
14
|
+
let lastArg = sym, lastResult;
|
|
14
15
|
return function (arg) {
|
|
15
16
|
if (lastArg === arg) {
|
|
16
17
|
return lastResult;
|
|
@@ -21,7 +22,7 @@ export const memize = (fn) => {
|
|
|
21
22
|
return result;
|
|
22
23
|
};
|
|
23
24
|
}, memooize = (fn) => {
|
|
24
|
-
let lastArg1, lastArg2, lastResult;
|
|
25
|
+
let lastArg1 = sym, lastArg2 = sym, lastResult;
|
|
25
26
|
return function (arg1, arg2) {
|
|
26
27
|
if (lastArg1 === arg1 && lastArg2 === arg2) {
|
|
27
28
|
return lastResult;
|
|
@@ -33,7 +34,7 @@ export const memize = (fn) => {
|
|
|
33
34
|
return result;
|
|
34
35
|
};
|
|
35
36
|
}, memoooize = (fn) => {
|
|
36
|
-
let lastArg1, lastArg2, lastArg3, lastResult;
|
|
37
|
+
let lastArg1 = sym, lastArg2 = sym, lastArg3 = sym, lastResult;
|
|
37
38
|
return function (arg1, arg2, arg3) {
|
|
38
39
|
if (lastArg1 === arg1 && lastArg2 === arg2 && lastArg3 === arg3) {
|
|
39
40
|
return lastResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neovici/cosmoz-utils",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.2",
|
|
4
4
|
"description": "Date, money and template management functions commonly needed in Cosmoz views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polymer",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@pionjs/pion": "^2.7.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@commitlint/cli": "^
|
|
80
|
-
"@commitlint/config-conventional": "^
|
|
79
|
+
"@commitlint/cli": "^19.0.0",
|
|
80
|
+
"@commitlint/config-conventional": "^19.0.0",
|
|
81
81
|
"@neovici/cfg": "^1.15.1",
|
|
82
82
|
"@open-wc/testing": "^4.0.0",
|
|
83
83
|
"@polymer/polymer": "^3.3.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/mocha": "^10.0.3",
|
|
87
87
|
"husky": "^8.0.0",
|
|
88
88
|
"lit-html": "^2.0.0 || ^3.0.0",
|
|
89
|
-
"semantic-release": "^
|
|
90
|
-
"sinon": "^
|
|
89
|
+
"semantic-release": "^24.0.0",
|
|
90
|
+
"sinon": "^19.0.0"
|
|
91
91
|
}
|
|
92
92
|
}
|