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:
becarta
2025-05-23 12:43:00 +02:00
parent f40db0f5c9
commit a544759a3b
11127 changed files with 1647032 additions and 0 deletions

59
node_modules/stdin-discarder/index.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
import process from 'node:process';
const ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code
class StdinDiscarder {
#activeCount = 0;
start() {
this.#activeCount++;
if (this.#activeCount === 1) {
this.#realStart();
}
}
stop() {
if (this.#activeCount <= 0) {
throw new Error('`stop` called more times than `start`');
}
this.#activeCount--;
if (this.#activeCount === 0) {
this.#realStop();
}
}
#realStart() {
// No known way to make it work reliably on Windows.
if (process.platform === 'win32' || !process.stdin.isTTY) {
return;
}
process.stdin.setRawMode(true);
process.stdin.on('data', this.#handleInput);
process.stdin.resume();
}
#realStop() {
if (!process.stdin.isTTY) {
return;
}
process.stdin.off('data', this.#handleInput);
process.stdin.pause();
process.stdin.setRawMode(false);
}
#handleInput(chunk) {
// Allow Ctrl+C to gracefully exit.
if (chunk[0] === ASCII_ETX_CODE) {
process.emit('SIGINT');
}
}
}
const stdinDiscarder = new StdinDiscarder();
export default stdinDiscarder;