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:
2
node_modules/unist-util-remove-position/index.d.ts
generated
vendored
Normal file
2
node_modules/unist-util-remove-position/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {removePosition} from './lib/index.js'
|
||||
export type Options = import('./lib/index.js').Options
|
5
node_modules/unist-util-remove-position/index.js
generated
vendored
Normal file
5
node_modules/unist-util-remove-position/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @typedef {import('./lib/index.js').Options} Options
|
||||
*/
|
||||
|
||||
export {removePosition} from './lib/index.js'
|
26
node_modules/unist-util-remove-position/lib/index.d.ts
generated
vendored
Normal file
26
node_modules/unist-util-remove-position/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Remove the `position` field from a tree.
|
||||
*
|
||||
* @param {Node} tree
|
||||
* Tree to clean.
|
||||
* @param {Options | null | undefined} [options={force: false}]
|
||||
* Configuration (default: `{force: false}`).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export function removePosition(
|
||||
tree: Node,
|
||||
options?: Options | null | undefined
|
||||
): undefined
|
||||
export type Node = import('unist').Node
|
||||
/**
|
||||
* Configuration.
|
||||
*/
|
||||
export type Options = {
|
||||
/**
|
||||
* Whether to use `delete` to remove `position` fields.
|
||||
*
|
||||
* The default is to set them to `undefined`.
|
||||
*/
|
||||
force?: boolean | null | undefined
|
||||
}
|
42
node_modules/unist-util-remove-position/lib/index.js
generated
vendored
Normal file
42
node_modules/unist-util-remove-position/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @typedef {import('unist').Node} Node
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Options
|
||||
* Configuration.
|
||||
* @property {boolean | null | undefined} [force=false]
|
||||
* Whether to use `delete` to remove `position` fields.
|
||||
*
|
||||
* The default is to set them to `undefined`.
|
||||
*/
|
||||
|
||||
import {visit} from 'unist-util-visit'
|
||||
|
||||
/**
|
||||
* Remove the `position` field from a tree.
|
||||
*
|
||||
* @param {Node} tree
|
||||
* Tree to clean.
|
||||
* @param {Options | null | undefined} [options={force: false}]
|
||||
* Configuration (default: `{force: false}`).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export function removePosition(tree, options) {
|
||||
const config = options || {}
|
||||
const force = config.force || false
|
||||
|
||||
visit(tree, remove)
|
||||
|
||||
/**
|
||||
* @param {Node} node
|
||||
*/
|
||||
function remove(node) {
|
||||
if (force) {
|
||||
delete node.position
|
||||
} else {
|
||||
node.position = undefined
|
||||
}
|
||||
}
|
||||
}
|
22
node_modules/unist-util-remove-position/license
generated
vendored
Normal file
22
node_modules/unist-util-remove-position/license
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
84
node_modules/unist-util-remove-position/package.json
generated
vendored
Normal file
84
node_modules/unist-util-remove-position/package.json
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"name": "unist-util-remove-position",
|
||||
"version": "5.0.0",
|
||||
"description": "unist utility to remove positions from a tree",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"unist",
|
||||
"unist-util",
|
||||
"util",
|
||||
"utility",
|
||||
"remove",
|
||||
"position",
|
||||
"location",
|
||||
"clean",
|
||||
"force"
|
||||
],
|
||||
"repository": "syntax-tree/unist-util-remove-position",
|
||||
"bugs": "https://github.com/syntax-tree/unist-util-remove-position/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
},
|
||||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
||||
"contributors": [
|
||||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
||||
"Merlijn Vos <merlijn@soverin.net>"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"files": [
|
||||
"lib/",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/unist": "^3.0.0",
|
||||
"unist-util-visit": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdast": "^4.0.0",
|
||||
"@types/node": "^20.0.0",
|
||||
"c8": "^8.0.0",
|
||||
"mdast-util-from-markdown": "^1.0.0",
|
||||
"prettier": "^2.0.0",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-preset-wooorm": "^9.0.0",
|
||||
"tsd": "^0.28.0",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"unist-builder": "^3.0.0",
|
||||
"xo": "^0.54.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build && npm run format",
|
||||
"build": "tsc --build --clean && tsc --build && tsd && type-coverage",
|
||||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
||||
"test-api": "node --conditions development test.js",
|
||||
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
|
||||
"test": "npm run build && npm run format && npm run test-coverage"
|
||||
},
|
||||
"prettier": {
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"useTabs": false
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"remark-preset-wooorm"
|
||||
]
|
||||
},
|
||||
"typeCoverage": {
|
||||
"atLeast": 100,
|
||||
"detail": true,
|
||||
"ignoreCatch": true,
|
||||
"strict": true
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true
|
||||
}
|
||||
}
|
227
node_modules/unist-util-remove-position/readme.md
generated
vendored
Normal file
227
node_modules/unist-util-remove-position/readme.md
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
# unist-util-remove-position
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][size-badge]][size]
|
||||
[![Sponsors][sponsors-badge]][collective]
|
||||
[![Backers][backers-badge]][collective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[unist][] utility to remove positional info from a tree.
|
||||
|
||||
## Contents
|
||||
|
||||
* [What is this?](#what-is-this)
|
||||
* [When should I use this?](#when-should-i-use-this)
|
||||
* [Install](#install)
|
||||
* [Use](#use)
|
||||
* [API](#api)
|
||||
* [`removePosition(node[, options])`](#removepositionnode-options)
|
||||
* [`Options`](#options)
|
||||
* [Types](#types)
|
||||
* [Compatibility](#compatibility)
|
||||
* [Contribute](#contribute)
|
||||
* [License](#license)
|
||||
|
||||
## What is this?
|
||||
|
||||
This is a small utility that helps you remove the `position` field from nodes in
|
||||
a unist tree.
|
||||
|
||||
## When should I use this?
|
||||
|
||||
Often, positional info is the whole reason, or an important reason, for using
|
||||
ASTs.
|
||||
Sometimes, especially when comparing trees, or when inserting one tree into
|
||||
another, the positional info is at best useless and at worst harmful.
|
||||
In those cases, you can use this utility to remove `position` fields from a
|
||||
tree.
|
||||
|
||||
You might find the utility [`unist-util-position`][unist-util-position]
|
||||
useful to instead get clean position info from a tree, or
|
||||
[`unist-util-generated`][unist-util-generated] useful to check whether a node is
|
||||
considered to be generated (not in the original input file).
|
||||
|
||||
You might also enjoy
|
||||
[`unist-util-stringify-position`][unist-util-stringify-position] when you want
|
||||
to display positional info to users.
|
||||
|
||||
## Install
|
||||
|
||||
This package is [ESM only][esm].
|
||||
In Node.js (version 16+), install with [npm][]:
|
||||
|
||||
```sh
|
||||
npm install unist-util-remove-position
|
||||
```
|
||||
|
||||
In Deno with [`esm.sh`][esmsh]:
|
||||
|
||||
```js
|
||||
import {removePosition} from 'https://esm.sh/unist-util-remove-position@5'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import {removePosition} from 'https://esm.sh/unist-util-remove-position@5?bundle'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```js
|
||||
import {fromMarkdown} from 'mdast-util-from-markdown'
|
||||
import {removePosition} from 'unist-util-remove-position'
|
||||
|
||||
const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')
|
||||
|
||||
removePosition(tree, {force: true})
|
||||
|
||||
console.dir(tree, {depth: null})
|
||||
```
|
||||
|
||||
Yields:
|
||||
|
||||
```js
|
||||
{
|
||||
type: 'root',
|
||||
children: [
|
||||
{
|
||||
type: 'paragraph',
|
||||
children: [
|
||||
{type: 'text', value: 'Some '},
|
||||
{type: 'emphasis', children: [{type: 'text', value: 'emphasis'}]},
|
||||
{type: 'text', value: ', '},
|
||||
{type: 'strong', children: [{type: 'text', value: 'importance'}]},
|
||||
{type: 'text', value: ', and '},
|
||||
{type: 'inlineCode', value: 'code'},
|
||||
{type: 'text', value: '.'}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This package exports the identifier [`removePosition`][removeposition].
|
||||
There is no default export.
|
||||
|
||||
### `removePosition(node[, options])`
|
||||
|
||||
Remove the `position` field from a tree.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `node` ([`Node`][node])
|
||||
— tree to clean
|
||||
* `options` ([`Options`][options], optional)
|
||||
— configuration
|
||||
|
||||
###### Returns
|
||||
|
||||
Nothing (`undefined`).
|
||||
|
||||
### `Options`
|
||||
|
||||
Configuration (TypeScript type).
|
||||
|
||||
###### Fields
|
||||
|
||||
* `force` (`boolean`, default: `false`)
|
||||
— whether to use `delete` to remove `position` fields, the default is to
|
||||
set them to `undefined`
|
||||
|
||||
## Types
|
||||
|
||||
This package is fully typed with [TypeScript][].
|
||||
It exports the additional type [`Options`][options].
|
||||
|
||||
## Compatibility
|
||||
|
||||
Projects maintained by the unified collective are compatible with maintained
|
||||
versions of Node.js.
|
||||
|
||||
When we cut a new major release, we drop support for unmaintained versions of
|
||||
Node.
|
||||
This means we try to keep the current release line,
|
||||
`unist-util-remove-position@^5`, compatible with Node.js 16.
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
|
||||
ways to get started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [code of conduct][coc].
|
||||
By interacting with this repository, organization, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://github.com/syntax-tree/unist-util-remove-position/workflows/main/badge.svg
|
||||
|
||||
[build]: https://github.com/syntax-tree/unist-util-remove-position/actions
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/unist-util-remove-position
|
||||
|
||||
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-remove-position
|
||||
|
||||
[size]: https://bundlejs.com/?q=unist-util-remove-position
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[collective]: https://opencollective.com/unified
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
||||
|
||||
[chat]: https://github.com/syntax-tree/unist/discussions
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
||||
|
||||
[esmsh]: https://esm.sh
|
||||
|
||||
[typescript]: https://www.typescriptlang.org
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[health]: https://github.com/syntax-tree/.github
|
||||
|
||||
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
|
||||
|
||||
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
|
||||
|
||||
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
|
||||
|
||||
[unist]: https://github.com/syntax-tree/unist
|
||||
|
||||
[node]: https://github.com/syntax-tree/unist#node
|
||||
|
||||
[unist-util-position]: https://github.com/syntax-tree/unist-util-position
|
||||
|
||||
[unist-util-generated]: https://github.com/syntax-tree/unist-util-generated
|
||||
|
||||
[unist-util-stringify-position]: https://github.com/syntax-tree/unist-util-stringify-position
|
||||
|
||||
[removeposition]: #removepositionnode-options
|
||||
|
||||
[options]: #options
|
Reference in New Issue
Block a user