Initial React project

This commit is contained in:
Johan
2026-03-23 07:49:45 +01:00
parent 8d33465f51
commit e204032b56
1353 changed files with 23853 additions and 50282 deletions

31
node_modules/flatted/esm/index.js generated vendored
View File

@@ -21,7 +21,8 @@ const Primitives = (_, value) => (
typeof value === primitive ? new Primitive(value) : value
);
const resolver = (input, lazy, parsed, $) => output => {
const revive = (input, parsed, output, $) => {
const lazy = [];
for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
const k = ke[y];
const value = output[k];
@@ -30,7 +31,7 @@ const resolver = (input, lazy, parsed, $) => output => {
if (typeof tmp === object && !parsed.has(tmp)) {
parsed.add(tmp);
output[k] = ignore;
lazy.push({ o: output, k, r: tmp });
lazy.push({k, a: [input, parsed, tmp, $]});
}
else
output[k] = $.call(output, k, tmp);
@@ -38,6 +39,10 @@ const resolver = (input, lazy, parsed, $) => output => {
else if (output[k] !== ignore)
output[k] = $.call(output, k, value);
}
for (let {length} = lazy, i = 0; i < length; i++) {
const {k, a} = lazy[i];
output[k] = $.call(output, k, revive.apply(null, a));
}
return output;
};
@@ -55,24 +60,12 @@ const set = (known, input, value) => {
*/
export const parse = (text, reviver) => {
const input = $parse(text, Primitives).map(primitives);
const value = input[0];
const $ = reviver || noop;
let value = input[0];
if (typeof value === object && value) {
const lazy = [];
const revive = resolver(input, lazy, new Set, $);
value = revive(value);
let i = 0;
while (i < lazy.length) {
// it could be a lazy.shift() but that's costly
const {o, k, r} = lazy[i++];
o[k] = $.call(o, k, revive(r));
}
}
return $.call({'': value}, '', value);
const tmp = typeof value === object && value ?
revive(input, new Set, value, $) :
value;
return $.call({'': tmp}, '', tmp);
};
/**