Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
26
node_modules/dset/merge/index.mjs
generated
vendored
Normal file
26
node_modules/dset/merge/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
export function merge(a, b, k) {
|
||||
if (typeof a === 'object' && typeof b === 'object') {
|
||||
if (Array.isArray(a) && Array.isArray(b)) {
|
||||
for (k=0; k < b.length; k++) {
|
||||
a[k] = merge(a[k], b[k]);
|
||||
}
|
||||
} else {
|
||||
for (k in b) {
|
||||
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
|
||||
a[k] = merge(a[k], b[k]);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
export function dset(obj, keys, val) {
|
||||
keys.split && (keys=keys.split('.'));
|
||||
var i=0, l=keys.length, t=obj, x, k;
|
||||
while (i < l) {
|
||||
k = ''+keys[i++];
|
||||
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
|
||||
t = t[k] = (i === l) ? merge(t[k],val) : (typeof(x=t[k])===typeof keys) ? x : (keys[i]*0 !== 0 || !!~(''+keys[i]).indexOf('.')) ? {} : [];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user