@unchainedshop/utils 1.2.40 → 2.0.0-beta1
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.
|
@@ -2,7 +2,7 @@ import 'abort-controller/polyfill';
|
|
|
2
2
|
import LRU from 'lru-cache';
|
|
3
3
|
import { systemLocale } from './locale-helpers';
|
|
4
4
|
const { NODE_ENV } = process.env;
|
|
5
|
-
const ttl = NODE_ENV === 'production' ? 1000 *
|
|
5
|
+
const ttl = NODE_ENV === 'production' ? 1000 * 10 : 0; // 10 seconds or 0 seconds
|
|
6
6
|
const textCache = new LRU({ max: 50000, ttl });
|
|
7
7
|
const extendSelectorWithLocale = (selector, locale) => {
|
|
8
8
|
const localeSelector = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-localized-text.js","sourceRoot":"","sources":["../src/find-localized-text.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjC,MAAM,GAAG,GAAG,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"find-localized-text.js","sourceRoot":"","sources":["../src/find-localized-text.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjC,MAAM,GAAG,GAAG,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CA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B,CAAC,CAAC;YAC7C,OAAO,mBAAwB,CAAC;SACjC;KACF;IAED,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACzD,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACnC,OAAO,SAAc,CAAC;AACxB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta1",
|
|
4
4
|
"main": "lib/utils-index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/utils-index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/unchainedshop/unchained#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@unchainedshop/logger": "^
|
|
32
|
+
"@unchainedshop/logger": "^2.0.0-beta1",
|
|
33
33
|
"abort-controller": "3.0.0",
|
|
34
34
|
"bson": "^4.7.0",
|
|
35
35
|
"hashids": "^2.2.10",
|
|
36
|
-
"jest": "^29.2.
|
|
36
|
+
"jest": "^29.2.1",
|
|
37
37
|
"locale": "0.1.0",
|
|
38
38
|
"lru-cache": "^7.14.0",
|
|
39
39
|
"simpl-schema": "^3.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^16.11.66",
|
|
43
|
-
"@unchainedshop/types": "^
|
|
43
|
+
"@unchainedshop/types": "^2.0.0-beta1",
|
|
44
44
|
"typescript": "^4.8.4"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -5,7 +5,7 @@ import { systemLocale } from './locale-helpers';
|
|
|
5
5
|
|
|
6
6
|
const { NODE_ENV } = process.env;
|
|
7
7
|
|
|
8
|
-
const ttl = NODE_ENV === 'production' ? 1000 *
|
|
8
|
+
const ttl = NODE_ENV === 'production' ? 1000 * 10 : 0; // 10 seconds or 0 seconds
|
|
9
9
|
|
|
10
10
|
const textCache = new LRU({ max: 50000, ttl });
|
|
11
11
|
|