mnfst 0.5.27 → 0.5.28
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/manifest.data.js +18 -11
- package/package.json +1 -1
package/dist/manifest.data.js
CHANGED
|
@@ -2315,26 +2315,33 @@ function getLoadingBranchSafe() {
|
|
|
2315
2315
|
return cachedLoadingBranchSafe;
|
|
2316
2316
|
}
|
|
2317
2317
|
|
|
2318
|
-
//
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
const
|
|
2318
|
+
// Max depth for loading placeholder chain; beyond this, string keys return '' to avoid stack overflow.
|
|
2319
|
+
const MAX_LOADING_BRANCH_DEPTH = 10;
|
|
2320
|
+
|
|
2321
|
+
const loadingBranchByDepth = Object.create(null);
|
|
2322
|
+
function getLoadingBranch(depth) {
|
|
2323
|
+
const d = depth == null ? 0 : Math.min(Math.max(0, depth), MAX_LOADING_BRANCH_DEPTH);
|
|
2324
|
+
if (loadingBranchByDepth[d]) return loadingBranchByDepth[d];
|
|
2324
2325
|
const emptyStr = function () { return ''; };
|
|
2325
|
-
|
|
2326
|
+
const nextDepth = d + 1;
|
|
2327
|
+
const getReturnForStringKey = () =>
|
|
2328
|
+
nextDepth <= MAX_LOADING_BRANCH_DEPTH ? getLoadingBranch(nextDepth) : '';
|
|
2329
|
+
loadingBranchByDepth[d] = new Proxy(Object.create(null), {
|
|
2326
2330
|
get(_, key) {
|
|
2327
2331
|
if (key === Symbol.toPrimitive || key === 'valueOf' || key === 'toString') return emptyStr;
|
|
2328
2332
|
if (key === 'then' || key === 'catch' || key === 'finally') return undefined;
|
|
2329
2333
|
if (key === Symbol.iterator) return function* () { };
|
|
2330
|
-
if (key === '$route' || key === '$search' || key === '$query')
|
|
2334
|
+
if (key === '$route' || key === '$search' || key === '$query') {
|
|
2335
|
+
return function () { return getLoadingBranch(nextDepth <= MAX_LOADING_BRANCH_DEPTH ? nextDepth : MAX_LOADING_BRANCH_DEPTH); };
|
|
2336
|
+
}
|
|
2331
2337
|
if (key === 'length') return 0;
|
|
2332
|
-
if (typeof key === 'string') return
|
|
2333
|
-
return undefined;
|
|
2338
|
+
if (typeof key === 'string') return getReturnForStringKey();
|
|
2339
|
+
if (typeof key === 'symbol') return undefined;
|
|
2340
|
+
return getLoadingBranch(MAX_LOADING_BRANCH_DEPTH);
|
|
2334
2341
|
},
|
|
2335
2342
|
has() { return true; }
|
|
2336
2343
|
});
|
|
2337
|
-
return
|
|
2344
|
+
return loadingBranchByDepth[d];
|
|
2338
2345
|
}
|
|
2339
2346
|
|
|
2340
2347
|
// Create a simple fallback object that returns empty strings for all properties.
|