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:
15
node_modules/common-ancestor-path/LICENSE
generated
vendored
Normal file
15
node_modules/common-ancestor-path/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
28
node_modules/common-ancestor-path/README.md
generated
vendored
Normal file
28
node_modules/common-ancestor-path/README.md
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# common-ancestor-path
|
||||
|
||||
Find the common ancestor of 2 or more paths on Windows or Unix
|
||||
|
||||
## USAGE
|
||||
|
||||
Give it two or more path strings, and it'll do the thing.
|
||||
|
||||
```js
|
||||
const ancestor = require('common-ancestor-path')
|
||||
|
||||
// output /a/b
|
||||
console.log(ancestor('/a/b/c/d', '/a/b/x/y/z', '/a/b/c/i/j/k'))
|
||||
|
||||
// normalizes separators, but NOT cases, since it matters sometimes
|
||||
console.log(ancestor('C:\\a\\b\\c', 'C:\\a\\b\\x'))
|
||||
|
||||
// no common ancestor on different windows drive letters
|
||||
// so, this returns null
|
||||
console.log(ancestor('c:\\a\\b\\c', 'd:\\d\\e\\f'))
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
`commonAncestorPath(...paths)`
|
||||
|
||||
Returns the nearest (deepest) common ancestor path, or `null` if on
|
||||
different roots on Windows.
|
17
node_modules/common-ancestor-path/index.js
generated
vendored
Normal file
17
node_modules/common-ancestor-path/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
const {parse, sep, normalize: norm} = require('path')
|
||||
|
||||
function* commonArrayMembers (a, b) {
|
||||
const [l, s] = a.length > b.length ? [a, b] : [b, a]
|
||||
for (const x of s) {
|
||||
if (x === l.shift())
|
||||
yield x
|
||||
else
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const commonAncestorPath = (a, b) => a === b ? a
|
||||
: parse(a).root !== parse(b).root ? null
|
||||
: [...commonArrayMembers(norm(a).split(sep), norm(b).split(sep))].join(sep)
|
||||
|
||||
module.exports = (...paths) => paths.reduce(commonAncestorPath)
|
28
node_modules/common-ancestor-path/package.json
generated
vendored
Normal file
28
node_modules/common-ancestor-path/package.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "common-ancestor-path",
|
||||
"version": "1.0.1",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"description": "Find the common ancestor of 2 or more paths on Windows or Unix",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/common-ancestor-path"
|
||||
},
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags"
|
||||
},
|
||||
"tap": {
|
||||
"check-coverage": true
|
||||
},
|
||||
"devDependencies": {
|
||||
"require-inject": "^1.4.4",
|
||||
"tap": "^14.10.7"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user