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/mdast-util-definitions/index.d.ts
generated
vendored
Normal file
2
node_modules/mdast-util-definitions/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {definitions} from './lib/index.js'
|
||||
export type GetDefinition = import('./lib/index.js').GetDefinition
|
5
node_modules/mdast-util-definitions/index.js
generated
vendored
Normal file
5
node_modules/mdast-util-definitions/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @typedef {import('./lib/index.js').GetDefinition} GetDefinition
|
||||
*/
|
||||
|
||||
export {definitions} from './lib/index.js'
|
20
node_modules/mdast-util-definitions/lib/index.d.ts
generated
vendored
Normal file
20
node_modules/mdast-util-definitions/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Find definitions in `tree`.
|
||||
*
|
||||
* Uses CommonMark precedence, which means that earlier definitions are
|
||||
* preferred over duplicate later definitions.
|
||||
*
|
||||
* @param {Nodes} tree
|
||||
* Tree to check.
|
||||
* @returns {GetDefinition}
|
||||
* Getter.
|
||||
*/
|
||||
export function definitions(tree: Nodes): GetDefinition
|
||||
export type Definition = import('mdast').Definition
|
||||
export type Nodes = import('mdast').Nodes
|
||||
/**
|
||||
* Get a definition by identifier.
|
||||
*/
|
||||
export type GetDefinition = (
|
||||
identifier?: string | null | undefined
|
||||
) => Definition | undefined
|
58
node_modules/mdast-util-definitions/lib/index.js
generated
vendored
Normal file
58
node_modules/mdast-util-definitions/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* @typedef {import('mdast').Definition} Definition
|
||||
* @typedef {import('mdast').Nodes} Nodes
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback GetDefinition
|
||||
* Get a definition by identifier.
|
||||
* @param {string | null | undefined} [identifier]
|
||||
* Identifier of definition (optional).
|
||||
* @returns {Definition | undefined}
|
||||
* Definition corresponding to `identifier` or `null`.
|
||||
*/
|
||||
|
||||
import {visit} from 'unist-util-visit'
|
||||
|
||||
/**
|
||||
* Find definitions in `tree`.
|
||||
*
|
||||
* Uses CommonMark precedence, which means that earlier definitions are
|
||||
* preferred over duplicate later definitions.
|
||||
*
|
||||
* @param {Nodes} tree
|
||||
* Tree to check.
|
||||
* @returns {GetDefinition}
|
||||
* Getter.
|
||||
*/
|
||||
export function definitions(tree) {
|
||||
/** @type {Map<string, Definition>} */
|
||||
const cache = new Map()
|
||||
|
||||
if (!tree || !tree.type) {
|
||||
throw new Error('mdast-util-definitions expected node')
|
||||
}
|
||||
|
||||
visit(tree, 'definition', function (definition) {
|
||||
const id = clean(definition.identifier)
|
||||
if (id && !cache.get(id)) {
|
||||
cache.set(id, definition)
|
||||
}
|
||||
})
|
||||
|
||||
return definition
|
||||
|
||||
/** @type {GetDefinition} */
|
||||
function definition(identifier) {
|
||||
const id = clean(identifier)
|
||||
return cache.get(id)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | null | undefined} [value]
|
||||
* @returns {string}
|
||||
*/
|
||||
function clean(value) {
|
||||
return String(value || '').toUpperCase()
|
||||
}
|
22
node_modules/mdast-util-definitions/license
generated
vendored
Normal file
22
node_modules/mdast-util-definitions/license
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2015-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.
|
83
node_modules/mdast-util-definitions/package.json
generated
vendored
Normal file
83
node_modules/mdast-util-definitions/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "mdast-util-definitions",
|
||||
"version": "6.0.0",
|
||||
"description": "mdast utility to find definition nodes in a tree",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"unist",
|
||||
"mdast",
|
||||
"mdast-util",
|
||||
"util",
|
||||
"utility",
|
||||
"markdown",
|
||||
"tree",
|
||||
"node",
|
||||
"definition",
|
||||
"find",
|
||||
"cache"
|
||||
],
|
||||
"repository": "syntax-tree/mdast-util-definitions",
|
||||
"bugs": "https://github.com/syntax-tree/mdast-util-definitions/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)"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"files": [
|
||||
"lib/",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/mdast": "^4.0.0",
|
||||
"@types/unist": "^3.0.0",
|
||||
"unist-util-visit": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"xo": "^0.54.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build && npm run format",
|
||||
"build": "tsc --build --clean && tsc --build && 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
|
||||
}
|
||||
}
|
214
node_modules/mdast-util-definitions/readme.md
generated
vendored
Normal file
214
node_modules/mdast-util-definitions/readme.md
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
# mdast-util-definitions
|
||||
|
||||
[![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]
|
||||
|
||||
[mdast][] utility to find definitions by `identifier`.
|
||||
|
||||
## Contents
|
||||
|
||||
* [What is this?](#what-is-this)
|
||||
* [When should I use this?](#when-should-i-use-this)
|
||||
* [Install](#install)
|
||||
* [Use](#use)
|
||||
* [API](#api)
|
||||
* [`definitions(tree)`](#definitionstree)
|
||||
* [`GetDefinition`](#getdefinition)
|
||||
* [Types](#types)
|
||||
* [Compatibility](#compatibility)
|
||||
* [Security](#security)
|
||||
* [Related](#related)
|
||||
* [Contribute](#contribute)
|
||||
* [License](#license)
|
||||
|
||||
## What is this?
|
||||
|
||||
This package is a tiny utility that lets you find definitions.
|
||||
|
||||
## When should I use this?
|
||||
|
||||
This utility can be useful because definitions can occur after the things that
|
||||
reference them.
|
||||
It’s small and protects against prototype pollution.
|
||||
|
||||
## Install
|
||||
|
||||
This package is [ESM only][esm].
|
||||
In Node.js (version 16+), install with [npm][]:
|
||||
|
||||
```sh
|
||||
npm install mdast-util-definitions
|
||||
```
|
||||
|
||||
In Deno with [`esm.sh`][esmsh]:
|
||||
|
||||
```js
|
||||
import {definitions} from 'https://esm.sh/mdast-util-definitions@6'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import {definitions} from 'https://esm.sh/mdast-util-definitions@6?bundle'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```js
|
||||
import {definitions} from 'mdast-util-definitions'
|
||||
import {fromMarkdown} from 'mdast-util-from-markdown'
|
||||
|
||||
const tree = fromMarkdown('[example]: https://example.com "Example"')
|
||||
|
||||
const definition = definitions(tree)
|
||||
|
||||
definition('example')
|
||||
// => {type: 'definition', 'title': 'Example', …}
|
||||
|
||||
definition('foo')
|
||||
// => undefined
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This package exports the identifier [`definitions`][api-definitions].
|
||||
There is no default export.
|
||||
|
||||
### `definitions(tree)`
|
||||
|
||||
Find definitions in `tree`.
|
||||
|
||||
Uses CommonMark precedence, which means that earlier definitions are
|
||||
preferred over duplicate later definitions.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `tree` ([`Node`][node])
|
||||
— tree to check
|
||||
|
||||
###### Returns
|
||||
|
||||
Getter ([`GetDefinition`][api-getdefinition]).
|
||||
|
||||
### `GetDefinition`
|
||||
|
||||
Get a definition by identifier (TypeScript type).
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `identifier` (`string`, optional)
|
||||
— identifier of definition
|
||||
|
||||
###### Returns
|
||||
|
||||
Definition corresponding to `identifier` ([`Definition`][definition]) or
|
||||
`undefined`.
|
||||
|
||||
## Types
|
||||
|
||||
This package is fully typed with [TypeScript][].
|
||||
It exports the additional type [`GetDefinition`][api-getdefinition].
|
||||
|
||||
## 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,
|
||||
`mdast-util-definitions@^6`, compatible with Node.js 16.
|
||||
|
||||
## Security
|
||||
|
||||
Use of `mdast-util-definitions` does not involve **[hast][]** or user content so
|
||||
there are no openings for [cross-site scripting (XSS)][xss] attacks.
|
||||
Additionally, safe guards are in place to protect against prototype poisoning.
|
||||
|
||||
## Related
|
||||
|
||||
* [`unist-util-index`](https://github.com/syntax-tree/unist-util-index)
|
||||
— index property values or computed keys to nodes
|
||||
|
||||
## 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/mdast-util-definitions/workflows/main/badge.svg
|
||||
|
||||
[build]: https://github.com/syntax-tree/mdast-util-definitions/actions
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-definitions.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-definitions
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-definitions.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/mdast-util-definitions
|
||||
|
||||
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-definitions
|
||||
|
||||
[size]: https://bundlejs.com/?q=mdast-util-definitions
|
||||
|
||||
[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
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
||||
|
||||
[esmsh]: https://esm.sh
|
||||
|
||||
[typescript]: https://www.typescriptlang.org
|
||||
|
||||
[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
|
||||
|
||||
[mdast]: https://github.com/syntax-tree/mdast
|
||||
|
||||
[node]: https://github.com/syntax-tree/unist#node
|
||||
|
||||
[definition]: https://github.com/syntax-tree/mdast#definition
|
||||
|
||||
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
|
||||
|
||||
[hast]: https://github.com/syntax-tree/hast
|
||||
|
||||
[api-definitions]: #definitionstree
|
||||
|
||||
[api-getdefinition]: #getdefinition
|
Reference in New Issue
Block a user