@lwrjs/shared-utils 0.15.0-alpha.13 → 0.15.0-alpha.14
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/env.cjs +8 -2
- package/build/es/env.d.ts +1 -1
- package/build/es/env.js +7 -1
- package/package.json +4 -4
package/build/cjs/env.cjs
CHANGED
|
@@ -14,7 +14,7 @@ __export(exports, {
|
|
|
14
14
|
getFeatureFlags: () => getFeatureFlags,
|
|
15
15
|
isLambdaEnv: () => isLambdaEnv,
|
|
16
16
|
isLocalDev: () => isLocalDev,
|
|
17
|
-
|
|
17
|
+
parseRequestDepth: () => parseRequestDepth
|
|
18
18
|
});
|
|
19
19
|
if (getFeatureFlags().REEVALUATE_MODULES && !getFeatureFlags().LEGACY_LOADER) {
|
|
20
20
|
throw new Error("REEVALUATE_MODULES is only supported with LEGACY_LOADER");
|
|
@@ -53,7 +53,7 @@ function buildEnvironmentContext(runtimeParams) {
|
|
|
53
53
|
}
|
|
54
54
|
var REQUEST_DEPTH_HEADER = "X-SFDC-Request-Depth";
|
|
55
55
|
var REQUEST_DEPTH_KEY = REQUEST_DEPTH_HEADER.toLowerCase();
|
|
56
|
-
function
|
|
56
|
+
function parseRequestDepth(headers = {}, query = {}) {
|
|
57
57
|
let maxDepth = 0;
|
|
58
58
|
const value = headers && headers[REQUEST_DEPTH_KEY];
|
|
59
59
|
if (value) {
|
|
@@ -73,5 +73,11 @@ function parseRequestDepthHeader(headers = {}) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
if (query[REQUEST_DEPTH_KEY]) {
|
|
77
|
+
const queryValue = parseInt(query[REQUEST_DEPTH_KEY], 10);
|
|
78
|
+
if (!isNaN(queryValue) && queryValue > maxDepth) {
|
|
79
|
+
maxDepth = queryValue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
76
82
|
return maxDepth;
|
|
77
83
|
}
|
package/build/es/env.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ export declare function isLocalDev(): boolean;
|
|
|
18
18
|
export declare function buildEnvironmentContext(runtimeParams: RuntimeParams): EnvironmentContext;
|
|
19
19
|
export declare const REQUEST_DEPTH_HEADER = "X-SFDC-Request-Depth";
|
|
20
20
|
export declare const REQUEST_DEPTH_KEY: string;
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function parseRequestDepth(headers?: Headers, query?: Record<string, string>): number;
|
|
22
22
|
//# sourceMappingURL=env.d.ts.map
|
package/build/es/env.js
CHANGED
|
@@ -85,7 +85,7 @@ export function buildEnvironmentContext(runtimeParams) {
|
|
|
85
85
|
}
|
|
86
86
|
export const REQUEST_DEPTH_HEADER = 'X-SFDC-Request-Depth';
|
|
87
87
|
export const REQUEST_DEPTH_KEY = REQUEST_DEPTH_HEADER.toLowerCase();
|
|
88
|
-
export function
|
|
88
|
+
export function parseRequestDepth(headers = {}, query = {}) {
|
|
89
89
|
let maxDepth = 0;
|
|
90
90
|
const value = headers && headers[REQUEST_DEPTH_KEY];
|
|
91
91
|
if (value) {
|
|
@@ -106,6 +106,12 @@ export function parseRequestDepthHeader(headers = {}) {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
if (query[REQUEST_DEPTH_KEY]) {
|
|
110
|
+
const queryValue = parseInt(query[REQUEST_DEPTH_KEY], 10);
|
|
111
|
+
if (!isNaN(queryValue) && queryValue > maxDepth) {
|
|
112
|
+
maxDepth = queryValue;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
109
115
|
return maxDepth;
|
|
110
116
|
}
|
|
111
117
|
//# sourceMappingURL=env.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.15.0-alpha.
|
|
7
|
+
"version": "0.15.0-alpha.14",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build/**/*.d.ts"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lwrjs/diagnostics": "0.15.0-alpha.
|
|
40
|
+
"@lwrjs/diagnostics": "0.15.0-alpha.14",
|
|
41
41
|
"es-module-lexer": "^1.5.4",
|
|
42
42
|
"fast-json-stable-stringify": "^2.1.0",
|
|
43
43
|
"magic-string": "^0.30.9",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"slugify": "^1.4.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@lwrjs/types": "0.15.0-alpha.
|
|
53
|
+
"@lwrjs/types": "0.15.0-alpha.14",
|
|
54
54
|
"@types/mime-types": "2.1.4",
|
|
55
55
|
"@types/path-to-regexp": "^1.7.0",
|
|
56
56
|
"memfs": "^4.9.3"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c34e441a349c30ed3b52459c64e92d8036013036"
|
|
62
62
|
}
|