@lwrjs/shared-utils 0.10.0-alpha.18 → 0.10.0-alpha.19
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/build/cjs/serialize.cjs +3 -3
- package/build/es/serialize.js +3 -3
- package/package.json +5 -5
package/build/cjs/serialize.cjs
CHANGED
|
@@ -67,13 +67,13 @@ function replaceStringFromLocation(src, {startOffset, endOffset}, replaceValue)
|
|
|
67
67
|
return src.substr(0, startOffset) + replaceValue + src.substr(endOffset, src.length);
|
|
68
68
|
}
|
|
69
69
|
function shortestTtl(newTtl, oldTtl) {
|
|
70
|
-
if (
|
|
70
|
+
if (newTtl === void 0 && oldTtl === void 0)
|
|
71
71
|
return void 0;
|
|
72
72
|
const newSeconds = typeof newTtl === "string" ? (0, import_ms.default)(newTtl) / 1e3 : newTtl;
|
|
73
73
|
const oldSeconds = typeof oldTtl === "string" ? (0, import_ms.default)(oldTtl) / 1e3 : oldTtl;
|
|
74
|
-
if (
|
|
74
|
+
if (newSeconds === void 0)
|
|
75
75
|
return oldSeconds;
|
|
76
|
-
if (
|
|
76
|
+
if (oldSeconds === void 0)
|
|
77
77
|
return newSeconds;
|
|
78
78
|
return newSeconds < oldSeconds ? newSeconds : oldSeconds;
|
|
79
79
|
}
|
package/build/es/serialize.js
CHANGED
|
@@ -50,13 +50,13 @@ export function replaceStringFromLocation(src, { startOffset, endOffset }, repla
|
|
|
50
50
|
* @returns - the shorter of the two TTLs IN SECONDS, undefined if both TTLs are missing
|
|
51
51
|
*/
|
|
52
52
|
export function shortestTtl(newTtl, oldTtl) {
|
|
53
|
-
if (
|
|
53
|
+
if (newTtl === undefined && oldTtl === undefined)
|
|
54
54
|
return undefined;
|
|
55
55
|
const newSeconds = typeof newTtl === 'string' ? ms(newTtl) / 1000 : newTtl;
|
|
56
56
|
const oldSeconds = typeof oldTtl === 'string' ? ms(oldTtl) / 1000 : oldTtl;
|
|
57
|
-
if (
|
|
57
|
+
if (newSeconds === undefined)
|
|
58
58
|
return oldSeconds;
|
|
59
|
-
if (
|
|
59
|
+
if (oldSeconds === undefined)
|
|
60
60
|
return newSeconds;
|
|
61
61
|
return newSeconds < oldSeconds ? newSeconds : oldSeconds;
|
|
62
62
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.10.0-alpha.
|
|
7
|
+
"version": "0.10.0-alpha.19",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"rollup": "^2.78.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@lwrjs/diagnostics": "0.10.0-alpha.
|
|
66
|
-
"@lwrjs/types": "0.10.0-alpha.
|
|
65
|
+
"@lwrjs/diagnostics": "0.10.0-alpha.19",
|
|
66
|
+
"@lwrjs/types": "0.10.0-alpha.19",
|
|
67
67
|
"@types/mime-types": "2.1.1",
|
|
68
68
|
"@types/path-to-regexp": "^1.7.0"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
|
-
"node": ">=16.0.0
|
|
71
|
+
"node": ">=16.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "0bd55139c08ddf5a532978cfa9e037eaf27e78e2"
|
|
74
74
|
}
|