planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

82
node_modules/hast-util-is-element/convert.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
'use strict'
module.exports = convert
function convert(test) {
if (typeof test === 'string') {
return tagNameFactory(test)
}
if (test === null || test === undefined) {
return element
}
if (typeof test === 'object') {
return any(test)
}
if (typeof test === 'function') {
return callFactory(test)
}
throw new Error('Expected function, string, or array as test')
}
function convertAll(tests) {
var length = tests.length
var index = -1
var results = []
while (++index < length) {
results[index] = convert(tests[index])
}
return results
}
function any(tests) {
var checks = convertAll(tests)
var length = checks.length
return matches
function matches() {
var index = -1
while (++index < length) {
if (checks[index].apply(this, arguments)) {
return true
}
}
return false
}
}
// Utility to convert a string a tag name check.
function tagNameFactory(test) {
return tagName
function tagName(node) {
return element(node) && node.tagName === test
}
}
// Utility to convert a function check.
function callFactory(test) {
return call
function call(node) {
return element(node) && Boolean(test.apply(this, arguments))
}
}
// Utility to return true if this is an element.
function element(node) {
return (
node &&
typeof node === 'object' &&
node.type === 'element' &&
typeof node.tagName === 'string'
)
}

35
node_modules/hast-util-is-element/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
'use strict'
var convert = require('./convert')
module.exports = isElement
isElement.convert = convert
// Check if if `node` is an `element` and whether it passes the given test.
function isElement(node, test, index, parent, context) {
var hasParent = parent !== null && parent !== undefined
var hasIndex = index !== null && index !== undefined
var check = convert(test)
if (
hasIndex &&
(typeof index !== 'number' || index < 0 || index === Infinity)
) {
throw new Error('Expected positive finite index for child node')
}
if (hasParent && (!parent.type || !parent.children)) {
throw new Error('Expected parent node')
}
if (!node || !node.type || typeof node.type !== 'string') {
return false
}
if (hasParent !== hasIndex) {
throw new Error('Expected both parent and index')
}
return check.call(context, node, index, parent)
}

22
node_modules/hast-util-is-element/license generated vendored Normal file
View 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.

81
node_modules/hast-util-is-element/package.json generated vendored Normal file
View File

@@ -0,0 +1,81 @@
{
"name": "hast-util-is-element",
"version": "1.1.0",
"description": "hast utility to check if a node is a (certain) element",
"license": "MIT",
"keywords": [
"unist",
"hast",
"hast-util",
"util",
"utility",
"html",
"is",
"element"
],
"repository": "syntax-tree/hast-util-is-element",
"bugs": "https://github.com/syntax-tree/hast-util-is-element/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)"
],
"files": [
"convert.js",
"index.js"
],
"dependencies": {},
"devDependencies": {
"browserify": "^16.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"remark-cli": "^8.0.0",
"remark-preset-wooorm": "^7.0.0",
"tape": "^5.0.0",
"tinyify": "^3.0.0",
"xo": "^0.33.0"
},
"scripts": {
"format": "remark . -qfo && prettier . --write && xo --fix",
"build-bundle": "browserify . -s hastUtilIsElement > hast-util-is-element.js",
"build-mangle": "browserify . -s hastUtilIsElement -p tinyify > hast-util-is-element.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js",
"test": "npm run format && npm run build && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"max-params": "off",
"unicorn/prefer-includes": "off",
"unicorn/prefer-reflect-apply": "off"
},
"ignores": [
"hast-util-is-element.js"
]
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
}
}

190
node_modules/hast-util-is-element/readme.md generated vendored Normal file
View File

