🎉 initiate project *astro_rewrite*

This commit is contained in:
sindrekjelsrud 2023-07-19 21:31:30 +02:00
parent ffd4d5e86c
commit 2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions

2
node_modules/mdast-util-definitions/index.d.ts generated vendored Normal file
View 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
View file

@ -0,0 +1,5 @@
/**
* @typedef {import('./lib/index.js').GetDefinition} GetDefinition
*/
export {definitions} from './lib/index.js'

22
node_modules/mdast-util-definitions/lib/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,22 @@
/**
* Find definitions in `tree`.
*
* Uses CommonMark precedence, which means that earlier definitions are
* preferred over duplicate later definitions.
*
* @param {Node} tree
* Tree to check.
* @returns {GetDefinition}
* Getter.
*/
export function definitions(tree: Node): GetDefinition
export type Root = import('mdast').Root
export type Content = import('mdast').Content
export type Definition = import('mdast').Definition
export type Node = Root | Content
/**
* Get a definition by identifier.
*/
export type GetDefinition = (
identifier?: string | null | undefined
) => Definition | null

64
node_modules/mdast-util-definitions/lib/index.js generated vendored Normal file
View file

@ -0,0 +1,64 @@
/**
* @typedef {import('mdast').Root} Root
* @typedef {import('mdast').Content} Content
* @typedef {import('mdast').Definition} Definition
*/
/**
* @typedef {Root | Content} Node
*
* @callback GetDefinition
* Get a definition by identifier.
* @param {string | null | undefined} [identifier]
* Identifier of definition.
* @returns {Definition | null}
* Definition corresponding to `identifier` or `null`.
*/
import {visit} from 'unist-util-visit'
const own = {}.hasOwnProperty
/**
* Find definitions in `tree`.
*
* Uses CommonMark precedence, which means that earlier definitions are
* preferred over duplicate later definitions.
*
* @param {Node} tree
* Tree to check.
* @returns {GetDefinition}
* Getter.
*/
export function definitions(tree) {
/** @type {Record<string, Definition>} */
const cache = Object.create(null)
if (!tree || !tree.type) {
throw new Error('mdast-util-definitions expected node')
}
visit(tree, 'definition', (definition) => {
const id = clean(definition.identifier)
if (id && !own.call(cache, id)) {
cache[id] = definition
}
})
return definition
/** @type {GetDefinition} */
function definition(identifier) {
const id = clean(identifier)
// To do: next major: return `undefined` when not found.
return id && own.call(cache, id) ? cache[id] : null
}
}
/**
* @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
View 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
View file

@ -0,0 +1,83 @@
{
"name": "mdast-util-definitions",
"version": "5.1.2",
"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",
"main": "index.js",
"types": "index.d.ts",
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/mdast": "^3.0.0",
"@types/unist": "^2.0.0",
"unist-util-visit": "^4.0.0"
},
"devDependencies": {
"@types/node": "^18.0.0",
"c8": "^7.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": "^4.0.0",
"xo": "^0.53.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 --check-coverage --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true
}
}

211
node_modules/mdast-util-definitions/readme.md generated vendored Normal file
View file

@ -0,0 +1,211 @@
# 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.
Its small and protects against prototype pollution.
## Install
This package is [ESM only][esm].
In Node.js (version 14.14+ and 16.0+), 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@5'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {definitions} from 'https://esm.sh/mdast-util-definitions@5?bundle'
</script>
```
## Use
```js
import {fromMarkdown} from 'mdast-util-from-markdown'
import {definitions} from 'mdast-util-definitions'
const tree = fromMarkdown('[example]: https://example.com "Example"')
const definition = definitions(tree)
definition('example')
// => {type: 'definition', 'title': 'Example', …}
definition('foo')
// => null
```
## 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
`null`.
## 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 all maintained
versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.
## 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/bundlephobia/minzip/mdast-util-definitions.svg
[size]: https://bundlephobia.com/result?p=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