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:
90
node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
Normal file
90
node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.forwardAsync = forwardAsync;
|
||||
exports.isAsync = void 0;
|
||||
exports.isThenable = isThenable;
|
||||
exports.maybeAsync = maybeAsync;
|
||||
exports.waitFor = exports.onFirstPause = void 0;
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
||||
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
||||
const runGenerator = _gensync()(function* (item) {
|
||||
return yield* item;
|
||||
});
|
||||
const isAsync = exports.isAsync = _gensync()({
|
||||
sync: () => false,
|
||||
errback: cb => cb(null, true)
|
||||
});
|
||||
function maybeAsync(fn, message) {
|
||||
return _gensync()({
|
||||
sync(...args) {
|
||||
const result = fn.apply(this, args);
|
||||
if (isThenable(result)) throw new Error(message);
|
||||
return result;
|
||||
},
|
||||
async(...args) {
|
||||
return Promise.resolve(fn.apply(this, args));
|
||||
}
|
||||
});
|
||||
}
|
||||
const withKind = _gensync()({
|
||||
sync: cb => cb("sync"),
|
||||
async: function () {
|
||||
var _ref = _asyncToGenerator(function* (cb) {
|
||||
return cb("async");
|
||||
});
|
||||
return function async(_x) {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
}()
|
||||
});
|
||||
function forwardAsync(action, cb) {
|
||||
const g = _gensync()(action);
|
||||
return withKind(kind => {
|
||||
const adapted = g[kind];
|
||||
return cb(adapted);
|
||||
});
|
||||
}
|
||||
const onFirstPause = exports.onFirstPause = _gensync()({
|
||||
name: "onFirstPause",
|
||||
arity: 2,
|
||||
sync: function (item) {
|
||||
return runGenerator.sync(item);
|
||||
},
|
||||
errback: function (item, firstPause, cb) {
|
||||
let completed = false;
|
||||
runGenerator.errback(item, (err, value) => {
|
||||
completed = true;
|
||||
cb(err, value);
|
||||
});
|
||||
if (!completed) {
|
||||
firstPause();
|
||||
}
|
||||
}
|
||||
});
|
||||
const waitFor = exports.waitFor = _gensync()({
|
||||
sync: x => x,
|
||||
async: function () {
|
||||
var _ref2 = _asyncToGenerator(function* (x) {
|
||||
return x;
|
||||
});
|
||||
return function async(_x2) {
|
||||
return _ref2.apply(this, arguments);
|
||||
};
|
||||
}()
|
||||
});
|
||||
function isThenable(val) {
|
||||
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=async.js.map
|
1
node_modules/@babel/core/lib/gensync-utils/async.js.map
generated
vendored
Normal file
1
node_modules/@babel/core/lib/gensync-utils/async.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
Normal file
31
node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.stat = exports.readFile = void 0;
|
||||
function _fs() {
|
||||
const data = require("fs");
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _gensync() {
|
||||
const data = require("gensync");
|
||||
_gensync = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
const readFile = exports.readFile = _gensync()({
|
||||
sync: _fs().readFileSync,
|
||||
errback: _fs().readFile
|
||||
});
|
||||
const stat = exports.stat = _gensync()({
|
||||
sync: _fs().statSync,
|
||||
errback: _fs().stat
|
||||
});
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=fs.js.map
|
1
node_modules/@babel/core/lib/gensync-utils/fs.js.map
generated
vendored
Normal file
1
node_modules/@babel/core/lib/gensync-utils/fs.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_fs","data","require","_gensync","readFile","exports","gensync","sync","fs","readFileSync","errback","stat","statSync"],"sources":["../../src/gensync-utils/fs.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport gensync from \"gensync\";\n\nexport const readFile = gensync<[filepath: string, encoding: \"utf8\"], string>({\n sync: fs.readFileSync,\n errback: fs.readFile,\n});\n\nexport const stat = gensync({\n sync: fs.statSync,\n errback: fs.stat,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,SAAMA,CAAC,CAA+C;EAC5EC,IAAI,EAAEC,IAACA,CAAC,CAACC,YAAY;EACrBC,OAAO,EAAEF,IAACA,CAAC,CAACJ;AACd,CAAC,CAAC;AAEK,MAAMO,IAAI,GAAAN,OAAA,CAAAM,IAAA,GAAGL,SAAMA,CAAC,CAAC;EAC1BC,IAAI,EAAEC,IAACA,CAAC,CAACI,QAAQ;EACjBF,OAAO,EAAEF,IAACA,CAAC,CAACG;AACd,CAAC,CAAC;AAAC","ignoreList":[]}
|
58
node_modules/@babel/core/lib/gensync-utils/functional.js
generated
vendored
Normal file
58
node_modules/@babel/core/lib/gensync-utils/functional.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.once = once;
|
||||
var _async = require("./async.js");
|
||||
function once(fn) {
|
||||
let result;
|
||||
let resultP;
|
||||
let promiseReferenced = false;
|
||||
return function* () {
|
||||
if (!result) {
|
||||
if (resultP) {
|
||||
promiseReferenced = true;
|
||||
return yield* (0, _async.waitFor)(resultP);
|
||||
}
|
||||
if (!(yield* (0, _async.isAsync)())) {
|
||||
try {
|
||||
result = {
|
||||
ok: true,
|
||||
value: yield* fn()
|
||||
};
|
||||
} catch (error) {
|
||||
result = {
|
||||
ok: false,
|
||||
value: error
|
||||
};
|
||||
}
|
||||
} else {
|
||||
let resolve, reject;
|
||||
resultP = new Promise((res, rej) => {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
try {
|
||||
result = {
|
||||
ok: true,
|
||||
value: yield* fn()
|
||||
};
|
||||
resultP = null;
|
||||
if (promiseReferenced) resolve(result.value);
|
||||
} catch (error) {
|
||||
result = {
|
||||
ok: false,
|
||||
value: error
|
||||
};
|
||||
resultP = null;
|
||||
if (promiseReferenced) reject(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.ok) return result.value;else throw result.value;
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=functional.js.map
|
1
node_modules/@babel/core/lib/gensync-utils/functional.js.map
generated
vendored
Normal file
1
node_modules/@babel/core/lib/gensync-utils/functional.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_async","require","once","fn","result","resultP","promiseReferenced","waitFor","isAsync","ok","value","error","resolve","reject","Promise","res","rej"],"sources":["../../src/gensync-utils/functional.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\n\nimport { isAsync, waitFor } from \"./async.ts\";\n\nexport function once<R>(fn: () => Handler<R>): () => Handler<R> {\n let result: { ok: true; value: R } | { ok: false; value: unknown };\n let resultP: Promise<R>;\n let promiseReferenced = false;\n return function* () {\n if (!result) {\n if (resultP) {\n promiseReferenced = true;\n return yield* waitFor(resultP);\n }\n\n if (!(yield* isAsync())) {\n try {\n result = { ok: true, value: yield* fn() };\n } catch (error) {\n result = { ok: false, value: error };\n }\n } else {\n let resolve: (result: R) => void, reject: (error: unknown) => void;\n resultP = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n try {\n result = { ok: true, value: yield* fn() };\n // Avoid keeping the promise around\n // now that we have the result.\n resultP = null;\n // We only resolve/reject the promise if it has been actually\n // referenced. If there are no listeners we can forget about it.\n // In the reject case, this avoid uncatchable unhandledRejection\n // events.\n if (promiseReferenced) resolve(result.value);\n } catch (error) {\n result = { ok: false, value: error };\n resultP = null;\n if (promiseReferenced) reject(error);\n }\n }\n }\n\n if (result.ok) return result.value;\n else throw result.value;\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,IAAIA,CAAIC,EAAoB,EAAoB;EAC9D,IAAIC,MAA8D;EAClE,IAAIC,OAAmB;EACvB,IAAIC,iBAAiB,GAAG,KAAK;EAC7B,OAAO,aAAa;IAClB,IAAI,CAACF,MAAM,EAAE;MACX,IAAIC,OAAO,EAAE;QACXC,iBAAiB,GAAG,IAAI;QACxB,OAAO,OAAO,IAAAC,cAAO,EAACF,OAAO,CAAC;MAChC;MAEA,IAAI,EAAE,OAAO,IAAAG,cAAO,EAAC,CAAC,CAAC,EAAE;QACvB,IAAI;UACFJ,MAAM,GAAG;YAAEK,EAAE,EAAE,IAAI;YAAEC,KAAK,EAAE,OAAOP,EAAE,CAAC;UAAE,CAAC;QAC3C,CAAC,CAAC,OAAOQ,KAAK,EAAE;UACdP,MAAM,GAAG;YAAEK,EAAE,EAAE,KAAK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