@@ -0,0 +1,190 @@
# hast-util-is-element
[![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]
[**hast**][hast] utility to check if a [*node*][node] is a (certain)
[*element*][element].
## Install
[npm][]:
```sh
npm install hast-util-is-element
```
## Use
```js
var is = require('hast-util-is-element')
is({type: 'text', value: 'foo'}) // => false
is({type: 'element', tagName: 'a'}, 'a') // => true
is({type: 'element', tagName: 'a'}, ['a', 'area']) // => true
```
## API
### `isElement(node[, test[, index, parent[, context]]])`
Check if the given value is a (certain) [*element*][element].
* `node` ([`Node`][node]) — Node to check.
* `test` ([`Function`][test], `string`, or `Array.<Test>`, optional)
— When `array`, checks if any one of the subtests pass.
When `string`, checks that the element has that tag name.
When `function`, see [`test`][test]
* `index` (`number`, optional) — [Index][] of `node` in `parent`
* `parent` ([`Node`][node], optional) — [Parent][] of `node`
* `context` (`*`, optional) — Context object to invoke `test` with
###### Returns
`boolean` — Whether `test` passed *and* `node` is an [`Element`][element].
###### Throws
`Error` — When an incorrect `test`, `index`, or `parent` is given.
A `node` that is not a node, or not an element, does not throw.
#### `function test(element[, index, parent])`
###### Parameters
* `element` ([`Element`][element]) — Element to check
* `index` (`number?`) — [Index][] of `node` in `parent`
* `parent` ([`Node?`][node]) — [Parent][] of `node`
###### Context
`*` — The to `is` given `context`.
###### Returns
`boolean?` — Whether `element` matches.
### `isElement.convert(test)`
Create a test function from `test`, that can later be called with a `node`,
`index`, and `parent`.
Useful if youre going to test many nodes, for example when creating a utility
where something else passes a compatible test.
The created function is slightly faster because it expects valid input only.
Therefore, passing invalid input, yields unexpected results.
Can also be accessed with `require('hast-util-is-element/convert')`.
## Security
`hast-util-is-element` does not change the syntax tree so there are no openings
for [cross-site scripting (XSS)][xss] attacks.
## Related
* [`hast-util-has-property`](https://github.com/syntax-tree/hast-util-has-property)
— check if a node has a property
* [`hast-util-is-body-ok-link`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-body-ok-link)
— check if a node is “Body OK” link element
* [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-conditional-comment)
— check if a node is a conditional comment
* [`hast-util-is-css-link`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-css-link)
— check if a node is a CSS link element
* [`hast-util-is-css-style`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-css-style)
— check if a node is a CSS style element
* [`hast-util-embedded`](https://github.com/syntax-tree/hast-util-embedded)
— check if a node is an embedded element
* [`hast-util-heading`](https://github.com/syntax-tree/hast-util-heading)
— check if a node is a heading element
* [`hast-util-interactive`](https://github.com/syntax-tree/hast-util-interactive)
— check if a node is interactive
* [`hast-util-is-javascript`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-javascript)
— check if a node is a JavaScript script element
* [`hast-util-labelable`](https://github.com/syntax-tree/hast-util-labelable)
— check whether a node is labelable
* [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing)
— check if a node is phrasing content
* [`hast-util-script-supporting`](https://github.com/syntax-tree/hast-util-script-supporting)
— check if a node is a script-supporting element
* [`hast-util-sectioning`](https://github.com/syntax-tree/hast-util-sectioning)
— check if a node is a sectioning element
* [`hast-util-transparent`](https://github.com/syntax-tree/hast-util-transparent)
— check if a node is a transparent element
* [`hast-util-whitespace`](https://github.com/syntax-tree/hast-util-whitespace)
— check if a node is inter-element whitespace
## Contribute
See [`contributing.md` in `syntax-tree/.github`][contributing] 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]
<!-- Definition -->
[build-badge]: https://img.shields.io/travis/syntax-tree/hast-util-is-element.svg
[build]: https://travis-ci.org/syntax-tree/hast-util-is-element
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-is-element.svg
[coverage]: https://codecov.io/github/syntax-tree/hast-util-is-element
[downloads-badge]: https://img.shields.io/npm/dm/hast-util-is-element.svg
[downloads]: https://www.npmjs.com/package/hast-util-is-element
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-is-element.svg
[size]: https://bundlephobia.com/result?p=hast-util-is-element
[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
[license]: license
[author]: https://wooorm.com
[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md
[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md
[hast]: https://github.com/syntax-tree/hast
[node]: https://github.com/syntax-tree/unist#node
[element]: https://github.com/syntax-tree/hast#element
[parent]: https://github.com/syntax-tree/unist#parent-1
[index]: https://github.com/syntax-tree/unist#index
[test]: #function-testelement-index-parent
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting