first commit
This commit is contained in:
7
node_modules/hexo-deployer-git/LICENSE
generated
vendored
Normal file
7
node_modules/hexo-deployer-git/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2014 Tommy Chen
|
||||
|
||||
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.
|
||||
138
node_modules/hexo-deployer-git/README.md
generated
vendored
Normal file
138
node_modules/hexo-deployer-git/README.md
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
# hexo-deployer-git
|
||||
|
||||
[](https://github.com/hexojs/hexo-deployer-git/actions?query=workflow%3ATester)
|
||||
[](https://www.npmjs.com/package/hexo-deployer-git)
|
||||
[](https://coveralls.io/r/hexojs/hexo-deployer-git?branch=master)
|
||||
|
||||
Git deployer plugin for [Hexo].
|
||||
|
||||
## Notice: Fatal HttpRequestException Error on pushing to GitHub?
|
||||
Update [Git for Windows](https://github.com/git-for-windows/git/releases) to the latest version. ([Details](https://github.com/Microsoft/Git-Credential-Manager-for-Windows#notice-experiencing-github-pushfetch-problems))
|
||||
|
||||
## Installation
|
||||
|
||||
``` bash
|
||||
$ npm install hexo-deployer-git --save
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
You can configure this plugin in `_config.yml`.
|
||||
|
||||
``` yaml
|
||||
# You can use this:
|
||||
deploy:
|
||||
type: git
|
||||
repo: <repository url>
|
||||
branch: [branch]
|
||||
token: ''
|
||||
message: [message]
|
||||
name: [git user]
|
||||
email: [git email]
|
||||
extend_dirs: [extend directory]
|
||||
ignore_hidden: false # default is true
|
||||
ignore_pattern: regexp # whatever file that matches the regexp will be ignored when deploying
|
||||
|
||||
# or this:
|
||||
deploy:
|
||||
type: git
|
||||
message: [message]
|
||||
repo: <repository url>[,branch]
|
||||
extend_dirs:
|
||||
- [extend directory]
|
||||
- [another extend directory]
|
||||
ignore_hidden:
|
||||
public: false
|
||||
[extend directory]: true
|
||||
[another extend directory]: false
|
||||
ignore_pattern:
|
||||
[folder]: regexp # or you could specify the ignore_pattern under a certain directory
|
||||
|
||||
# Multiple repositories
|
||||
deploy:
|
||||
repo:
|
||||
# Either syntax is supported
|
||||
[repo_name]: <repository url>[,branch]
|
||||
[repo_name]:
|
||||
url: <repository url>
|
||||
branch: [branch]
|
||||
```
|
||||
|
||||
- **repo**: Repository settings, or plain url of your repo
|
||||
- **url**: Url of your repositury to pull from and push to.
|
||||
- **branch**: Optional git branch to deploy the static site to.
|
||||
- Defaults to `gh-pages` on GitHub.
|
||||
- Defaults to `coding-pages` on Coding.net.
|
||||
- Otherwise defaults to `master`.
|
||||
- **token**: Optional token value to authenticate with the repo. Prefix with `$` to read token from environment variable (recommended). Repo must be a http(s) url. [More details](#deploy-with-token).
|
||||
- **repo_name**: Unique name when deploying to multiple repositories.
|
||||
* Example:
|
||||
``` yaml
|
||||
deploy:
|
||||
repo:
|
||||
# Either syntax is supported
|
||||
github: https://github.com/user/project.git,branch
|
||||
gitee:
|
||||
url: https://gitee.com/user/project.git
|
||||
branch: branch_name
|
||||
```
|
||||
- **branch**: Git branch to deploy the static site to. Branch name specified in `repo:` takes priority.
|
||||
- **message**: Commit message. Defaults to `Site updated: {{ now("yyyy-MM-dd HH:mm:ss") }}`.
|
||||
- **name** and **email**: User info for committing the change, overrides global config. This info is independent of git login.
|
||||
- **extend_dirs**: Additional directories to publish. e.g `demo`, `examples`
|
||||
- **ignore_hidden** (Boolean|Object): whether ignore hidden files to publish. GitHub requires the `.nojekyll` in root.
|
||||
* Boolean: for all dirs.
|
||||
* Object: for public dir and extend dir:
|
||||
* `public`: the public dir defaults.
|
||||
* [extend directory]
|
||||
- **ignore_pattern** (Object|RegExp): Choose the ignore pattern when deploying
|
||||
* RegExp: for all dirs.
|
||||
* Object: specify the ignore pattern under certain directory. For example, if you want to push the source files and generated files at the same time to two different branches. The option should be like
|
||||
```yaml
|
||||
# _config.yaml
|
||||
deploy:
|
||||
- type: git
|
||||
repo: git@github.com:<username>/<username>.github.io.git
|
||||
branch: master
|
||||
- type: git
|
||||
repo: git@github.com:<username>/<username>.github.io.git
|
||||
branch: src
|
||||
extend_dirs: /
|
||||
ignore_hidden: false
|
||||
ignore_pattern:
|
||||
public: .
|
||||
```
|
||||
|
||||
### Deploy with token
|
||||
|
||||
While this plugin can parse authentication token from the config, only use this method if you are sure the config will not be committed, including to a private repo. A more secure approach is to add it to the CI as an environment variable, then simply add the name of the environment variable to this plugin's config (e.g. `$GITHUB_TOKEN`).
|
||||
|
||||
Additional guides:
|
||||
|
||||
- Create a GitHub Personal Access Token. [[Link]](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)
|
||||
- Add authentication token to Travis CI. [[Link]](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings)
|
||||
|
||||
## How it works
|
||||
|
||||
`hexo-deployer-git` works by generating the site in `.deploy_git` and *force pushing* to the repo(es) in config.
|
||||
If `.deploy_git` does not exist, a repo will initialized (`git init`).
|
||||
Otherwise the curent repo (with its commit history) will be used.
|
||||
|
||||
Users can clone the deployed repo to `.deploy_git` to keep the commit history.
|
||||
```
|
||||
git clone <gh-pages repo> .deploy_git
|
||||
```
|
||||
|
||||
## Reset
|
||||
|
||||
Remove `.deploy_git` folder.
|
||||
|
||||
``` bash
|
||||
$ rm -rf .deploy_git
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[Hexo]: https://hexo.io/
|
||||
4
node_modules/hexo-deployer-git/index.js
generated
vendored
Normal file
4
node_modules/hexo-deployer-git/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/* global hexo */
|
||||
'use strict';
|
||||
|
||||
hexo.extend.deployer.register('git', require('./lib/deployer'));
|
||||
154
node_modules/hexo-deployer-git/lib/deployer.js
generated
vendored
Normal file
154
node_modules/hexo-deployer-git/lib/deployer.js
generated
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
'use strict';
|
||||
|
||||
const pathFn = require('path');
|
||||
const fs = require('hexo-fs');
|
||||
const { underline } = require('picocolors');
|
||||
const nunjucks = require('nunjucks');
|
||||
const { DateTime } = require('luxon');
|
||||
const Promise = require('bluebird');
|
||||
const { spawn } = require('hexo-util');
|
||||
const parseConfig = require('./parse_config');
|
||||
|
||||
const swigHelpers = {
|
||||
now: function(format) {
|
||||
return DateTime.now().toFormat(format);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function(args) {
|
||||
const baseDir = this.base_dir;
|
||||
const deployDir = pathFn.join(baseDir, '.deploy_git');
|
||||
const publicDir = this.public_dir;
|
||||
let extendDirs = args.extend_dirs;
|
||||
const ignoreHidden = args.ignore_hidden;
|
||||
const ignorePattern = args.ignore_pattern;
|
||||
const log = this.log;
|
||||
const message = commitMessage(args);
|
||||
const verbose = !args.silent;
|
||||
|
||||
if (!args.repo && process.env.HEXO_DEPLOYER_REPO) {
|
||||
args.repo = process.env.HEXO_DEPLOYER_REPO;
|
||||
}
|
||||
|
||||
if (!args.repo && !args.repository) {
|
||||
let help = '';
|
||||
|
||||
help += 'You have to configure the deployment settings in _config.yml first!\n\n';
|
||||
help += 'Example:\n';
|
||||
help += ' deploy:\n';
|
||||
help += ' type: git\n';
|
||||
help += ' repo: <repository url>\n';
|
||||
help += ' branch: [branch]\n';
|
||||
help += ' message: [message]\n\n';
|
||||
help += ' extend_dirs: [extend directory]\n\n';
|
||||
help += 'For more help, you can check the docs: ' + underline('https://hexo.io/docs/deployment.html');
|
||||
|
||||
console.log(help);
|
||||
return;
|
||||
}
|
||||
|
||||
function git(...args) {
|
||||
return spawn('git', args, {
|
||||
cwd: deployDir,
|
||||
verbose: verbose,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
}
|
||||
|
||||
function setup() {
|
||||
const userName = args.name || args.user || args.userName || '';
|
||||
const userEmail = args.email || args.userEmail || '';
|
||||
|
||||
// Create a placeholder for the first commit
|
||||
return fs.writeFile(pathFn.join(deployDir, 'placeholder'), '').then(() => {
|
||||
return git('init');
|
||||
}).then(() => {
|
||||
return userName && git('config', 'user.name', userName);
|
||||
}).then(() => {
|
||||
return userEmail && git('config', 'user.email', userEmail);
|
||||
}).then(() => {
|
||||
return git('add', '-A');
|
||||
}).then(() => {
|
||||
return git('commit', '-m', 'First commit');
|
||||
});
|
||||
}
|
||||
|
||||
function push(repo) {
|
||||
return git('add', '-A').then(() => {
|
||||
return git('commit', '-m', message).catch(() => {
|
||||
// Do nothing. It's OK if nothing to commit.
|
||||
});
|
||||
}).then(() => {
|
||||
return git('push', '-u', repo.url, 'HEAD:' + repo.branch, '--force');
|
||||
});
|
||||
}
|
||||
|
||||
return fs.exists(deployDir).then(exist => {
|
||||
if (exist) return;
|
||||
|
||||
log.info('Setting up Git deployment...');
|
||||
return setup();
|
||||
}).then(() => {
|
||||
log.info('Clearing .deploy_git folder...');
|
||||
return fs.emptyDir(deployDir);
|
||||
}).then(() => {
|
||||
const opts = {};
|
||||
log.info('Copying files from public folder...');
|
||||
if (typeof ignoreHidden === 'object') {
|
||||
opts.ignoreHidden = ignoreHidden.public;
|
||||
} else {
|
||||
opts.ignoreHidden = ignoreHidden;
|
||||
}
|
||||
|
||||
if (typeof ignorePattern === 'string') {
|
||||
opts.ignorePattern = new RegExp(ignorePattern);
|
||||
} else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, ['public'])) {
|
||||
opts.ignorePattern = new RegExp(ignorePattern.public);
|
||||
}
|
||||
|
||||
return fs.copyDir(publicDir, deployDir, opts);
|
||||
}).then(() => {
|
||||
log.info('Copying files from extend dirs...');
|
||||
|
||||
if (!extendDirs) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof extendDirs === 'string') {
|
||||
extendDirs = [extendDirs];
|
||||
}
|
||||
|
||||
const mapFn = function(dir) {
|
||||
const opts = {};
|
||||
const extendPath = pathFn.join(baseDir, dir);
|
||||
const extendDist = pathFn.join(deployDir, dir);
|
||||
|
||||
if (typeof ignoreHidden === 'object') {
|
||||
opts.ignoreHidden = ignoreHidden[dir];
|
||||
} else {
|
||||
opts.ignoreHidden = ignoreHidden;
|
||||
}
|
||||
|
||||
if (typeof ignorePattern === 'string') {
|
||||
opts.ignorePattern = new RegExp(ignorePattern);
|
||||
} else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, [dir])) {
|
||||
opts.ignorePattern = new RegExp(ignorePattern[dir]);
|
||||
}
|
||||
|
||||
return fs.copyDir(extendPath, extendDist, opts);
|
||||
};
|
||||
|
||||
return Promise.map(extendDirs, mapFn, {
|
||||
concurrency: 2
|
||||
});
|
||||
}).then(() => {
|
||||
return parseConfig(args);
|
||||
}).each(repo => {
|
||||
return push(repo);
|
||||
});
|
||||
};
|
||||
|
||||
function commitMessage(args) {
|
||||
const message = args.m || args.msg || args.message || 'Site updated: {{ now("yyyy-MM-dd HH:mm:ss") }}';
|
||||
return nunjucks.renderString(message, swigHelpers);
|
||||
}
|
||||
103
node_modules/hexo-deployer-git/lib/parse_config.js
generated
vendored
Normal file
103
node_modules/hexo-deployer-git/lib/parse_config.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
'use strict';
|
||||
|
||||
const rRepoURL = /^(?:(git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/; // eslint-disable-line no-useless-escape
|
||||
const rGithubPage = /\.github\.(io|com)$/;
|
||||
const { URL } = require('url');
|
||||
|
||||
function parseObjRepo(repo) {
|
||||
let url = repo.url;
|
||||
let branch = repo.branch;
|
||||
const configToken = repo.token;
|
||||
|
||||
if (!branch) {
|
||||
branch = testBranch(url);
|
||||
}
|
||||
if (rRepoURL.test(url)) {
|
||||
const match = url.match(rRepoURL);
|
||||
const scheme = match[1];
|
||||
|
||||
if (configToken && (scheme === 'http' || scheme === 'https')) {
|
||||
let repoUrl, userToken;
|
||||
try {
|
||||
repoUrl = new URL(url);
|
||||
} catch (e) {
|
||||
throw new TypeError('Fail to parse your repo url, check your config!');
|
||||
}
|
||||
|
||||
if (configToken.startsWith('$')) {
|
||||
userToken = process.env[configToken.substring(1)];
|
||||
if (!userToken) throw new TypeError('Fail to read environment varable: ' + configToken + ', check your config!');
|
||||
} else {
|
||||
userToken = configToken;
|
||||
}
|
||||
repoUrl.username = userToken;
|
||||
url = repoUrl.href;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
url: url,
|
||||
branch: branch || 'master'
|
||||
};
|
||||
}
|
||||
|
||||
function parseStrRepo(repo) {
|
||||
const split = repo.split(',');
|
||||
const url = split.shift();
|
||||
let branch = split[0];
|
||||
|
||||
if (!branch) {
|
||||
branch = testBranch(url);
|
||||
}
|
||||
|
||||
return {
|
||||
url: url,
|
||||
branch: branch || 'master'
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
function testBranch(repoUrl) {
|
||||
let branch;
|
||||
if (rRepoURL.test(repoUrl)) {
|
||||
const match = repoUrl.match(rRepoURL);
|
||||
const host = match[2];
|
||||
const path = match[3];
|
||||
|
||||
if (host === 'github.com') {
|
||||
branch = rGithubPage.test(path) ? 'master' : 'gh-pages';
|
||||
} else if (host === 'coding.net') {
|
||||
branch = 'coding-pages';
|
||||
}
|
||||
}
|
||||
return branch;
|
||||
}
|
||||
|
||||
module.exports = function(args) {
|
||||
const repo = args.repo || args.repository;
|
||||
if (!repo) throw new TypeError('repo is required!');
|
||||
|
||||
if (typeof repo === 'string') {
|
||||
const data = parseStrRepo(repo);
|
||||
data.branch = args.branch || data.branch;
|
||||
|
||||
return [data];
|
||||
}
|
||||
|
||||
const keys = Object.keys(repo);
|
||||
|
||||
if (keys.includes('url')) {
|
||||
return [parseObjRepo(repo)];
|
||||
}
|
||||
|
||||
return keys.map(key => {
|
||||
const repoItem = repo[key];
|
||||
if (typeof repoItem === 'string') {
|
||||
const data = parseStrRepo(repoItem);
|
||||
return data;
|
||||
}
|
||||
|
||||
return parseObjRepo(repo[key]);
|
||||
});
|
||||
|
||||
};
|
||||
11
node_modules/hexo-deployer-git/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
11
node_modules/hexo-deployer-git/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 The cheeriojs contributors
|
||||
|
||||
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.
|
||||
97
node_modules/hexo-deployer-git/node_modules/dom-serializer/README.md
generated
vendored
Normal file
97
node_modules/hexo-deployer-git/node_modules/dom-serializer/README.md
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
# dom-serializer [](https://travis-ci.com/cheeriojs/dom-serializer)
|
||||
|
||||
Renders a [domhandler](https://github.com/fb55/domhandler) DOM node or an array of domhandler DOM nodes to a string.
|
||||
|
||||
```js
|
||||
import render from "dom-serializer";
|
||||
|
||||
// OR
|
||||
|
||||
const render = require("dom-serializer").default;
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
## `render`
|
||||
|
||||
▸ **render**(`node`: Node \| Node[], `options?`: [_Options_](#Options)): _string_
|
||||
|
||||
Renders a DOM node or an array of DOM nodes to a string.
|
||||
|
||||
Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
|
||||
#### Parameters:
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :-------- | :--------------------------------- | :------------ | :----------------------------- |
|
||||
| `node` | Node \| Node[] | - | Node to be rendered. |
|
||||
| `options` | [_DomSerializerOptions_](#Options) | {} | Changes serialization behavior |
|
||||
|
||||
**Returns:** _string_
|
||||
|
||||
## Options
|
||||
|
||||
### `decodeEntities`
|
||||
|
||||
• `Optional` **decodeEntities**: _boolean_
|
||||
|
||||
Encode characters that are either reserved in HTML or XML, or are outside of the ASCII range.
|
||||
|
||||
**`default`** true
|
||||
|
||||
---
|
||||
|
||||
### `emptyAttrs`
|
||||
|
||||
• `Optional` **emptyAttrs**: _boolean_
|
||||
|
||||
Print an empty attribute's value.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
|
||||
**`example`** With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
|
||||
---
|
||||
|
||||
### `selfClosingTags`
|
||||
|
||||
• `Optional` **selfClosingTags**: _boolean_
|
||||
|
||||
Print self-closing tags for tags without contents.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
|
||||
**`example`** With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
|
||||
---
|
||||
|
||||
### `xmlMode`
|
||||
|
||||
• `Optional` **xmlMode**: _boolean_ \| _"foreign"_
|
||||
|
||||
Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
|
||||
If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
|
||||
**`default`** false
|
||||
|
||||
---
|
||||
|
||||
## Ecosystem
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------- |
|
||||
| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser |
|
||||
| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM |
|
||||
| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM |
|
||||
| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM |
|
||||
| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM |
|
||||
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM |
|
||||
|
||||
---
|
||||
|
||||
LICENSE: MIT
|
||||
3
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
3
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
|
||||
100
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
100
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
export const elementNames = new Map([
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feDropShadow",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
export const attributeNames = new Map([
|
||||
"definitionURL",
|
||||
"attributeName",
|
||||
"attributeType",
|
||||
"baseFrequency",
|
||||
"baseProfile",
|
||||
"calcMode",
|
||||
"clipPathUnits",
|
||||
"diffuseConstant",
|
||||
"edgeMode",
|
||||
"filterUnits",
|
||||
"glyphRef",
|
||||
"gradientTransform",
|
||||
"gradientUnits",
|
||||
"kernelMatrix",
|
||||
"kernelUnitLength",
|
||||
"keyPoints",
|
||||
"keySplines",
|
||||
"keyTimes",
|
||||
"lengthAdjust",
|
||||
"limitingConeAngle",
|
||||
"markerHeight",
|
||||
"markerUnits",
|
||||
"markerWidth",
|
||||
"maskContentUnits",
|
||||
"maskUnits",
|
||||
"numOctaves",
|
||||
"pathLength",
|
||||
"patternContentUnits",
|
||||
"patternTransform",
|
||||
"patternUnits",
|
||||
"pointsAtX",
|
||||
"pointsAtY",
|
||||
"pointsAtZ",
|
||||
"preserveAlpha",
|
||||
"preserveAspectRatio",
|
||||
"primitiveUnits",
|
||||
"refX",
|
||||
"refY",
|
||||
"repeatCount",
|
||||
"repeatDur",
|
||||
"requiredExtensions",
|
||||
"requiredFeatures",
|
||||
"specularConstant",
|
||||
"specularExponent",
|
||||
"spreadMethod",
|
||||
"startOffset",
|
||||
"stdDeviation",
|
||||
"stitchTiles",
|
||||
"surfaceScale",
|
||||
"systemLanguage",
|
||||
"tableValues",
|
||||
"targetX",
|
||||
"targetY",
|
||||
"textLength",
|
||||
"viewBox",
|
||||
"viewTarget",
|
||||
"xChannelSelector",
|
||||
"yChannelSelector",
|
||||
"zoomAndPan",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
52
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
52
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { AnyNode } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML.
|
||||
*
|
||||
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
*
|
||||
* @default `decodeEntities`
|
||||
*/
|
||||
encodeEntities?: boolean | "utf8";
|
||||
/**
|
||||
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
|
||||
export default render;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"}
|
||||
190
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
190
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
import * as ElementType from "domelementtype";
|
||||
import { encodeXML, escapeAttribute, escapeText } from "entities";
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
import { elementNames, attributeNames } from "./foreignNames.js";
|
||||
const unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
function replaceQuotes(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
var _a;
|
||||
if (!attributes)
|
||||
return;
|
||||
const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
|
||||
? replaceQuotes
|
||||
: opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML
|
||||
: escapeAttribute;
|
||||
return Object.keys(attributes)
|
||||
.map((key) => {
|
||||
var _a, _b;
|
||||
const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return `${key}="${encode(value)}"`;
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
const singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export function render(node, options = {}) {
|
||||
const nodes = "length" in node ? node : [node];
|
||||
let output = "";
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
export default render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
// @ts-expect-error We don't use `Doctype` yet
|
||||
case ElementType.Doctype:
|
||||
case ElementType.Directive:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
const foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
const foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = { ...opts, xmlMode: false };
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = { ...opts, xmlMode: "foreign" };
|
||||
}
|
||||
let tag = `<${elem.name}`;
|
||||
const attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += ` ${attribs}`;
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += `</${elem.name}>`;
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return `<${elem.data}>`;
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var _a;
|
||||
let data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data =
|
||||
opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML(data)
|
||||
: escapeText(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return `<![CDATA[${elem.children[0].data}]]>`;
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return `<!--${elem.data}-->`;
|
||||
}
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"type":"module"}
|
||||
3
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
3
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAsCvB,CAAC;AACH,eAAO,MAAM,cAAc,qBA4DzB,CAAC"}
|
||||
103
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
103
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.attributeNames = exports.elementNames = void 0;
|
||||
exports.elementNames = new Map([
|
||||
["altglyph", "altGlyph"],
|
||||
["altglyphdef", "altGlyphDef"],
|
||||
["altglyphitem", "altGlyphItem"],
|
||||
["animatecolor", "animateColor"],
|
||||
["animatemotion", "animateMotion"],
|
||||
["animatetransform", "animateTransform"],
|
||||
["clippath", "clipPath"],
|
||||
["feblend", "feBlend"],
|
||||
["fecolormatrix", "feColorMatrix"],
|
||||
["fecomponenttransfer", "feComponentTransfer"],
|
||||
["fecomposite", "feComposite"],
|
||||
["feconvolvematrix", "feConvolveMatrix"],
|
||||
["fediffuselighting", "feDiffuseLighting"],
|
||||
["fedisplacementmap", "feDisplacementMap"],
|
||||
["fedistantlight", "feDistantLight"],
|
||||
["fedropshadow", "feDropShadow"],
|
||||
["feflood", "feFlood"],
|
||||
["fefunca", "feFuncA"],
|
||||
["fefuncb", "feFuncB"],
|
||||
["fefuncg", "feFuncG"],
|
||||
["fefuncr", "feFuncR"],
|
||||
["fegaussianblur", "feGaussianBlur"],
|
||||
["feimage", "feImage"],
|
||||
["femerge", "feMerge"],
|
||||
["femergenode", "feMergeNode"],
|
||||
["femorphology", "feMorphology"],
|
||||
["feoffset", "feOffset"],
|
||||
["fepointlight", "fePointLight"],
|
||||
["fespecularlighting", "feSpecularLighting"],
|
||||
["fespotlight", "feSpotLight"],
|
||||
["fetile", "feTile"],
|
||||
["feturbulence", "feTurbulence"],
|
||||
["foreignobject", "foreignObject"],
|
||||
["glyphref", "glyphRef"],
|
||||
["lineargradient", "linearGradient"],
|
||||
["radialgradient", "radialGradient"],
|
||||
["textpath", "textPath"],
|
||||
]);
|
||||
exports.attributeNames = new Map([
|
||||
["definitionurl", "definitionURL"],
|
||||
["attributename", "attributeName"],
|
||||
["attributetype", "attributeType"],
|
||||
["basefrequency", "baseFrequency"],
|
||||
["baseprofile", "baseProfile"],
|
||||
["calcmode", "calcMode"],
|
||||
["clippathunits", "clipPathUnits"],
|
||||
["diffuseconstant", "diffuseConstant"],
|
||||
["edgemode", "edgeMode"],
|
||||
["filterunits", "filterUnits"],
|
||||
["glyphref", "glyphRef"],
|
||||
["gradienttransform", "gradientTransform"],
|
||||
["gradientunits", "gradientUnits"],
|
||||
["kernelmatrix", "kernelMatrix"],
|
||||
["kernelunitlength", "kernelUnitLength"],
|
||||
["keypoints", "keyPoints"],
|
||||
["keysplines", "keySplines"],
|
||||
["keytimes", "keyTimes"],
|
||||
["lengthadjust", "lengthAdjust"],
|
||||
["limitingconeangle", "limitingConeAngle"],
|
||||
["markerheight", "markerHeight"],
|
||||
["markerunits", "markerUnits"],
|
||||
["markerwidth", "markerWidth"],
|
||||
["maskcontentunits", "maskContentUnits"],
|
||||
["maskunits", "maskUnits"],
|
||||
["numoctaves", "numOctaves"],
|
||||
["pathlength", "pathLength"],
|
||||
["patterncontentunits", "patternContentUnits"],
|
||||
["patterntransform", "patternTransform"],
|
||||
["patternunits", "patternUnits"],
|
||||
["pointsatx", "pointsAtX"],
|
||||
["pointsaty", "pointsAtY"],
|
||||
["pointsatz", "pointsAtZ"],
|
||||
["preservealpha", "preserveAlpha"],
|
||||
["preserveaspectratio", "preserveAspectRatio"],
|
||||
["primitiveunits", "primitiveUnits"],
|
||||
["refx", "refX"],
|
||||
["refy", "refY"],
|
||||
["repeatcount", "repeatCount"],
|
||||
["repeatdur", "repeatDur"],
|
||||
["requiredextensions", "requiredExtensions"],
|
||||
["requiredfeatures", "requiredFeatures"],
|
||||
["specularconstant", "specularConstant"],
|
||||
["specularexponent", "specularExponent"],
|
||||
["spreadmethod", "spreadMethod"],
|
||||
["startoffset", "startOffset"],
|
||||
["stddeviation", "stdDeviation"],
|
||||
["stitchtiles", "stitchTiles"],
|
||||
["surfacescale", "surfaceScale"],
|
||||
["systemlanguage", "systemLanguage"],
|
||||
["tablevalues", "tableValues"],
|
||||
["targetx", "targetX"],
|
||||
["targety", "targetY"],
|
||||
["textlength", "textLength"],
|
||||
["viewbox", "viewBox"],
|
||||
["viewtarget", "viewTarget"],
|
||||
["xchannelselector", "xChannelSelector"],
|
||||
["ychannelselector", "yChannelSelector"],
|
||||
["zoomandpan", "zoomAndPan"],
|
||||
]);
|
||||
43
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
43
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Node } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML, or are outside of the ASCII range.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export default function render(node: Node | ArrayLike<Node>, options?: DomSerializerOptions): string;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAuC,MAAM,YAAY,CAAC;AAW5E,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAqED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,EAC5B,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR"}
|
||||
211
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
211
node_modules/hexo-deployer-git/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
var ElementType = __importStar(require("domelementtype"));
|
||||
var entities_1 = require("entities");
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
var foreignNames_1 = require("./foreignNames");
|
||||
var unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
if (!attributes)
|
||||
return;
|
||||
return Object.keys(attributes)
|
||||
.map(function (key) {
|
||||
var _a, _b;
|
||||
var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return key + "=\"" + (opts.decodeEntities !== false
|
||||
? entities_1.encodeXML(value)
|
||||
: value.replace(/"/g, """)) + "\"";
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
var singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
function render(node, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var nodes = "length" in node ? node : [node];
|
||||
var output = "";
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
exports.default = render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
case ElementType.Directive:
|
||||
case ElementType.Doctype:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
var foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
var foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: false });
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: "foreign" });
|
||||
}
|
||||
var tag = "<" + elem.name;
|
||||
var attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += " " + attribs;
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += "</" + elem.name + ">";
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return "<" + elem.data + ">";
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (opts.decodeEntities !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data = entities_1.encodeXML(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return "<![CDATA[" + elem.children[0].data + "]]>";
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return "<!--" + elem.data + "-->";
|
||||
}
|
||||
11
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
11
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
5
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
5
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare const decodeXML: (str: string) => string;
|
||||
export declare const decodeHTMLStrict: (str: string) => string;
|
||||
export declare type MapType = Record<string, string>;
|
||||
export declare const decodeHTML: (str: string) => string;
|
||||
//# sourceMappingURL=decode.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS,QAOL,MAAM,WAP0B,CAAC;AAClD,eAAO,MAAM,gBAAgB,QAMZ,MAAM,WANoC,CAAC;AAE5D,oBAAY,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAS7C,eAAO,MAAM,UAAU,QAyBN,MAAM,WACnB,CAAC"}
|
||||
53
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
53
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;
|
||||
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||
var legacy_json_1 = __importDefault(require("./maps/legacy.json"));
|
||||
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
||||
var decode_codepoint_1 = __importDefault(require("./decode_codepoint"));
|
||||
var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
|
||||
exports.decodeXML = getStrictDecoder(xml_json_1.default);
|
||||
exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);
|
||||
function getStrictDecoder(map) {
|
||||
var replace = getReplacer(map);
|
||||
return function (str) { return String(str).replace(strictEntityRe, replace); };
|
||||
}
|
||||
var sorter = function (a, b) { return (a < b ? 1 : -1); };
|
||||
exports.decodeHTML = (function () {
|
||||
var legacy = Object.keys(legacy_json_1.default).sort(sorter);
|
||||
var keys = Object.keys(entities_json_1.default).sort(sorter);
|
||||
for (var i = 0, j = 0; i < keys.length; i++) {
|
||||
if (legacy[j] === keys[i]) {
|
||||
keys[i] += ";?";
|
||||
j++;
|
||||
}
|
||||
else {
|
||||
keys[i] += ";";
|
||||
}
|
||||
}
|
||||
var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g");
|
||||
var replace = getReplacer(entities_json_1.default);
|
||||
function replacer(str) {
|
||||
if (str.substr(-1) !== ";")
|
||||
str += ";";
|
||||
return replace(str);
|
||||
}
|
||||
// TODO consider creating a merged map
|
||||
return function (str) { return String(str).replace(re, replacer); };
|
||||
})();
|
||||
function getReplacer(map) {
|
||||
return function replace(str) {
|
||||
if (str.charAt(1) === "#") {
|
||||
var secondChar = str.charAt(2);
|
||||
if (secondChar === "X" || secondChar === "x") {
|
||||
return decode_codepoint_1.default(parseInt(str.substr(3), 16));
|
||||
}
|
||||
return decode_codepoint_1.default(parseInt(str.substr(2), 10));
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
return map[str.slice(1, -1)] || str;
|
||||
};
|
||||
}
|
||||
2
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
2
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export default function decodeCodePoint(codePoint: number): string;
|
||||
//# sourceMappingURL=decode_codepoint.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"","sources":["../src/decode_codepoint.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUjE"}
|
||||
30
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
30
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var decode_json_1 = __importDefault(require("./maps/decode.json"));
|
||||
// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
|
||||
var fromCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
String.fromCodePoint ||
|
||||
function (codePoint) {
|
||||
var output = "";
|
||||
if (codePoint > 0xffff) {
|
||||
codePoint -= 0x10000;
|
||||
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
||||
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
||||
}
|
||||
output += String.fromCharCode(codePoint);
|
||||
return output;
|
||||
};
|
||||
function decodeCodePoint(codePoint) {
|
||||
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
||||
return "\uFFFD";
|
||||
}
|
||||
if (codePoint in decode_json_1.default) {
|
||||
codePoint = decode_json_1.default[codePoint];
|
||||
}
|
||||
return fromCodePoint(codePoint);
|
||||
}
|
||||
exports.default = decodeCodePoint;
|
||||
47
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
47
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare const encodeXML: (data: string) => string;
|
||||
/**
|
||||
* Encodes all entities and non-ASCII characters in the input.
|
||||
*
|
||||
* This includes characters that are valid ASCII characters in HTML documents.
|
||||
* For example `#` will be encoded as `#`. To get a more compact output,
|
||||
* consider using the `encodeNonAsciiHTML` function.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare const encodeHTML: (data: string) => string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare const encodeNonAsciiHTML: (data: string) => string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare function escape(data: string): string;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using numeric hexadecimal
|
||||
* reference (eg. `ü`).
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare function escapeUTF8(data: string): string;
|
||||
//# sourceMappingURL=encode.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,SAwIJ,MAAM,WAxI4B,CAAC;AAOrD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,SAkFL,MAAM,WAlFuC,CAAC;AAChE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SA+Gb,MAAM,WA/GsC,CAAC;AAqF/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
||||
136
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
136
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;
|
||||
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
||||
var inverseXML = getInverseObj(xml_json_1.default);
|
||||
var xmlReplacer = getInverseReplacer(inverseXML);
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
exports.encodeXML = getASCIIEncoder(inverseXML);
|
||||
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||
var inverseHTML = getInverseObj(entities_json_1.default);
|
||||
var htmlReplacer = getInverseReplacer(inverseHTML);
|
||||
/**
|
||||
* Encodes all entities and non-ASCII characters in the input.
|
||||
*
|
||||
* This includes characters that are valid ASCII characters in HTML documents.
|
||||
* For example `#` will be encoded as `#`. To get a more compact output,
|
||||
* consider using the `encodeNonAsciiHTML` function.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
exports.encodeHTML = getInverse(inverseHTML, htmlReplacer);
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
exports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);
|
||||
function getInverseObj(obj) {
|
||||
return Object.keys(obj)
|
||||
.sort()
|
||||
.reduce(function (inverse, name) {
|
||||
inverse[obj[name]] = "&" + name + ";";
|
||||
return inverse;
|
||||
}, {});
|
||||
}
|
||||
function getInverseReplacer(inverse) {
|
||||
var single = [];
|
||||
var multiple = [];
|
||||
for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) {
|
||||
var k = _a[_i];
|
||||
if (k.length === 1) {
|
||||
// Add value to single array
|
||||
single.push("\\" + k);
|
||||
}
|
||||
else {
|
||||
// Add value to multiple array
|
||||
multiple.push(k);
|
||||
}
|
||||
}
|
||||
// Add ranges to single characters.
|
||||
single.sort();
|
||||
for (var start = 0; start < single.length - 1; start++) {
|
||||
// Find the end of a run of characters
|
||||
var end = start;
|
||||
while (end < single.length - 1 &&
|
||||
single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) {
|
||||
end += 1;
|
||||
}
|
||||
var count = 1 + end - start;
|
||||
// We want to replace at least three characters
|
||||
if (count < 3)
|
||||
continue;
|
||||
single.splice(start, count, single[start] + "-" + single[end]);
|
||||
}
|
||||
multiple.unshift("[" + single.join("") + "]");
|
||||
return new RegExp(multiple.join("|"), "g");
|
||||
}
|
||||
// /[^\0-\x7F]/gu
|
||||
var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
|
||||
var getCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
String.prototype.codePointAt != null
|
||||
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
function (str) { return str.codePointAt(0); }
|
||||
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
function (c) {
|
||||
return (c.charCodeAt(0) - 0xd800) * 0x400 +
|
||||
c.charCodeAt(1) -
|
||||
0xdc00 +
|
||||
0x10000;
|
||||
};
|
||||
function singleCharReplacer(c) {
|
||||
return "&#x" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0))
|
||||
.toString(16)
|
||||
.toUpperCase() + ";";
|
||||
}
|
||||
function getInverse(inverse, re) {
|
||||
return function (data) {
|
||||
return data
|
||||
.replace(re, function (name) { return inverse[name]; })
|
||||
.replace(reNonASCII, singleCharReplacer);
|
||||
};
|
||||
}
|
||||
var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g");
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
function escape(data) {
|
||||
return data.replace(reEscapeChars, singleCharReplacer);
|
||||
}
|
||||
exports.escape = escape;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using numeric hexadecimal
|
||||
* reference (eg. `ü`).
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
function escapeUTF8(data) {
|
||||
return data.replace(xmlReplacer, singleCharReplacer);
|
||||
}
|
||||
exports.escapeUTF8 = escapeUTF8;
|
||||
function getASCIIEncoder(obj) {
|
||||
return function (data) {
|
||||
return data.replace(reEscapeChars, function (c) { return obj[c] || singleCharReplacer(c); });
|
||||
};
|
||||
}
|
||||
27
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
27
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `decodeXML` or `decodeHTML` directly.
|
||||
*/
|
||||
export declare function decode(data: string, level?: number): string;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.
|
||||
*/
|
||||
export declare function decodeStrict(data: string, level?: number): string;
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.
|
||||
*/
|
||||
export declare function encode(data: string, level?: number): string;
|
||||
export { encodeXML, encodeHTML, encodeNonAsciiHTML, escape, escapeUTF8, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode";
|
||||
export { decodeXML, decodeHTML, decodeHTMLStrict, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,OAAO,EACH,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,UAAU,EAEV,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EACH,SAAS,EACT,UAAU,EACV,gBAAgB,EAEhB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,UAAU,CAAC"}
|
||||
57
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
57
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0;
|
||||
var decode_1 = require("./decode");
|
||||
var encode_1 = require("./encode");
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `decodeXML` or `decodeHTML` directly.
|
||||
*/
|
||||
function decode(data, level) {
|
||||
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
|
||||
}
|
||||
exports.decode = decode;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.
|
||||
*/
|
||||
function decodeStrict(data, level) {
|
||||
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
|
||||
}
|
||||
exports.decodeStrict = decodeStrict;
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.
|
||||
* @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.
|
||||
*/
|
||||
function encode(data, level) {
|
||||
return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
|
||||
}
|
||||
exports.encode = encode;
|
||||
var encode_2 = require("./encode");
|
||||
Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } });
|
||||
Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } });
|
||||
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } });
|
||||
Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return encode_2.escapeUTF8; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
var decode_2 = require("./decode");
|
||||
Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
||||
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}
|
||||
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}
|
||||
64
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/package.json
generated
vendored
Normal file
64
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "entities",
|
||||
"version": "2.2.0",
|
||||
"description": "Encode & decode XML and HTML entities with ease",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": "https://github.com/fb55/entities?sponsor=1",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"entity",
|
||||
"decoding",
|
||||
"encoding",
|
||||
"html",
|
||||
"xml",
|
||||
"html entities"
|
||||
],
|
||||
"directories": {
|
||||
"lib": "lib/"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "^14.11.8",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"coveralls": "*",
|
||||
"eslint": "^7.11.0",
|
||||
"eslint-config-prettier": "^7.0.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^26.5.3",
|
||||
"prettier": "^2.0.5",
|
||||
"ts-jest": "^26.1.0",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --coverage && npm run lint",
|
||||
"coverage": "cat coverage/lcov.info | coveralls",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier '**/*.{ts,md,json,yml}'",
|
||||
"build": "tsc && cp -r src/maps lib",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/entities.git"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4,
|
||||
"proseWrap": "always"
|
||||
}
|
||||
}
|
||||
57
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/readme.md
generated
vendored
Normal file
57
node_modules/hexo-deployer-git/node_modules/dom-serializer/node_modules/entities/readme.md
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# entities [](https://npmjs.org/package/entities) [](https://npmjs.org/package/entities) [](http://travis-ci.org/fb55/entities) [](https://coveralls.io/r/fb55/entities)
|
||||
|
||||
Encode & decode HTML & XML entities with ease & speed.
|
||||
|
||||
## How to…
|
||||
|
||||
### …install `entities`
|
||||
|
||||
npm install entities
|
||||
|
||||
### …use `entities`
|
||||
|
||||
```javascript
|
||||
const entities = require("entities");
|
||||
|
||||
//encoding
|
||||
entities.escape("&"); // "&#38;"
|
||||
entities.encodeXML("&"); // "&#38;"
|
||||
entities.encodeHTML("&"); // "&#38;"
|
||||
|
||||
//decoding
|
||||
entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||
entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
This is how `entities` compares to other libraries on a very basic benchmark
|
||||
(see `scripts/benchmark.ts`, for 10,000,000 iterations):
|
||||
|
||||
| Library | `decode` performance | `encode` performance | Bundle size |
|
||||
| -------------- | -------------------- | -------------------- | -------------------------------------------------------------------------- |
|
||||
| entities | 10.809s | 17.683s |  |
|
||||
| html-entities | 14.029s | 22.670s |  |
|
||||
| he | 16.163s | 44.010s |  |
|
||||
| parse-entities | 28.507s | N/A |  |
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security). Tidelift will
|
||||
coordinate the fix and disclosure.
|
||||
|
||||
## `entities` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `entities` and thousands of other packages are working with
|
||||
Tidelift to deliver commercial support and maintenance for the open source
|
||||
dependencies you use to build your applications. Save time, reduce risk, and
|
||||
improve code health, while paying the maintainers of the exact dependencies you
|
||||
use.
|
||||
[Learn more.](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
55
node_modules/hexo-deployer-git/node_modules/dom-serializer/package.json
generated
vendored
Normal file
55
node_modules/hexo-deployer-git/node_modules/dom-serializer/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "dom-serializer",
|
||||
"version": "1.4.1",
|
||||
"description": "render domhandler DOM nodes to a string",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"html",
|
||||
"xml",
|
||||
"render"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/cheeriojs/dom-renderer.git"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.0.1",
|
||||
"domhandler": "^4.2.0",
|
||||
"entities": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/node": "^15.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.23.0",
|
||||
"@typescript-eslint/parser": "^4.23.0",
|
||||
"cheerio": "^1.0.0-rc.9",
|
||||
"coveralls": "^3.0.5",
|
||||
"eslint": "^7.26.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"htmlparser2": "^6.1.0",
|
||||
"jest": "^26.0.1",
|
||||
"prettier": "^2.3.0",
|
||||
"ts-jest": "^26.5.6",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest --coverage && npm run lint",
|
||||
"coverage": "cat coverage/lcov.info | coveralls",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write '**/*.{ts,md,json}'",
|
||||
"build": "tsc",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"funding": "https://github.com/cheeriojs/dom-serializer?sponsor=1",
|
||||
"license": "MIT"
|
||||
}
|
||||
11
node_modules/hexo-deployer-git/node_modules/domhandler/LICENSE
generated
vendored
Normal file
11
node_modules/hexo-deployer-git/node_modules/domhandler/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
85
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.d.ts
generated
vendored
Normal file
85
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import { Node, Element, DataNode, NodeWithChildren, Document } from "./node";
|
||||
export * from "./node";
|
||||
export interface DomHandlerOptions {
|
||||
/**
|
||||
* Add a `startIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `startIndex` is an integer
|
||||
* indicating the position of the start of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withStartIndices?: boolean;
|
||||
/**
|
||||
* Add an `endIndex` property to nodes.
|
||||
* When the parser is used in a non-streaming fashion, `endIndex` is an integer
|
||||
* indicating the position of the end of the node in the document.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
withEndIndices?: boolean;
|
||||
/**
|
||||
* Replace all whitespace with single spaces.
|
||||
*
|
||||
* **Note:** Enabling this might break your markup.
|
||||
*
|
||||
* @default false
|
||||
* @deprecated
|
||||
*/
|
||||
normalizeWhitespace?: boolean;
|
||||
/**
|
||||
* Treat the markup as XML.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean;
|
||||
}
|
||||
interface ParserInterface {
|
||||
startIndex: number | null;
|
||||
endIndex: number | null;
|
||||
}
|
||||
declare type Callback = (error: Error | null, dom: Node[]) => void;
|
||||
declare type ElementCallback = (element: Element) => void;
|
||||
export declare class DomHandler {
|
||||
/** The elements of the DOM */
|
||||
dom: Node[];
|
||||
/** The root element for the DOM */
|
||||
root: Document;
|
||||
/** Called once parsing has completed. */
|
||||
private readonly callback;
|
||||
/** Settings for the handler. */
|
||||
private readonly options;
|
||||
/** Callback whenever a tag is closed. */
|
||||
private readonly elementCB;
|
||||
/** Indicated whether parsing has been completed. */
|
||||
private done;
|
||||
/** Stack of open tags. */
|
||||
protected tagStack: NodeWithChildren[];
|
||||
/** A data node that is still being written to. */
|
||||
protected lastNode: DataNode | null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
private parser;
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
|
||||
onparserinit(parser: ParserInterface): void;
|
||||
onreset(): void;
|
||||
onend(): void;
|
||||
onerror(error: Error): void;
|
||||
onclosetag(): void;
|
||||
onopentag(name: string, attribs: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
ontext(data: string): void;
|
||||
oncomment(data: string): void;
|
||||
oncommentend(): void;
|
||||
oncdatastart(): void;
|
||||
oncdataend(): void;
|
||||
onprocessinginstruction(name: string, data: string): void;
|
||||
protected handleCallback(error: Error | null): void;
|
||||
protected addNode(node: Node): void;
|
||||
}
|
||||
export default DomHandler;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,IAAI,EACJ,OAAO,EACP,QAAQ,EAGR,gBAAgB,EAChB,QAAQ,EAEX,MAAM,QAAQ,CAAC;AAEhB,cAAc,QAAQ,CAAC;AAIvB,MAAM,WAAW,iBAAiB;IAC9B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAUD,UAAU,eAAe;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,aAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;AAC3D,aAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAElD,qBAAa,UAAU;IACnB,8BAA8B;IACvB,GAAG,EAAE,IAAI,EAAE,CAAM;IAExB,mCAAmC;IAC5B,IAAI,WAA0B;IAErC,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,oDAAoD;IACpD,OAAO,CAAC,IAAI,CAAS;IAErB,0BAA0B;IAC1B,SAAS,CAAC,QAAQ,EAAE,gBAAgB,EAAE,CAAe;IAErD,kDAAkD;IAClD,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE3C,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAgC;IAE9C;;;;OAIG;gBAEC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,EAClC,SAAS,CAAC,EAAE,eAAe;IAiBxB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAK3C,OAAO,IAAI,IAAI;IAUf,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3B,UAAU,IAAI,IAAI;IAYlB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAOjE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA2B1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAW7B,YAAY,IAAI,IAAI;IAIpB,YAAY,IAAI,IAAI;IAUpB,UAAU,IAAI,IAAI;IAIlB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKhE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI;IAQnD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAwBtC;AAED,eAAe,UAAU,CAAC"}
|
||||
176
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.js
generated
vendored
Normal file
176
node_modules/hexo-deployer-git/node_modules/domhandler/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DomHandler = void 0;
|
||||
var domelementtype_1 = require("domelementtype");
|
||||
var node_1 = require("./node");
|
||||
__exportStar(require("./node"), exports);
|
||||
var reWhitespace = /\s+/g;
|
||||
// Default options
|
||||
var defaultOpts = {
|
||||
normalizeWhitespace: false,
|
||||
withStartIndices: false,
|
||||
withEndIndices: false,
|
||||
xmlMode: false,
|
||||
};
|
||||
var DomHandler = /** @class */ (function () {
|
||||
/**
|
||||
* @param callback Called once parsing has completed.
|
||||
* @param options Settings for the handler.
|
||||
* @param elementCB Callback whenever a tag is closed.
|
||||
*/
|
||||
function DomHandler(callback, options, elementCB) {
|
||||
/** The elements of the DOM */
|
||||
this.dom = [];
|
||||
/** The root element for the DOM */
|
||||
this.root = new node_1.Document(this.dom);
|
||||
/** Indicated whether parsing has been completed. */
|
||||
this.done = false;
|
||||
/** Stack of open tags. */
|
||||
this.tagStack = [this.root];
|
||||
/** A data node that is still being written to. */
|
||||
this.lastNode = null;
|
||||
/** Reference to the parser instance. Used for location information. */
|
||||
this.parser = null;
|
||||
// Make it possible to skip arguments, for backwards-compatibility
|
||||
if (typeof options === "function") {
|
||||
elementCB = options;
|
||||
options = defaultOpts;
|
||||
}
|
||||
if (typeof callback === "object") {
|
||||
options = callback;
|
||||
callback = undefined;
|
||||
}
|
||||
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
||||
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
||||
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
||||
}
|
||||
DomHandler.prototype.onparserinit = function (parser) {
|
||||
this.parser = parser;
|
||||
};
|
||||
// Resets the handler back to starting state
|
||||
DomHandler.prototype.onreset = function () {
|
||||
this.dom = [];
|
||||
this.root = new node_1.Document(this.dom);
|
||||
this.done = false;
|
||||
this.tagStack = [this.root];
|
||||
this.lastNode = null;
|
||||
this.parser = null;
|
||||
};
|
||||
// Signals the handler that parsing is done
|
||||
DomHandler.prototype.onend = function () {
|
||||
if (this.done)
|
||||
return;
|
||||
this.done = true;
|
||||
this.parser = null;
|
||||
this.handleCallback(null);
|
||||
};
|
||||
DomHandler.prototype.onerror = function (error) {
|
||||
this.handleCallback(error);
|
||||
};
|
||||
DomHandler.prototype.onclosetag = function () {
|
||||
this.lastNode = null;
|
||||
var elem = this.tagStack.pop();
|
||||
if (this.options.withEndIndices) {
|
||||
elem.endIndex = this.parser.endIndex;
|
||||
}
|
||||
if (this.elementCB)
|
||||
this.elementCB(elem);
|
||||
};
|
||||
DomHandler.prototype.onopentag = function (name, attribs) {
|
||||
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;
|
||||
var element = new node_1.Element(name, attribs, undefined, type);
|
||||
this.addNode(element);
|
||||
this.tagStack.push(element);
|
||||
};
|
||||
DomHandler.prototype.ontext = function (data) {
|
||||
var normalizeWhitespace = this.options.normalizeWhitespace;
|
||||
var lastNode = this.lastNode;
|
||||
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
||||
if (normalizeWhitespace) {
|
||||
lastNode.data = (lastNode.data + data).replace(reWhitespace, " ");
|
||||
}
|
||||
else {
|
||||
lastNode.data += data;
|
||||
}
|
||||
if (this.options.withEndIndices) {
|
||||
lastNode.endIndex = this.parser.endIndex;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (normalizeWhitespace) {
|
||||
data = data.replace(reWhitespace, " ");
|
||||
}
|
||||
var node = new node_1.Text(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
}
|
||||
};
|
||||
DomHandler.prototype.oncomment = function (data) {
|
||||
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
||||
this.lastNode.data += data;
|
||||
return;
|
||||
}
|
||||
var node = new node_1.Comment(data);
|
||||
this.addNode(node);
|
||||
this.lastNode = node;
|
||||
};
|
||||
DomHandler.prototype.oncommentend = function () {
|
||||
this.lastNode = null;
|
||||
};
|
||||
DomHandler.prototype.oncdatastart = function () {
|
||||
var text = new node_1.Text("");
|
||||
var node = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text]);
|
||||
this.addNode(node);
|
||||
text.parent = node;
|
||||
this.lastNode = text;
|
||||
};
|
||||
DomHandler.prototype.oncdataend = function () {
|
||||
this.lastNode = null;
|
||||
};
|
||||
DomHandler.prototype.onprocessinginstruction = function (name, data) {
|
||||
var node = new node_1.ProcessingInstruction(name, data);
|
||||
this.addNode(node);
|
||||
};
|
||||
DomHandler.prototype.handleCallback = function (error) {
|
||||
if (typeof this.callback === "function") {
|
||||
this.callback(error, this.dom);
|
||||
}
|
||||
else if (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
DomHandler.prototype.addNode = function (node) {
|
||||
var parent = this.tagStack[this.tagStack.length - 1];
|
||||
var previousSibling = parent.children[parent.children.length - 1];
|
||||
if (this.options.withStartIndices) {
|
||||
node.startIndex = this.parser.startIndex;
|
||||
}
|
||||
if (this.options.withEndIndices) {
|
||||
node.endIndex = this.parser.endIndex;
|
||||
}
|
||||
parent.children.push(node);
|
||||
if (previousSibling) {
|
||||
node.prev = previousSibling;
|
||||
previousSibling.next = node;
|
||||
}
|
||||
node.parent = parent;
|
||||
this.lastNode = null;
|
||||
};
|
||||
return DomHandler;
|
||||
}());
|
||||
exports.DomHandler = DomHandler;
|
||||
exports.default = DomHandler;
|
||||
237
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.d.ts
generated
vendored
Normal file
237
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.d.ts
generated
vendored
Normal file
@@ -0,0 +1,237 @@
|
||||
import { ElementType } from "domelementtype";
|
||||
interface SourceCodeLocation {
|
||||
/** One-based line index of the first character. */
|
||||
startLine: number;
|
||||
/** One-based column index of the first character. */
|
||||
startCol: number;
|
||||
/** Zero-based first character index. */
|
||||
startOffset: number;
|
||||
/** One-based line index of the last character. */
|
||||
endLine: number;
|
||||
/** One-based column index of the last character. Points directly *after* the last character. */
|
||||
endCol: number;
|
||||
/** Zero-based last character index. Points directly *after* the last character. */
|
||||
endOffset: number;
|
||||
}
|
||||
interface TagSourceCodeLocation extends SourceCodeLocation {
|
||||
startTag?: SourceCodeLocation;
|
||||
endTag?: SourceCodeLocation;
|
||||
}
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
export declare class Node {
|
||||
type: ElementType;
|
||||
/** Parent of the node */
|
||||
parent: NodeWithChildren | null;
|
||||
/** Previous sibling */
|
||||
prev: Node | null;
|
||||
/** Next sibling */
|
||||
next: Node | null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
startIndex: number | null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
endIndex: number | null;
|
||||
/**
|
||||
* `parse5` source code location info.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: SourceCodeLocation | null;
|
||||
/**
|
||||
*
|
||||
* @param type The type of the node.
|
||||
*/
|
||||
constructor(type: ElementType);
|
||||
/**
|
||||
* [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
|
||||
* node {@link type}.
|
||||
*/
|
||||
get nodeType(): number;
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get parentNode(): NodeWithChildren | null;
|
||||
set parentNode(parent: NodeWithChildren | null);
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get previousSibling(): Node | null;
|
||||
set previousSibling(prev: Node | null);
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nextSibling(): Node | null;
|
||||
set nextSibling(next: Node | null);
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
|
||||
}
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
export declare class DataNode extends Node {
|
||||
data: string;
|
||||
/**
|
||||
* @param type The type of the node
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
constructor(type: ElementType.Comment | ElementType.Text | ElementType.Directive, data: string);
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get nodeValue(): string;
|
||||
set nodeValue(data: string);
|
||||
}
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
export declare class Text extends DataNode {
|
||||
constructor(data: string);
|
||||
}
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
export declare class Comment extends DataNode {
|
||||
constructor(data: string);
|
||||
}
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
export declare class ProcessingInstruction extends DataNode {
|
||||
name: string;
|
||||
constructor(name: string, data: string);
|
||||
/** If this is a doctype, the document type name (parse5 only). */
|
||||
"x-name"?: string;
|
||||
/** If this is a doctype, the document type public identifier (parse5 only). */
|
||||
"x-publicId"?: string;
|
||||
/** If this is a doctype, the document type system identifier (parse5 only). */
|
||||
"x-systemId"?: string;
|
||||
}
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
export declare class NodeWithChildren extends Node {
|
||||
children: Node[];
|
||||
/**
|
||||
* @param type Type of the node.
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
constructor(type: ElementType.Root | ElementType.CDATA | ElementType.Script | ElementType.Style | ElementType.Tag, children: Node[]);
|
||||
/** First child of the node. */
|
||||
get firstChild(): Node | null;
|
||||
/** Last child of the node. */
|
||||
get lastChild(): Node | null;
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get childNodes(): Node[];
|
||||
set childNodes(children: Node[]);
|
||||
}
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
export declare class Document extends NodeWithChildren {
|
||||
constructor(children: Node[]);
|
||||
/** [Document mode](https://dom.spec.whatwg.org/#concept-document-limited-quirks) (parse5 only). */
|
||||
"x-mode"?: "no-quirks" | "quirks" | "limited-quirks";
|
||||
}
|
||||
/**
|
||||
* The description of an individual attribute.
|
||||
*/
|
||||
interface Attribute {
|
||||
name: string;
|
||||
value: string;
|
||||
namespace?: string;
|
||||
prefix?: string;
|
||||
}
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
export declare class Element extends NodeWithChildren {
|
||||
name: string;
|
||||
attribs: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
constructor(name: string, attribs: {
|
||||
[name: string]: string;
|
||||
}, children?: Node[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
|
||||
/**
|
||||
* `parse5` source code location info, with start & end tags.
|
||||
*
|
||||
* Available if parsing with parse5 and location info is enabled.
|
||||
*/
|
||||
sourceCodeLocation?: TagSourceCodeLocation | null;
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get tagName(): string;
|
||||
set tagName(name: string);
|
||||
get attributes(): Attribute[];
|
||||
/** Element namespace (parse5 only). */
|
||||
namespace?: string;
|
||||
/** Element attribute namespaces (parse5 only). */
|
||||
"x-attribsNamespace"?: Record<string, string>;
|
||||
/** Element attribute namespace-related prefixes (parse5 only). */
|
||||
"x-attribsPrefix"?: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
export declare function isTag(node: Node): node is Element;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
export declare function isCDATA(node: Node): node is NodeWithChildren;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
export declare function isText(node: Node): node is Text;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
export declare function isComment(node: Node): node is DataNode;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDirective(node: Node): node is ProcessingInstruction;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
export declare function isDocument(node: Node): node is Document;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
||||
*/
|
||||
export declare function hasChildren(node: Node): node is NodeWithChildren;
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
|
||||
export {};
|
||||
//# sourceMappingURL=node.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAahE,UAAU,kBAAkB;IACxB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,qBAAsB,SAAQ,kBAAkB;IACtD,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,IAAI;IA2BM,IAAI,EAAE,WAAW;IA1BpC,yBAAyB;IACzB,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAEvC,uBAAuB;IACvB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEzB,mBAAmB;IACnB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEzB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,uFAAuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAE/C;;;OAGG;gBACgB,IAAI,EAAE,WAAW;IAIpC;;;OAGG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAID;;;OAGG;IACH,IAAI,UAAU,IAAI,gBAAgB,GAAG,IAAI,CAExC;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,EAE7C;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,IAAI,CAEjC;IAED,IAAI,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAEpC;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,IAAI,GAAG,IAAI,CAE7B;IAED,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAEhC;IAED;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC;CAG3D;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,IAAI;IAOnB,IAAI,EAAE,MAAM;IANvB;;;OAGG;gBAEC,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,SAAS,EAC7D,IAAI,EAAE,MAAM;IAKvB;;;OAGG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAEzB;CACJ;AAED;;GAEG;AACH,qBAAa,IAAK,SAAQ,QAAQ;gBAClB,IAAI,EAAE,MAAM;CAG3B;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,QAAQ;gBACrB,IAAI,EAAE,MAAM;CAG3B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;IAC5B,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI7C,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,IAAI;IAY3B,QAAQ,EAAE,IAAI,EAAE;IAX3B;;;OAGG;gBAEC,IAAI,EACE,WAAW,CAAC,IAAI,GAChB,WAAW,CAAC,KAAK,GACjB,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAAK,GACjB,WAAW,CAAC,GAAG,EACd,QAAQ,EAAE,IAAI,EAAE;IAM3B,+BAA+B;IAC/B,IAAI,UAAU,IAAI,IAAI,GAAG,IAAI,CAE5B;IAED,8BAA8B;IAC9B,IAAI,SAAS,IAAI,IAAI,GAAG,IAAI,CAI3B;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,IAAI,EAAE,CAEvB;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,EAE9B;CACJ;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,gBAAgB;gBAC9B,QAAQ,EAAE,IAAI,EAAE;IAI5B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC;CACxD;AAED;;GAEG;AACH,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,gBAAgB;IAO9B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAP9C;;;;OAIG;gBAEQ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAC1C,QAAQ,GAAE,IAAI,EAAO,EACrB,IAAI,GACE,WAAW,CAAC,GAAG,GACf,WAAW,CAAC,MAAM,GAClB,WAAW,CAAC,KAIG;IAKzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAIlD;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,OAAO,CAAC,IAAI,EAAE,MAAM,EAEvB;IAED,IAAI,UAAU,IAAI,SAAS,EAAE,CAO5B;IAED,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAEjD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAE5D;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEtD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,qBAAqB,CAErE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,UAAQ,GAAG,CAAC,CA4DvE"}
|
||||
444
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.js
generated
vendored
Normal file
444
node_modules/hexo-deployer-git/node_modules/domhandler/lib/node.js
generated
vendored
Normal file
@@ -0,0 +1,444 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
|
||||
var domelementtype_1 = require("domelementtype");
|
||||
var nodeTypes = new Map([
|
||||
[domelementtype_1.ElementType.Tag, 1],
|
||||
[domelementtype_1.ElementType.Script, 1],
|
||||
[domelementtype_1.ElementType.Style, 1],
|
||||
[domelementtype_1.ElementType.Directive, 1],
|
||||
[domelementtype_1.ElementType.Text, 3],
|
||||
[domelementtype_1.ElementType.CDATA, 4],
|
||||
[domelementtype_1.ElementType.Comment, 8],
|
||||
[domelementtype_1.ElementType.Root, 9],
|
||||
]);
|
||||
/**
|
||||
* This object will be used as the prototype for Nodes when creating a
|
||||
* DOM-Level-1-compliant structure.
|
||||
*/
|
||||
var Node = /** @class */ (function () {
|
||||
/**
|
||||
*
|
||||
* @param type The type of the node.
|
||||
*/
|
||||
function Node(type) {
|
||||
this.type = type;
|
||||
/** Parent of the node */
|
||||
this.parent = null;
|
||||
/** Previous sibling */
|
||||
this.prev = null;
|
||||
/** Next sibling */
|
||||
this.next = null;
|
||||
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
||||
this.startIndex = null;
|
||||
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
||||
this.endIndex = null;
|
||||
}
|
||||
Object.defineProperty(Node.prototype, "nodeType", {
|
||||
// Read-only aliases
|
||||
/**
|
||||
* [DOM spec](https://dom.spec.whatwg.org/#dom-node-nodetype)-compatible
|
||||
* node {@link type}.
|
||||
*/
|
||||
get: function () {
|
||||
var _a;
|
||||
return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Node.prototype, "parentNode", {
|
||||
// Read-write aliases for properties
|
||||
/**
|
||||
* Same as {@link parent}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.parent;
|
||||
},
|
||||
set: function (parent) {
|
||||
this.parent = parent;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Node.prototype, "previousSibling", {
|
||||
/**
|
||||
* Same as {@link prev}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.prev;
|
||||
},
|
||||
set: function (prev) {
|
||||
this.prev = prev;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Node.prototype, "nextSibling", {
|
||||
/**
|
||||
* Same as {@link next}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.next;
|
||||
},
|
||||
set: function (next) {
|
||||
this.next = next;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/**
|
||||
* Clone this node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
Node.prototype.cloneNode = function (recursive) {
|
||||
if (recursive === void 0) { recursive = false; }
|
||||
return cloneNode(this, recursive);
|
||||
};
|
||||
return Node;
|
||||
}());
|
||||
exports.Node = Node;
|
||||
/**
|
||||
* A node that contains some data.
|
||||
*/
|
||||
var DataNode = /** @class */ (function (_super) {
|
||||
__extends(DataNode, _super);
|
||||
/**
|
||||
* @param type The type of the node
|
||||
* @param data The content of the data node
|
||||
*/
|
||||
function DataNode(type, data) {
|
||||
var _this = _super.call(this, type) || this;
|
||||
_this.data = data;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
||||
/**
|
||||
* Same as {@link data}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.data;
|
||||
},
|
||||
set: function (data) {
|
||||
this.data = data;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return DataNode;
|
||||
}(Node));
|
||||
exports.DataNode = DataNode;
|
||||
/**
|
||||
* Text within the document.
|
||||
*/
|
||||
var Text = /** @class */ (function (_super) {
|
||||
__extends(Text, _super);
|
||||
function Text(data) {
|
||||
return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
|
||||
}
|
||||
return Text;
|
||||
}(DataNode));
|
||||
exports.Text = Text;
|
||||
/**
|
||||
* Comments within the document.
|
||||
*/
|
||||
var Comment = /** @class */ (function (_super) {
|
||||
__extends(Comment, _super);
|
||||
function Comment(data) {
|
||||
return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
|
||||
}
|
||||
return Comment;
|
||||
}(DataNode));
|
||||
exports.Comment = Comment;
|
||||
/**
|
||||
* Processing instructions, including doc types.
|
||||
*/
|
||||
var ProcessingInstruction = /** @class */ (function (_super) {
|
||||
__extends(ProcessingInstruction, _super);
|
||||
function ProcessingInstruction(name, data) {
|
||||
var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
|
||||
_this.name = name;
|
||||
return _this;
|
||||
}
|
||||
return ProcessingInstruction;
|
||||
}(DataNode));
|
||||
exports.ProcessingInstruction = ProcessingInstruction;
|
||||
/**
|
||||
* A `Node` that can have children.
|
||||
*/
|
||||
var NodeWithChildren = /** @class */ (function (_super) {
|
||||
__extends(NodeWithChildren, _super);
|
||||
/**
|
||||
* @param type Type of the node.
|
||||
* @param children Children of the node. Only certain node types can have children.
|
||||
*/
|
||||
function NodeWithChildren(type, children) {
|
||||
var _this = _super.call(this, type) || this;
|
||||
_this.children = children;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
||||
// Aliases
|
||||
/** First child of the node. */
|
||||
get: function () {
|
||||
var _a;
|
||||
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
||||
/** Last child of the node. */
|
||||
get: function () {
|
||||
return this.children.length > 0
|
||||
? this.children[this.children.length - 1]
|
||||
: null;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
||||
/**
|
||||
* Same as {@link children}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.children;
|
||||
},
|
||||
set: function (children) {
|
||||
this.children = children;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return NodeWithChildren;
|
||||
}(Node));
|
||||
exports.NodeWithChildren = NodeWithChildren;
|
||||
/**
|
||||
* The root node of the document.
|
||||
*/
|
||||
var Document = /** @class */ (function (_super) {
|
||||
__extends(Document, _super);
|
||||
function Document(children) {
|
||||
return _super.call(this, domelementtype_1.ElementType.Root, children) || this;
|
||||
}
|
||||
return Document;
|
||||
}(NodeWithChildren));
|
||||
exports.Document = Document;
|
||||
/**
|
||||
* An element within the DOM.
|
||||
*/
|
||||
var Element = /** @class */ (function (_super) {
|
||||
__extends(Element, _super);
|
||||
/**
|
||||
* @param name Name of the tag, eg. `div`, `span`.
|
||||
* @param attribs Object mapping attribute names to attribute values.
|
||||
* @param children Children of the node.
|
||||
*/
|
||||
function Element(name, attribs, children, type) {
|
||||
if (children === void 0) { children = []; }
|
||||
if (type === void 0) { type = name === "script"
|
||||
? domelementtype_1.ElementType.Script
|
||||
: name === "style"
|
||||
? domelementtype_1.ElementType.Style
|
||||
: domelementtype_1.ElementType.Tag; }
|
||||
var _this = _super.call(this, type, children) || this;
|
||||
_this.name = name;
|
||||
_this.attribs = attribs;
|
||||
return _this;
|
||||
}
|
||||
Object.defineProperty(Element.prototype, "tagName", {
|
||||
// DOM Level 1 aliases
|
||||
/**
|
||||
* Same as {@link name}.
|
||||
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
|
||||
*/
|
||||
get: function () {
|
||||
return this.name;
|
||||
},
|
||||
set: function (name) {
|
||||
this.name = name;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(Element.prototype, "attributes", {
|
||||
get: function () {
|
||||
var _this = this;
|
||||
return Object.keys(this.attribs).map(function (name) {
|
||||
var _a, _b;
|
||||
return ({
|
||||
name: name,
|
||||
value: _this.attribs[name],
|
||||
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
||||
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
||||
});
|
||||
});
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return Element;
|
||||
}(NodeWithChildren));
|
||||
exports.Element = Element;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `Element`, `false` otherwise.
|
||||
*/
|
||||
function isTag(node) {
|
||||
return (0, domelementtype_1.isTag)(node);
|
||||
}
|
||||
exports.isTag = isTag;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
||||
*/
|
||||
function isCDATA(node) {
|
||||
return node.type === domelementtype_1.ElementType.CDATA;
|
||||
}
|
||||
exports.isCDATA = isCDATA;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
||||
*/
|
||||
function isText(node) {
|
||||
return node.type === domelementtype_1.ElementType.Text;
|
||||
}
|
||||
exports.isText = isText;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
||||
*/
|
||||
function isComment(node) {
|
||||
return node.type === domelementtype_1.ElementType.Comment;
|
||||
}
|
||||
exports.isComment = isComment;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
function isDirective(node) {
|
||||
return node.type === domelementtype_1.ElementType.Directive;
|
||||
}
|
||||
exports.isDirective = isDirective;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
||||
*/
|
||||
function isDocument(node) {
|
||||
return node.type === domelementtype_1.ElementType.Root;
|
||||
}
|
||||
exports.isDocument = isDocument;
|
||||
/**
|
||||
* @param node Node to check.
|
||||
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
||||
*/
|
||||
function hasChildren(node) {
|
||||
return Object.prototype.hasOwnProperty.call(node, "children");
|
||||
}
|
||||
exports.hasChildren = hasChildren;
|
||||
/**
|
||||
* Clone a node, and optionally its children.
|
||||
*
|
||||
* @param recursive Clone child nodes as well.
|
||||
* @returns A clone of the node.
|
||||
*/
|
||||
function cloneNode(node, recursive) {
|
||||
if (recursive === void 0) { recursive = false; }
|
||||
var result;
|
||||
if (isText(node)) {
|
||||
result = new Text(node.data);
|
||||
}
|
||||
else if (isComment(node)) {
|
||||
result = new Comment(node.data);
|
||||
}
|
||||
else if (isTag(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_1 = new Element(node.name, __assign({}, node.attribs), children);
|
||||
children.forEach(function (child) { return (child.parent = clone_1); });
|
||||
if (node.namespace != null) {
|
||||
clone_1.namespace = node.namespace;
|
||||
}
|
||||
if (node["x-attribsNamespace"]) {
|
||||
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
||||
}
|
||||
if (node["x-attribsPrefix"]) {
|
||||
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
||||
}
|
||||
result = clone_1;
|
||||
}
|
||||
else if (isCDATA(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);
|
||||
children.forEach(function (child) { return (child.parent = clone_2); });
|
||||
result = clone_2;
|
||||
}
|
||||
else if (isDocument(node)) {
|
||||
var children = recursive ? cloneChildren(node.children) : [];
|
||||
var clone_3 = new Document(children);
|
||||
children.forEach(function (child) { return (child.parent = clone_3); });
|
||||
if (node["x-mode"]) {
|
||||
clone_3["x-mode"] = node["x-mode"];
|
||||
}
|
||||
result = clone_3;
|
||||
}
|
||||
else if (isDirective(node)) {
|
||||
var instruction = new ProcessingInstruction(node.name, node.data);
|
||||
if (node["x-name"] != null) {
|
||||
instruction["x-name"] = node["x-name"];
|
||||
instruction["x-publicId"] = node["x-publicId"];
|
||||
instruction["x-systemId"] = node["x-systemId"];
|
||||
}
|
||||
result = instruction;
|
||||
}
|
||||
else {
|
||||
throw new Error("Not implemented yet: ".concat(node.type));
|
||||
}
|
||||
result.startIndex = node.startIndex;
|
||||
result.endIndex = node.endIndex;
|
||||
if (node.sourceCodeLocation != null) {
|
||||
result.sourceCodeLocation = node.sourceCodeLocation;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.cloneNode = cloneNode;
|
||||
function cloneChildren(childs) {
|
||||
var children = childs.map(function (child) { return cloneNode(child, true); });
|
||||
for (var i = 1; i < children.length; i++) {
|
||||
children[i].prev = children[i - 1];
|
||||
children[i - 1].next = children[i];
|
||||
}
|
||||
return children;
|
||||
}
|
||||
58
node_modules/hexo-deployer-git/node_modules/domhandler/package.json
generated
vendored
Normal file
58
node_modules/hexo-deployer-git/node_modules/domhandler/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "domhandler",
|
||||
"version": "4.3.1",
|
||||
"description": "Handler for htmlparser2 that turns pages into a dom",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write '**/*.{ts,md,json}'",
|
||||
"build": "tsc",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/domhandler.git"
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"htmlparser2"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.21",
|
||||
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
||||
"@typescript-eslint/parser": "^5.15.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"htmlparser2": "^7.2.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.6.0",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.6.2"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4
|
||||
}
|
||||
}
|
||||
163
node_modules/hexo-deployer-git/node_modules/domhandler/readme.md
generated
vendored
Normal file
163
node_modules/hexo-deployer-git/node_modules/domhandler/readme.md
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
# domhandler [](https://travis-ci.com/fb55/domhandler)
|
||||
|
||||
The DOM handler creates a tree containing all nodes of a page.
|
||||
The tree can be manipulated using the [domutils](https://github.com/fb55/domutils)
|
||||
or [cheerio](https://github.com/cheeriojs/cheerio) libraries and
|
||||
rendered using [dom-serializer](https://github.com/cheeriojs/dom-serializer) .
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
const handler = new DomHandler([ <func> callback(err, dom), ] [ <obj> options ]);
|
||||
// const parser = new Parser(handler[, options]);
|
||||
```
|
||||
|
||||
Available options are described below.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
const { Parser } = require("htmlparser2");
|
||||
const { DomHandler } = require("domhandler");
|
||||
const rawHtml =
|
||||
"Xyz <script language= javascript>var foo = '<<bar>>';</script><!--<!-- Waah! -- -->";
|
||||
const handler = new DomHandler((error, dom) => {
|
||||
if (error) {
|
||||
// Handle error
|
||||
} else {
|
||||
// Parsing completed, do something
|
||||
console.log(dom);
|
||||
}
|
||||
});
|
||||
const parser = new Parser(handler);
|
||||
parser.write(rawHtml);
|
||||
parser.end();
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
data: "Xyz ",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "script",
|
||||
name: "script",
|
||||
attribs: {
|
||||
language: "javascript",
|
||||
},
|
||||
children: [
|
||||
{
|
||||
data: "var foo = '<bar>';<",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
data: "<!-- Waah! -- ",
|
||||
type: "comment",
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
## Option: `withStartIndices`
|
||||
|
||||
Add a `startIndex` property to nodes.
|
||||
When the parser is used in a non-streaming fashion, `startIndex` is an integer
|
||||
indicating the position of the start of the node in the document.
|
||||
The default value is `false`.
|
||||
|
||||
## Option: `withEndIndices`
|
||||
|
||||
Add an `endIndex` property to nodes.
|
||||
When the parser is used in a non-streaming fashion, `endIndex` is an integer
|
||||
indicating the position of the end of the node in the document.
|
||||
The default value is `false`.
|
||||
|
||||
## Option: `normalizeWhitespace` _(deprecated)_
|
||||
|
||||
Replace all whitespace with single spaces.
|
||||
The default value is `false`.
|
||||
|
||||
**Note:** Enabling this might break your markup.
|
||||
|
||||
For the following examples, this HTML will be used:
|
||||
|
||||
```html
|
||||
<font> <br />this is the text <font></font></font>
|
||||
```
|
||||
|
||||
### Example: `normalizeWhitespace: true`
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
type: "tag",
|
||||
name: "font",
|
||||
children: [
|
||||
{
|
||||
data: " ",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "tag",
|
||||
name: "br",
|
||||
},
|
||||
{
|
||||
data: "this is the text ",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "tag",
|
||||
name: "font",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
### Example: `normalizeWhitespace: false`
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
type: "tag",
|
||||
name: "font",
|
||||
children: [
|
||||
{
|
||||
data: "\n\t",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "tag",
|
||||
name: "br",
|
||||
},
|
||||
{
|
||||
data: "this is the text\n",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
type: "tag",
|
||||
name: "font",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## `domhandler` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `domhandler` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-domhandler?utm_source=npm-domhandler&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
11
node_modules/hexo-deployer-git/node_modules/domutils/LICENSE
generated
vendored
Normal file
11
node_modules/hexo-deployer-git/node_modules/domutils/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
45
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.d.ts
generated
vendored
Normal file
45
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { Node } from "domhandler";
|
||||
export declare type FeedItemMediaMedium = "image" | "audio" | "video" | "document" | "executable";
|
||||
export declare type FeedItemMediaExpression = "sample" | "full" | "nonstop";
|
||||
export interface FeedItemMedia {
|
||||
medium: FeedItemMediaMedium | undefined;
|
||||
isDefault: boolean;
|
||||
url?: string;
|
||||
fileSize?: number;
|
||||
type?: string;
|
||||
expression?: FeedItemMediaExpression;
|
||||
bitrate?: number;
|
||||
framerate?: number;
|
||||
samplingrate?: number;
|
||||
channels?: number;
|
||||
duration?: number;
|
||||
height?: number;
|
||||
width?: number;
|
||||
lang?: string;
|
||||
}
|
||||
export interface FeedItem {
|
||||
id?: string;
|
||||
title?: string;
|
||||
link?: string;
|
||||
description?: string;
|
||||
pubDate?: Date;
|
||||
media: FeedItemMedia[];
|
||||
}
|
||||
export interface Feed {
|
||||
type: string;
|
||||
id?: string;
|
||||
title?: string;
|
||||
link?: string;
|
||||
description?: string;
|
||||
updated?: Date;
|
||||
author?: string;
|
||||
items: FeedItem[];
|
||||
}
|
||||
/**
|
||||
* Get the feed object from the root of a DOM tree.
|
||||
*
|
||||
* @param doc - The DOM to to extract the feed from.
|
||||
* @returns The feed.
|
||||
*/
|
||||
export declare function getFeed(doc: Node[]): Feed | null;
|
||||
//# sourceMappingURL=feeds.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"feeds.d.ts","sourceRoot":"","sources":["../src/feeds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,YAAY,CAAC;AAIhD,oBAAY,mBAAmB,GACzB,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,YAAY,CAAC;AAEnB,oBAAY,uBAAuB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,CAQhD"}
|
||||
190
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.js
generated
vendored
Normal file
190
node_modules/hexo-deployer-git/node_modules/domutils/lib/feeds.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFeed = void 0;
|
||||
var stringify_1 = require("./stringify");
|
||||
var legacy_1 = require("./legacy");
|
||||
/**
|
||||
* Get the feed object from the root of a DOM tree.
|
||||
*
|
||||
* @param doc - The DOM to to extract the feed from.
|
||||
* @returns The feed.
|
||||
*/
|
||||
function getFeed(doc) {
|
||||
var feedRoot = getOneElement(isValidFeed, doc);
|
||||
return !feedRoot
|
||||
? null
|
||||
: feedRoot.name === "feed"
|
||||
? getAtomFeed(feedRoot)
|
||||
: getRssFeed(feedRoot);
|
||||
}
|
||||
exports.getFeed = getFeed;
|
||||
/**
|
||||
* Parse an Atom feed.
|
||||
*
|
||||
* @param feedRoot The root of the feed.
|
||||
* @returns The parsed feed.
|
||||
*/
|
||||
function getAtomFeed(feedRoot) {
|
||||
var _a;
|
||||
var childs = feedRoot.children;
|
||||
var feed = {
|
||||
type: "atom",
|
||||
items: (0, legacy_1.getElementsByTagName)("entry", childs).map(function (item) {
|
||||
var _a;
|
||||
var children = item.children;
|
||||
var entry = { media: getMediaElements(children) };
|
||||
addConditionally(entry, "id", "id", children);
|
||||
addConditionally(entry, "title", "title", children);
|
||||
var href = (_a = getOneElement("link", children)) === null || _a === void 0 ? void 0 : _a.attribs.href;
|
||||
if (href) {
|
||||
entry.link = href;
|
||||
}
|
||||
var description = fetch("summary", children) || fetch("content", children);
|
||||
if (description) {
|
||||
entry.description = description;
|
||||
}
|
||||
var pubDate = fetch("updated", children);
|
||||
if (pubDate) {
|
||||
entry.pubDate = new Date(pubDate);
|
||||
}
|
||||
return entry;
|
||||
}),
|
||||
};
|
||||
addConditionally(feed, "id", "id", childs);
|
||||
addConditionally(feed, "title", "title", childs);
|
||||
var href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs.href;
|
||||
if (href) {
|
||||
feed.link = href;
|
||||
}
|
||||
addConditionally(feed, "description", "subtitle", childs);
|
||||
var updated = fetch("updated", childs);
|
||||
if (updated) {
|
||||
feed.updated = new Date(updated);
|
||||
}
|
||||
addConditionally(feed, "author", "email", childs, true);
|
||||
return feed;
|
||||
}
|
||||
/**
|
||||
* Parse a RSS feed.
|
||||
*
|
||||
* @param feedRoot The root of the feed.
|
||||
* @returns The parsed feed.
|
||||
*/
|
||||
function getRssFeed(feedRoot) {
|
||||
var _a, _b;
|
||||
var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
|
||||
var feed = {
|
||||
type: feedRoot.name.substr(0, 3),
|
||||
id: "",
|
||||
items: (0, legacy_1.getElementsByTagName)("item", feedRoot.children).map(function (item) {
|
||||
var children = item.children;
|
||||
var entry = { media: getMediaElements(children) };
|
||||
addConditionally(entry, "id", "guid", children);
|
||||
addConditionally(entry, "title", "title", children);
|
||||
addConditionally(entry, "link", "link", children);
|
||||
addConditionally(entry, "description", "description", children);
|
||||
var pubDate = fetch("pubDate", children);
|
||||
if (pubDate)
|
||||
entry.pubDate = new Date(pubDate);
|
||||
return entry;
|
||||
}),
|
||||
};
|
||||
addConditionally(feed, "title", "title", childs);
|
||||
addConditionally(feed, "link", "link", childs);
|
||||
addConditionally(feed, "description", "description", childs);
|
||||
var updated = fetch("lastBuildDate", childs);
|
||||
if (updated) {
|
||||
feed.updated = new Date(updated);
|
||||
}
|
||||
addConditionally(feed, "author", "managingEditor", childs, true);
|
||||
return feed;
|
||||
}
|
||||
var MEDIA_KEYS_STRING = ["url", "type", "lang"];
|
||||
var MEDIA_KEYS_INT = [
|
||||
"fileSize",
|
||||
"bitrate",
|
||||
"framerate",
|
||||
"samplingrate",
|
||||
"channels",
|
||||
"duration",
|
||||
"height",
|
||||
"width",
|
||||
];
|
||||
/**
|
||||
* Get all media elements of a feed item.
|
||||
*
|
||||
* @param where Nodes to search in.
|
||||
* @returns Media elements.
|
||||
*/
|
||||
function getMediaElements(where) {
|
||||
return (0, legacy_1.getElementsByTagName)("media:content", where).map(function (elem) {
|
||||
var attribs = elem.attribs;
|
||||
var media = {
|
||||
medium: attribs.medium,
|
||||
isDefault: !!attribs.isDefault,
|
||||
};
|
||||
for (var _i = 0, MEDIA_KEYS_STRING_1 = MEDIA_KEYS_STRING; _i < MEDIA_KEYS_STRING_1.length; _i++) {
|
||||
var attrib = MEDIA_KEYS_STRING_1[_i];
|
||||
if (attribs[attrib]) {
|
||||
media[attrib] = attribs[attrib];
|
||||
}
|
||||
}
|
||||
for (var _a = 0, MEDIA_KEYS_INT_1 = MEDIA_KEYS_INT; _a < MEDIA_KEYS_INT_1.length; _a++) {
|
||||
var attrib = MEDIA_KEYS_INT_1[_a];
|
||||
if (attribs[attrib]) {
|
||||
media[attrib] = parseInt(attribs[attrib], 10);
|
||||
}
|
||||
}
|
||||
if (attribs.expression) {
|
||||
media.expression =
|
||||
attribs.expression;
|
||||
}
|
||||
return media;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get one element by tag name.
|
||||
*
|
||||
* @param tagName Tag name to look for
|
||||
* @param node Node to search in
|
||||
* @returns The element or null
|
||||
*/
|
||||
function getOneElement(tagName, node) {
|
||||
return (0, legacy_1.getElementsByTagName)(tagName, node, true, 1)[0];
|
||||
}
|
||||
/**
|
||||
* Get the text content of an element with a certain tag name.
|
||||
*
|
||||
* @param tagName Tag name to look for.
|
||||
* @param where Node to search in.
|
||||
* @param recurse Whether to recurse into child nodes.
|
||||
* @returns The text content of the element.
|
||||
*/
|
||||
function fetch(tagName, where, recurse) {
|
||||
if (recurse === void 0) { recurse = false; }
|
||||
return (0, stringify_1.textContent)((0, legacy_1.getElementsByTagName)(tagName, where, recurse, 1)).trim();
|
||||
}
|
||||
/**
|
||||
* Adds a property to an object if it has a value.
|
||||
*
|
||||
* @param obj Object to be extended
|
||||
* @param prop Property name
|
||||
* @param tagName Tag name that contains the conditionally added property
|
||||
* @param where Element to search for the property
|
||||
* @param recurse Whether to recurse into child nodes.
|
||||
*/
|
||||
function addConditionally(obj, prop, tagName, where, recurse) {
|
||||
if (recurse === void 0) { recurse = false; }
|
||||
var val = fetch(tagName, where, recurse);
|
||||
if (val)
|
||||
obj[prop] = val;
|
||||
}
|
||||
/**
|
||||
* Checks if an element is a feed root node.
|
||||
*
|
||||
* @param value The name of the element to check.
|
||||
* @returns Whether an element is a feed root node.
|
||||
*/
|
||||
function isValidFeed(value) {
|
||||
return value === "rss" || value === "feed" || value === "rdf:RDF";
|
||||
}
|
||||
51
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.d.ts
generated
vendored
Normal file
51
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Node } from "domhandler";
|
||||
/**
|
||||
* Given an array of nodes, remove any member that is contained by another.
|
||||
*
|
||||
* @param nodes Nodes to filter.
|
||||
* @returns Remaining nodes that aren't subtrees of each other.
|
||||
*/
|
||||
export declare function removeSubsets(nodes: Node[]): Node[];
|
||||
export declare const enum DocumentPosition {
|
||||
DISCONNECTED = 1,
|
||||
PRECEDING = 2,
|
||||
FOLLOWING = 4,
|
||||
CONTAINS = 8,
|
||||
CONTAINED_BY = 16
|
||||
}
|
||||
/**
|
||||
* Compare the position of one node against another node in any other document.
|
||||
* The return value is a bitmask with the following values:
|
||||
*
|
||||
* Document order:
|
||||
* > There is an ordering, document order, defined on all the nodes in the
|
||||
* > document corresponding to the order in which the first character of the
|
||||
* > XML representation of each node occurs in the XML representation of the
|
||||
* > document after expansion of general entities. Thus, the document element
|
||||
* > node will be the first node. Element nodes occur before their children.
|
||||
* > Thus, document order orders element nodes in order of the occurrence of
|
||||
* > their start-tag in the XML (after expansion of entities). The attribute
|
||||
* > nodes of an element occur after the element and before its children. The
|
||||
* > relative order of attribute nodes is implementation-dependent./
|
||||
*
|
||||
* Source:
|
||||
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
|
||||
*
|
||||
* @param nodeA The first node to use in the comparison
|
||||
* @param nodeB The second node to use in the comparison
|
||||
* @returns A bitmask describing the input nodes' relative position.
|
||||
*
|
||||
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
|
||||
* a description of these values.
|
||||
*/
|
||||
export declare function compareDocumentPosition(nodeA: Node, nodeB: Node): number;
|
||||
/**
|
||||
* Sort an array of nodes based on their relative position in the document and
|
||||
* remove any duplicate nodes. If the array contains nodes that do not belong
|
||||
* to the same document, sort order is unspecified.
|
||||
*
|
||||
* @param nodes Array of DOM nodes.
|
||||
* @returns Collection of unique nodes, sorted in document order.
|
||||
*/
|
||||
export declare function uniqueSort<T extends Node>(nodes: T[]): T[];
|
||||
//# sourceMappingURL=helpers.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CA6BnD;AAGD,0BAAkB,gBAAgB;IAC9B,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,YAAY,KAAK;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,CA4CxE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAc1D"}
|
||||
125
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.js
generated
vendored
Normal file
125
node_modules/hexo-deployer-git/node_modules/domutils/lib/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uniqueSort = exports.compareDocumentPosition = exports.removeSubsets = void 0;
|
||||
var domhandler_1 = require("domhandler");
|
||||
/**
|
||||
* Given an array of nodes, remove any member that is contained by another.
|
||||
*
|
||||
* @param nodes Nodes to filter.
|
||||
* @returns Remaining nodes that aren't subtrees of each other.
|
||||
*/
|
||||
function removeSubsets(nodes) {
|
||||
var idx = nodes.length;
|
||||
/*
|
||||
* Check if each node (or one of its ancestors) is already contained in the
|
||||
* array.
|
||||
*/
|
||||
while (--idx >= 0) {
|
||||
var node = nodes[idx];
|
||||
/*
|
||||
* Remove the node if it is not unique.
|
||||
* We are going through the array from the end, so we only
|
||||
* have to check nodes that preceed the node under consideration in the array.
|
||||
*/
|
||||
if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
|
||||
nodes.splice(idx, 1);
|
||||
continue;
|
||||
}
|
||||
for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
|
||||
if (nodes.includes(ancestor)) {
|
||||
nodes.splice(idx, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
exports.removeSubsets = removeSubsets;
|
||||
/**
|
||||
* Compare the position of one node against another node in any other document.
|
||||
* The return value is a bitmask with the following values:
|
||||
*
|
||||
* Document order:
|
||||
* > There is an ordering, document order, defined on all the nodes in the
|
||||
* > document corresponding to the order in which the first character of the
|
||||
* > XML representation of each node occurs in the XML representation of the
|
||||
* > document after expansion of general entities. Thus, the document element
|
||||
* > node will be the first node. Element nodes occur before their children.
|
||||
* > Thus, document order orders element nodes in order of the occurrence of
|
||||
* > their start-tag in the XML (after expansion of entities). The attribute
|
||||
* > nodes of an element occur after the element and before its children. The
|
||||
* > relative order of attribute nodes is implementation-dependent./
|
||||
*
|
||||
* Source:
|
||||
* http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
|
||||
*
|
||||
* @param nodeA The first node to use in the comparison
|
||||
* @param nodeB The second node to use in the comparison
|
||||
* @returns A bitmask describing the input nodes' relative position.
|
||||
*
|
||||
* See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
|
||||
* a description of these values.
|
||||
*/
|
||||
function compareDocumentPosition(nodeA, nodeB) {
|
||||
var aParents = [];
|
||||
var bParents = [];
|
||||
if (nodeA === nodeB) {
|
||||
return 0;
|
||||
}
|
||||
var current = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;
|
||||
while (current) {
|
||||
aParents.unshift(current);
|
||||
current = current.parent;
|
||||
}
|
||||
current = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;
|
||||
while (current) {
|
||||
bParents.unshift(current);
|
||||
current = current.parent;
|
||||
}
|
||||
var maxIdx = Math.min(aParents.length, bParents.length);
|
||||
var idx = 0;
|
||||
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
|
||||
idx++;
|
||||
}
|
||||
if (idx === 0) {
|
||||
return 1 /* DISCONNECTED */;
|
||||
}
|
||||
var sharedParent = aParents[idx - 1];
|
||||
var siblings = sharedParent.children;
|
||||
var aSibling = aParents[idx];
|
||||
var bSibling = bParents[idx];
|
||||
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
|
||||
if (sharedParent === nodeB) {
|
||||
return 4 /* FOLLOWING */ | 16 /* CONTAINED_BY */;
|
||||
}
|
||||
return 4 /* FOLLOWING */;
|
||||
}
|
||||
if (sharedParent === nodeA) {
|
||||
return 2 /* PRECEDING */ | 8 /* CONTAINS */;
|
||||
}
|
||||
return 2 /* PRECEDING */;
|
||||
}
|
||||
exports.compareDocumentPosition = compareDocumentPosition;
|
||||
/**
|
||||
* Sort an array of nodes based on their relative position in the document and
|
||||
* remove any duplicate nodes. If the array contains nodes that do not belong
|
||||
* to the same document, sort order is unspecified.
|
||||
*
|
||||
* @param nodes Array of DOM nodes.
|
||||
* @returns Collection of unique nodes, sorted in document order.
|
||||
*/
|
||||
function uniqueSort(nodes) {
|
||||
nodes = nodes.filter(function (node, i, arr) { return !arr.includes(node, i + 1); });
|
||||
nodes.sort(function (a, b) {
|
||||
var relative = compareDocumentPosition(a, b);
|
||||
if (relative & 2 /* PRECEDING */) {
|
||||
return -1;
|
||||
}
|
||||
else if (relative & 4 /* FOLLOWING */) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return nodes;
|
||||
}
|
||||
exports.uniqueSort = uniqueSort;
|
||||
10
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.d.ts
generated
vendored
Normal file
10
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "./stringify";
|
||||
export * from "./traversal";
|
||||
export * from "./manipulation";
|
||||
export * from "./querying";
|
||||
export * from "./legacy";
|
||||
export * from "./helpers";
|
||||
export * from "./feeds";
|
||||
/** @deprecated Use these methods from `domhandler` directly. */
|
||||
export { isTag, isCDATA, isText, isComment, isDocument, hasChildren, } from "domhandler";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,gEAAgE;AAChE,OAAO,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,GACd,MAAM,YAAY,CAAC"}
|
||||
28
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.js
generated
vendored
Normal file
28
node_modules/hexo-deployer-git/node_modules/domutils/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasChildren = exports.isDocument = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;
|
||||
__exportStar(require("./stringify"), exports);
|
||||
__exportStar(require("./traversal"), exports);
|
||||
__exportStar(require("./manipulation"), exports);
|
||||
__exportStar(require("./querying"), exports);
|
||||
__exportStar(require("./legacy"), exports);
|
||||
__exportStar(require("./helpers"), exports);
|
||||
__exportStar(require("./feeds"), exports);
|
||||
/** @deprecated Use these methods from `domhandler` directly. */
|
||||
var domhandler_1 = require("domhandler");
|
||||
Object.defineProperty(exports, "isTag", { enumerable: true, get: function () { return domhandler_1.isTag; } });
|
||||
Object.defineProperty(exports, "isCDATA", { enumerable: true, get: function () { return domhandler_1.isCDATA; } });
|
||||
Object.defineProperty(exports, "isText", { enumerable: true, get: function () { return domhandler_1.isText; } });
|
||||
Object.defineProperty(exports, "isComment", { enumerable: true, get: function () { return domhandler_1.isComment; } });
|
||||
Object.defineProperty(exports, "isDocument", { enumerable: true, get: function () { return domhandler_1.isDocument; } });
|
||||
Object.defineProperty(exports, "hasChildren", { enumerable: true, get: function () { return domhandler_1.hasChildren; } });
|
||||
47
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.d.ts
generated
vendored
Normal file
47
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Node, Element } from "domhandler";
|
||||
import { ElementType } from "domelementtype";
|
||||
interface TestElementOpts {
|
||||
tag_name?: string | ((name: string) => boolean);
|
||||
tag_type?: string | ((name: string) => boolean);
|
||||
tag_contains?: string | ((data?: string) => boolean);
|
||||
[attributeName: string]: undefined | string | ((attributeValue: string) => boolean);
|
||||
}
|
||||
/**
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param node The element to test.
|
||||
* @returns Whether the element matches the description in `options`.
|
||||
*/
|
||||
export declare function testElement(options: TestElementOpts, node: Node): boolean;
|
||||
/**
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes that match `options`.
|
||||
*/
|
||||
export declare function getElements(options: TestElementOpts, nodes: Node | Node[], recurse: boolean, limit?: number): Node[];
|
||||
/**
|
||||
* @param id The unique ID attribute value to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @returns The node with the supplied ID.
|
||||
*/
|
||||
export declare function getElementById(id: string | ((id: string) => boolean), nodes: Node | Node[], recurse?: boolean): Element | null;
|
||||
/**
|
||||
* @param tagName Tag name to search for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `tagName`.
|
||||
*/
|
||||
export declare function getElementsByTagName(tagName: string | ((name: string) => boolean), nodes: Node | Node[], recurse?: boolean, limit?: number): Element[];
|
||||
/**
|
||||
* @param type Element type to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `type`.
|
||||
*/
|
||||
export declare function getElementsByTagType(type: ElementType | ((type: ElementType) => boolean), nodes: Node | Node[], recurse?: boolean, limit?: number): Node[];
|
||||
export {};
|
||||
//# sourceMappingURL=legacy.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IACrD,CAAC,aAAa,EAAE,MAAM,GAChB,SAAS,GACT,MAAM,GACN,CAAC,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;CAC/C;AAqED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAGzE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACvB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,EAAE,OAAO,EAChB,KAAK,SAAW,GACjB,IAAI,EAAE,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,EACtC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,UAAO,GACf,OAAO,GAAG,IAAI,CAGhB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,EAC7C,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,UAAO,EACd,KAAK,SAAW,GACjB,OAAO,EAAE,CAEX;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,WAAW,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,EACpD,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,UAAO,EACd,KAAK,SAAW,GACjB,IAAI,EAAE,CAER"}
|
||||
124
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.js
generated
vendored
Normal file
124
node_modules/hexo-deployer-git/node_modules/domutils/lib/legacy.js
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0;
|
||||
var domhandler_1 = require("domhandler");
|
||||
var querying_1 = require("./querying");
|
||||
var Checks = {
|
||||
tag_name: function (name) {
|
||||
if (typeof name === "function") {
|
||||
return function (elem) { return (0, domhandler_1.isTag)(elem) && name(elem.name); };
|
||||
}
|
||||
else if (name === "*") {
|
||||
return domhandler_1.isTag;
|
||||
}
|
||||
return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.name === name; };
|
||||
},
|
||||
tag_type: function (type) {
|
||||
if (typeof type === "function") {
|
||||
return function (elem) { return type(elem.type); };
|
||||
}
|
||||
return function (elem) { return elem.type === type; };
|
||||
},
|
||||
tag_contains: function (data) {
|
||||
if (typeof data === "function") {
|
||||
return function (elem) { return (0, domhandler_1.isText)(elem) && data(elem.data); };
|
||||
}
|
||||
return function (elem) { return (0, domhandler_1.isText)(elem) && elem.data === data; };
|
||||
},
|
||||
};
|
||||
/**
|
||||
* @param attrib Attribute to check.
|
||||
* @param value Attribute value to look for.
|
||||
* @returns A function to check whether the a node has an attribute with a particular value.
|
||||
*/
|
||||
function getAttribCheck(attrib, value) {
|
||||
if (typeof value === "function") {
|
||||
return function (elem) { return (0, domhandler_1.isTag)(elem) && value(elem.attribs[attrib]); };
|
||||
}
|
||||
return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value; };
|
||||
}
|
||||
/**
|
||||
* @param a First function to combine.
|
||||
* @param b Second function to combine.
|
||||
* @returns A function taking a node and returning `true` if either
|
||||
* of the input functions returns `true` for the node.
|
||||
*/
|
||||
function combineFuncs(a, b) {
|
||||
return function (elem) { return a(elem) || b(elem); };
|
||||
}
|
||||
/**
|
||||
* @param options An object describing nodes to look for.
|
||||
* @returns A function executing all checks in `options` and returning `true`
|
||||
* if any of them match a node.
|
||||
*/
|
||||
function compileTest(options) {
|
||||
var funcs = Object.keys(options).map(function (key) {
|
||||
var value = options[key];
|
||||
return Object.prototype.hasOwnProperty.call(Checks, key)
|
||||
? Checks[key](value)
|
||||
: getAttribCheck(key, value);
|
||||
});
|
||||
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
|
||||
}
|
||||
/**
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param node The element to test.
|
||||
* @returns Whether the element matches the description in `options`.
|
||||
*/
|
||||
function testElement(options, node) {
|
||||
var test = compileTest(options);
|
||||
return test ? test(node) : true;
|
||||
}
|
||||
exports.testElement = testElement;
|
||||
/**
|
||||
* @param options An object describing nodes to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes that match `options`.
|
||||
*/
|
||||
function getElements(options, nodes, recurse, limit) {
|
||||
if (limit === void 0) { limit = Infinity; }
|
||||
var test = compileTest(options);
|
||||
return test ? (0, querying_1.filter)(test, nodes, recurse, limit) : [];
|
||||
}
|
||||
exports.getElements = getElements;
|
||||
/**
|
||||
* @param id The unique ID attribute value to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @returns The node with the supplied ID.
|
||||
*/
|
||||
function getElementById(id, nodes, recurse) {
|
||||
if (recurse === void 0) { recurse = true; }
|
||||
if (!Array.isArray(nodes))
|
||||
nodes = [nodes];
|
||||
return (0, querying_1.findOne)(getAttribCheck("id", id), nodes, recurse);
|
||||
}
|
||||
exports.getElementById = getElementById;
|
||||
/**
|
||||
* @param tagName Tag name to search for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `tagName`.
|
||||
*/
|
||||
function getElementsByTagName(tagName, nodes, recurse, limit) {
|
||||
if (recurse === void 0) { recurse = true; }
|
||||
if (limit === void 0) { limit = Infinity; }
|
||||
return (0, querying_1.filter)(Checks.tag_name(tagName), nodes, recurse, limit);
|
||||
}
|
||||
exports.getElementsByTagName = getElementsByTagName;
|
||||
/**
|
||||
* @param type Element type to look for.
|
||||
* @param nodes Nodes to search through.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes with the supplied `type`.
|
||||
*/
|
||||
function getElementsByTagType(type, nodes, recurse, limit) {
|
||||
if (recurse === void 0) { recurse = true; }
|
||||
if (limit === void 0) { limit = Infinity; }
|
||||
return (0, querying_1.filter)(Checks.tag_type(type), nodes, recurse, limit);
|
||||
}
|
||||
exports.getElementsByTagType = getElementsByTagType;
|
||||
43
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.d.ts
generated
vendored
Normal file
43
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Node, Element } from "domhandler";
|
||||
/**
|
||||
* Remove an element from the dom
|
||||
*
|
||||
* @param elem The element to be removed
|
||||
*/
|
||||
export declare function removeElement(elem: Node): void;
|
||||
/**
|
||||
* Replace an element in the dom
|
||||
*
|
||||
* @param elem The element to be replaced
|
||||
* @param replacement The element to be added
|
||||
*/
|
||||
export declare function replaceElement(elem: Node, replacement: Node): void;
|
||||
/**
|
||||
* Append a child to an element.
|
||||
*
|
||||
* @param elem The element to append to.
|
||||
* @param child The element to be added as a child.
|
||||
*/
|
||||
export declare function appendChild(elem: Element, child: Node): void;
|
||||
/**
|
||||
* Append an element after another.
|
||||
*
|
||||
* @param elem The element to append after.
|
||||
* @param next The element be added.
|
||||
*/
|
||||
export declare function append(elem: Node, next: Node): void;
|
||||
/**
|
||||
* Prepend a child to an element.
|
||||
*
|
||||
* @param elem The element to prepend before.
|
||||
* @param child The element to be added as a child.
|
||||
*/
|
||||
export declare function prependChild(elem: Element, child: Node): void;
|
||||
/**
|
||||
* Prepend an element before another.
|
||||
*
|
||||
* @param elem The element to prepend before.
|
||||
* @param prev The element be added.
|
||||
*/
|
||||
export declare function prepend(elem: Node, prev: Node): void;
|
||||
//# sourceMappingURL=manipulation.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"manipulation.d.ts","sourceRoot":"","sources":["../src/manipulation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAQ9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,GAAG,IAAI,CAgBlE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CAa5D;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAoBnD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CAa7D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAiBpD"}
|
||||
129
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.js
generated
vendored
Normal file
129
node_modules/hexo-deployer-git/node_modules/domutils/lib/manipulation.js
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.prepend = exports.prependChild = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0;
|
||||
/**
|
||||
* Remove an element from the dom
|
||||
*
|
||||
* @param elem The element to be removed
|
||||
*/
|
||||
function removeElement(elem) {
|
||||
if (elem.prev)
|
||||
elem.prev.next = elem.next;
|
||||
if (elem.next)
|
||||
elem.next.prev = elem.prev;
|
||||
if (elem.parent) {
|
||||
var childs = elem.parent.children;
|
||||
childs.splice(childs.lastIndexOf(elem), 1);
|
||||
}
|
||||
}
|
||||
exports.removeElement = removeElement;
|
||||
/**
|
||||
* Replace an element in the dom
|
||||
*
|
||||
* @param elem The element to be replaced
|
||||
* @param replacement The element to be added
|
||||
*/
|
||||
function replaceElement(elem, replacement) {
|
||||
var prev = (replacement.prev = elem.prev);
|
||||
if (prev) {
|
||||
prev.next = replacement;
|
||||
}
|
||||
var next = (replacement.next = elem.next);
|
||||
if (next) {
|
||||
next.prev = replacement;
|
||||
}
|
||||
var parent = (replacement.parent = elem.parent);
|
||||
if (parent) {
|
||||
var childs = parent.children;
|
||||
childs[childs.lastIndexOf(elem)] = replacement;
|
||||
}
|
||||
}
|
||||
exports.replaceElement = replaceElement;
|
||||
/**
|
||||
* Append a child to an element.
|
||||
*
|
||||
* @param elem The element to append to.
|
||||
* @param child The element to be added as a child.
|
||||
*/
|
||||
function appendChild(elem, child) {
|
||||
removeElement(child);
|
||||
child.next = null;
|
||||
child.parent = elem;
|
||||
if (elem.children.push(child) > 1) {
|
||||
var sibling = elem.children[elem.children.length - 2];
|
||||
sibling.next = child;
|
||||
child.prev = sibling;
|
||||
}
|
||||
else {
|
||||
child.prev = null;
|
||||
}
|
||||
}
|
||||
exports.appendChild = appendChild;
|
||||
/**
|
||||
* Append an element after another.
|
||||
*
|
||||
* @param elem The element to append after.
|
||||
* @param next The element be added.
|
||||
*/
|
||||
function append(elem, next) {
|
||||
removeElement(next);
|
||||
var parent = elem.parent;
|
||||
var currNext = elem.next;
|
||||
next.next = currNext;
|
||||
next.prev = elem;
|
||||
elem.next = next;
|
||||
next.parent = parent;
|
||||
if (currNext) {
|
||||
currNext.prev = next;
|
||||
if (parent) {
|
||||
var childs = parent.children;
|
||||
childs.splice(childs.lastIndexOf(currNext), 0, next);
|
||||
}
|
||||
}
|
||||
else if (parent) {
|
||||
parent.children.push(next);
|
||||
}
|
||||
}
|
||||
exports.append = append;
|
||||
/**
|
||||
* Prepend a child to an element.
|
||||
*
|
||||
* @param elem The element to prepend before.
|
||||
* @param child The element to be added as a child.
|
||||
*/
|
||||
function prependChild(elem, child) {
|
||||
removeElement(child);
|
||||
child.parent = elem;
|
||||
child.prev = null;
|
||||
if (elem.children.unshift(child) !== 1) {
|
||||
var sibling = elem.children[1];
|
||||
sibling.prev = child;
|
||||
child.next = sibling;
|
||||
}
|
||||
else {
|
||||
child.next = null;
|
||||
}
|
||||
}
|
||||
exports.prependChild = prependChild;
|
||||
/**
|
||||
* Prepend an element before another.
|
||||
*
|
||||
* @param elem The element to prepend before.
|
||||
* @param prev The element be added.
|
||||
*/
|
||||
function prepend(elem, prev) {
|
||||
removeElement(prev);
|
||||
var parent = elem.parent;
|
||||
if (parent) {
|
||||
var childs = parent.children;
|
||||
childs.splice(childs.indexOf(elem), 0, prev);
|
||||
}
|
||||
if (elem.prev) {
|
||||
elem.prev.next = prev;
|
||||
}
|
||||
prev.parent = parent;
|
||||
prev.prev = elem.prev;
|
||||
prev.next = elem;
|
||||
elem.prev = prev;
|
||||
}
|
||||
exports.prepend = prepend;
|
||||
55
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.d.ts
generated
vendored
Normal file
55
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Node, Element } from "domhandler";
|
||||
/**
|
||||
* Search a node and its children for nodes passing a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param node Node to search. Will be included in the result set if it matches.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
export declare function filter(test: (elem: Node) => boolean, node: Node | Node[], recurse?: boolean, limit?: number): Node[];
|
||||
/**
|
||||
* Search an array of node and its children for nodes passing a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
export declare function find(test: (elem: Node) => boolean, nodes: Node[], recurse: boolean, limit: number): Node[];
|
||||
/**
|
||||
* Finds the first element inside of an array that matches a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns The first node in the array that passes `test`.
|
||||
*/
|
||||
export declare function findOneChild(test: (elem: Node) => boolean, nodes: Node[]): Node | undefined;
|
||||
/**
|
||||
* Finds one element in a tree that passes a test.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @returns The first child node that passes `test`.
|
||||
*/
|
||||
export declare function findOne(test: (elem: Element) => boolean, nodes: Node[], recurse?: boolean): Element | null;
|
||||
/**
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns Whether a tree of nodes contains at least one node passing a test.
|
||||
*/
|
||||
export declare function existsOne(test: (elem: Element) => boolean, nodes: Node[]): boolean;
|
||||
/**
|
||||
* Search and array of nodes and its children for nodes passing a test function.
|
||||
*
|
||||
* Same as `find`, only with less options, leading to reduced complexity.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
export declare function findAll(test: (elem: Element) => boolean, nodes: Node[]): Element[];
|
||||
//# sourceMappingURL=querying.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"querying.d.ts","sourceRoot":"","sources":["../src/querying.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,EACnB,OAAO,UAAO,EACd,KAAK,SAAW,GACjB,IAAI,EAAE,CAGR;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAChB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAC7B,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACd,IAAI,EAAE,CAkBR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,EAC7B,KAAK,EAAE,IAAI,EAAE,GACd,IAAI,GAAG,SAAS,CAElB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,UAAO,GACf,OAAO,GAAG,IAAI,CAehB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACrB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,IAAI,EAAE,GACd,OAAO,CAQT;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACnB,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,EAChC,KAAK,EAAE,IAAI,EAAE,GACd,OAAO,EAAE,CAYX"}
|
||||
126
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.js
generated
vendored
Normal file
126
node_modules/hexo-deployer-git/node_modules/domutils/lib/querying.js
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0;
|
||||
var domhandler_1 = require("domhandler");
|
||||
/**
|
||||
* Search a node and its children for nodes passing a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param node Node to search. Will be included in the result set if it matches.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
function filter(test, node, recurse, limit) {
|
||||
if (recurse === void 0) { recurse = true; }
|
||||
if (limit === void 0) { limit = Infinity; }
|
||||
if (!Array.isArray(node))
|
||||
node = [node];
|
||||
return find(test, node, recurse, limit);
|
||||
}
|
||||
exports.filter = filter;
|
||||
/**
|
||||
* Search an array of node and its children for nodes passing a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @param limit Maximum number of nodes to return.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
function find(test, nodes, recurse, limit) {
|
||||
var result = [];
|
||||
for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
|
||||
var elem = nodes_1[_i];
|
||||
if (test(elem)) {
|
||||
result.push(elem);
|
||||
if (--limit <= 0)
|
||||
break;
|
||||
}
|
||||
if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {
|
||||
var children = find(test, elem.children, recurse, limit);
|
||||
result.push.apply(result, children);
|
||||
limit -= children.length;
|
||||
if (limit <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.find = find;
|
||||
/**
|
||||
* Finds the first element inside of an array that matches a test function.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns The first node in the array that passes `test`.
|
||||
*/
|
||||
function findOneChild(test, nodes) {
|
||||
return nodes.find(test);
|
||||
}
|
||||
exports.findOneChild = findOneChild;
|
||||
/**
|
||||
* Finds one element in a tree that passes a test.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @param recurse Also consider child nodes.
|
||||
* @returns The first child node that passes `test`.
|
||||
*/
|
||||
function findOne(test, nodes, recurse) {
|
||||
if (recurse === void 0) { recurse = true; }
|
||||
var elem = null;
|
||||
for (var i = 0; i < nodes.length && !elem; i++) {
|
||||
var checked = nodes[i];
|
||||
if (!(0, domhandler_1.isTag)(checked)) {
|
||||
continue;
|
||||
}
|
||||
else if (test(checked)) {
|
||||
elem = checked;
|
||||
}
|
||||
else if (recurse && checked.children.length > 0) {
|
||||
elem = findOne(test, checked.children);
|
||||
}
|
||||
}
|
||||
return elem;
|
||||
}
|
||||
exports.findOne = findOne;
|
||||
/**
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns Whether a tree of nodes contains at least one node passing a test.
|
||||
*/
|
||||
function existsOne(test, nodes) {
|
||||
return nodes.some(function (checked) {
|
||||
return (0, domhandler_1.isTag)(checked) &&
|
||||
(test(checked) ||
|
||||
(checked.children.length > 0 &&
|
||||
existsOne(test, checked.children)));
|
||||
});
|
||||
}
|
||||
exports.existsOne = existsOne;
|
||||
/**
|
||||
* Search and array of nodes and its children for nodes passing a test function.
|
||||
*
|
||||
* Same as `find`, only with less options, leading to reduced complexity.
|
||||
*
|
||||
* @param test Function to test nodes on.
|
||||
* @param nodes Array of nodes to search.
|
||||
* @returns All nodes passing `test`.
|
||||
*/
|
||||
function findAll(test, nodes) {
|
||||
var _a;
|
||||
var result = [];
|
||||
var stack = nodes.filter(domhandler_1.isTag);
|
||||
var elem;
|
||||
while ((elem = stack.shift())) {
|
||||
var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);
|
||||
if (children && children.length > 0) {
|
||||
stack.unshift.apply(stack, children);
|
||||
}
|
||||
if (test(elem))
|
||||
result.push(elem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.findAll = findAll;
|
||||
41
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.d.ts
generated
vendored
Normal file
41
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.d.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Node } from "domhandler";
|
||||
import { DomSerializerOptions } from "dom-serializer";
|
||||
/**
|
||||
* @param node Node to get the outer HTML of.
|
||||
* @param options Options for serialization.
|
||||
* @deprecated Use the `dom-serializer` module directly.
|
||||
* @returns `node`'s outer HTML.
|
||||
*/
|
||||
export declare function getOuterHTML(node: Node | Node[], options?: DomSerializerOptions): string;
|
||||
/**
|
||||
* @param node Node to get the inner HTML of.
|
||||
* @param options Options for serialization.
|
||||
* @deprecated Use the `dom-serializer` module directly.
|
||||
* @returns `node`'s inner HTML.
|
||||
*/
|
||||
export declare function getInnerHTML(node: Node, options?: DomSerializerOptions): string;
|
||||
/**
|
||||
* Get a node's inner text. Same as `textContent`, but inserts newlines for `<br>` tags.
|
||||
*
|
||||
* @deprecated Use `textContent` instead.
|
||||
* @param node Node to get the inner text of.
|
||||
* @returns `node`'s inner text.
|
||||
*/
|
||||
export declare function getText(node: Node | Node[]): string;
|
||||
/**
|
||||
* Get a node's text content.
|
||||
*
|
||||
* @param node Node to get the text content of.
|
||||
* @returns `node`'s text content.
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent}
|
||||
*/
|
||||
export declare function textContent(node: Node | Node[]): string;
|
||||
/**
|
||||
* Get a node's inner text.
|
||||
*
|
||||
* @param node Node to get the inner text of.
|
||||
* @returns `node`'s inner text.
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText}
|
||||
*/
|
||||
export declare function innerText(node: Node | Node[]): string;
|
||||
//# sourceMappingURL=stringify.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../src/stringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,IAAI,EAEP,MAAM,YAAY,CAAC;AACpB,OAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGlE;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,EACnB,OAAO,CAAC,EAAE,oBAAoB,GAC/B,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,oBAAoB,GAC/B,MAAM,CAIR;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,MAAM,CAMnD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,MAAM,CAOvD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,MAAM,CAOrD"}
|
||||
86
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.js
generated
vendored
Normal file
86
node_modules/hexo-deployer-git/node_modules/domutils/lib/stringify.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.innerText = exports.textContent = exports.getText = exports.getInnerHTML = exports.getOuterHTML = void 0;
|
||||
var domhandler_1 = require("domhandler");
|
||||
var dom_serializer_1 = __importDefault(require("dom-serializer"));
|
||||
var domelementtype_1 = require("domelementtype");
|
||||
/**
|
||||
* @param node Node to get the outer HTML of.
|
||||
* @param options Options for serialization.
|
||||
* @deprecated Use the `dom-serializer` module directly.
|
||||
* @returns `node`'s outer HTML.
|
||||
*/
|
||||
function getOuterHTML(node, options) {
|
||||
return (0, dom_serializer_1.default)(node, options);
|
||||
}
|
||||
exports.getOuterHTML = getOuterHTML;
|
||||
/**
|
||||
* @param node Node to get the inner HTML of.
|
||||
* @param options Options for serialization.
|
||||
* @deprecated Use the `dom-serializer` module directly.
|
||||
* @returns `node`'s inner HTML.
|
||||
*/
|
||||
function getInnerHTML(node, options) {
|
||||
return (0, domhandler_1.hasChildren)(node)
|
||||
? node.children.map(function (node) { return getOuterHTML(node, options); }).join("")
|
||||
: "";
|
||||
}
|
||||
exports.getInnerHTML = getInnerHTML;
|
||||
/**
|
||||
* Get a node's inner text. Same as `textContent`, but inserts newlines for `<br>` tags.
|
||||
*
|
||||
* @deprecated Use `textContent` instead.
|
||||
* @param node Node to get the inner text of.
|
||||
* @returns `node`'s inner text.
|
||||
*/
|
||||
function getText(node) {
|
||||
if (Array.isArray(node))
|
||||
return node.map(getText).join("");
|
||||
if ((0, domhandler_1.isTag)(node))
|
||||
return node.name === "br" ? "\n" : getText(node.children);
|
||||
if ((0, domhandler_1.isCDATA)(node))
|
||||
return getText(node.children);
|
||||
if ((0, domhandler_1.isText)(node))
|
||||
return node.data;
|
||||
return "";
|
||||
}
|
||||
exports.getText = getText;
|
||||
/**
|
||||
* Get a node's text content.
|
||||
*
|
||||
* @param node Node to get the text content of.
|
||||
* @returns `node`'s text content.
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent}
|
||||
*/
|
||||
function textContent(node) {
|
||||
if (Array.isArray(node))
|
||||
return node.map(textContent).join("");
|
||||
if ((0, domhandler_1.hasChildren)(node) && !(0, domhandler_1.isComment)(node)) {
|
||||
return textContent(node.children);
|
||||
}
|
||||
if ((0, domhandler_1.isText)(node))
|
||||
return node.data;
|
||||
return "";
|
||||
}
|
||||
exports.textContent = textContent;
|
||||
/**
|
||||
* Get a node's inner text.
|
||||
*
|
||||
* @param node Node to get the inner text of.
|
||||
* @returns `node`'s inner text.
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText}
|
||||
*/
|
||||
function innerText(node) {
|
||||
if (Array.isArray(node))
|
||||
return node.map(innerText).join("");
|
||||
if ((0, domhandler_1.hasChildren)(node) && (node.type === domelementtype_1.ElementType.Tag || (0, domhandler_1.isCDATA)(node))) {
|
||||
return innerText(node.children);
|
||||
}
|
||||
if ((0, domhandler_1.isText)(node))
|
||||
return node.data;
|
||||
return "";
|
||||
}
|
||||
exports.innerText = innerText;
|
||||
59
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.d.ts
generated
vendored
Normal file
59
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { Node, Element, NodeWithChildren } from "domhandler";
|
||||
/**
|
||||
* Get a node's children.
|
||||
*
|
||||
* @param elem Node to get the children of.
|
||||
* @returns `elem`'s children, or an empty array.
|
||||
*/
|
||||
export declare function getChildren(elem: Node): Node[];
|
||||
export declare function getParent(elem: Element): Element | null;
|
||||
export declare function getParent(elem: Node): NodeWithChildren | null;
|
||||
/**
|
||||
* Gets an elements siblings, including the element itself.
|
||||
*
|
||||
* Attempts to get the children through the element's parent first.
|
||||
* If we don't have a parent (the element is a root node),
|
||||
* we walk the element's `prev` & `next` to get all remaining nodes.
|
||||
*
|
||||
* @param elem Element to get the siblings of.
|
||||
* @returns `elem`'s siblings.
|
||||
*/
|
||||
export declare function getSiblings(elem: Node): Node[];
|
||||
/**
|
||||
* Gets an attribute from an element.
|
||||
*
|
||||
* @param elem Element to check.
|
||||
* @param name Attribute name to retrieve.
|
||||
* @returns The element's attribute value, or `undefined`.
|
||||
*/
|
||||
export declare function getAttributeValue(elem: Element, name: string): string | undefined;
|
||||
/**
|
||||
* Checks whether an element has an attribute.
|
||||
*
|
||||
* @param elem Element to check.
|
||||
* @param name Attribute name to look for.
|
||||
* @returns Returns whether `elem` has the attribute `name`.
|
||||
*/
|
||||
export declare function hasAttrib(elem: Element, name: string): boolean;
|
||||
/**
|
||||
* Get the tag name of an element.
|
||||
*
|
||||
* @param elem The element to get the name for.
|
||||
* @returns The tag name of `elem`.
|
||||
*/
|
||||
export declare function getName(elem: Element): string;
|
||||
/**
|
||||
* Returns the next element sibling of a node.
|
||||
*
|
||||
* @param elem The element to get the next sibling of.
|
||||
* @returns `elem`'s next sibling that is a tag.
|
||||
*/
|
||||
export declare function nextElementSibling(elem: Node): Element | null;
|
||||
/**
|
||||
* Returns the previous element sibling of a node.
|
||||
*
|
||||
* @param elem The element to get the previous sibling of.
|
||||
* @returns `elem`'s previous sibling that is a tag.
|
||||
*/
|
||||
export declare function prevElementSibling(elem: Node): Element | null;
|
||||
//# sourceMappingURL=traversal.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGpE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAE9C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;AACzD,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAAC;AAW/D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAe9C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAI7D"}
|
||||
117
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.js
generated
vendored
Normal file
117
node_modules/hexo-deployer-git/node_modules/domutils/lib/traversal.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.prevElementSibling = exports.nextElementSibling = exports.getName = exports.hasAttrib = exports.getAttributeValue = exports.getSiblings = exports.getParent = exports.getChildren = void 0;
|
||||
var domhandler_1 = require("domhandler");
|
||||
var emptyArray = [];
|
||||
/**
|
||||
* Get a node's children.
|
||||
*
|
||||
* @param elem Node to get the children of.
|
||||
* @returns `elem`'s children, or an empty array.
|
||||
*/
|
||||
function getChildren(elem) {
|
||||
var _a;
|
||||
return (_a = elem.children) !== null && _a !== void 0 ? _a : emptyArray;
|
||||
}
|
||||
exports.getChildren = getChildren;
|
||||
/**
|
||||
* Get a node's parent.
|
||||
*
|
||||
* @param elem Node to get the parent of.
|
||||
* @returns `elem`'s parent node.
|
||||
*/
|
||||
function getParent(elem) {
|
||||
return elem.parent || null;
|
||||
}
|
||||
exports.getParent = getParent;
|
||||
/**
|
||||
* Gets an elements siblings, including the element itself.
|
||||
*
|
||||
* Attempts to get the children through the element's parent first.
|
||||
* If we don't have a parent (the element is a root node),
|
||||
* we walk the element's `prev` & `next` to get all remaining nodes.
|
||||
*
|
||||
* @param elem Element to get the siblings of.
|
||||
* @returns `elem`'s siblings.
|
||||
*/
|
||||
function getSiblings(elem) {
|
||||
var _a, _b;
|
||||
var parent = getParent(elem);
|
||||
if (parent != null)
|
||||
return getChildren(parent);
|
||||
var siblings = [elem];
|
||||
var prev = elem.prev, next = elem.next;
|
||||
while (prev != null) {
|
||||
siblings.unshift(prev);
|
||||
(_a = prev, prev = _a.prev);
|
||||
}
|
||||
while (next != null) {
|
||||
siblings.push(next);
|
||||
(_b = next, next = _b.next);
|
||||
}
|
||||
return siblings;
|
||||
}
|
||||
exports.getSiblings = getSiblings;
|
||||
/**
|
||||
* Gets an attribute from an element.
|
||||
*
|
||||
* @param elem Element to check.
|
||||
* @param name Attribute name to retrieve.
|
||||
* @returns The element's attribute value, or `undefined`.
|
||||
*/
|
||||
function getAttributeValue(elem, name) {
|
||||
var _a;
|
||||
return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];
|
||||
}
|
||||
exports.getAttributeValue = getAttributeValue;
|
||||
/**
|
||||
* Checks whether an element has an attribute.
|
||||
*
|
||||
* @param elem Element to check.
|
||||
* @param name Attribute name to look for.
|
||||
* @returns Returns whether `elem` has the attribute `name`.
|
||||
*/
|
||||
function hasAttrib(elem, name) {
|
||||
return (elem.attribs != null &&
|
||||
Object.prototype.hasOwnProperty.call(elem.attribs, name) &&
|
||||
elem.attribs[name] != null);
|
||||
}
|
||||
exports.hasAttrib = hasAttrib;
|
||||
/**
|
||||
* Get the tag name of an element.
|
||||
*
|
||||
* @param elem The element to get the name for.
|
||||
* @returns The tag name of `elem`.
|
||||
*/
|
||||
function getName(elem) {
|
||||
return elem.name;
|
||||
}
|
||||
exports.getName = getName;
|
||||
/**
|
||||
* Returns the next element sibling of a node.
|
||||
*
|
||||
* @param elem The element to get the next sibling of.
|
||||
* @returns `elem`'s next sibling that is a tag.
|
||||
*/
|
||||
function nextElementSibling(elem) {
|
||||
var _a;
|
||||
var next = elem.next;
|
||||
while (next !== null && !(0, domhandler_1.isTag)(next))
|
||||
(_a = next, next = _a.next);
|
||||
return next;
|
||||
}
|
||||
exports.nextElementSibling = nextElementSibling;
|
||||
/**
|
||||
* Returns the previous element sibling of a node.
|
||||
*
|
||||
* @param elem The element to get the previous sibling of.
|
||||
* @returns `elem`'s previous sibling that is a tag.
|
||||
*/
|
||||
function prevElementSibling(elem) {
|
||||
var _a;
|
||||
var prev = elem.prev;
|
||||
while (prev !== null && !(0, domhandler_1.isTag)(prev))
|
||||
(_a = prev, prev = _a.prev);
|
||||
return prev;
|
||||
}
|
||||
exports.prevElementSibling = prevElementSibling;
|
||||
65
node_modules/hexo-deployer-git/node_modules/domutils/package.json
generated
vendored
Normal file
65
node_modules/hexo-deployer-git/node_modules/domutils/package.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "domutils",
|
||||
"version": "2.8.0",
|
||||
"description": "Utilities for working with htmlparser2's dom",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint --ignore-path .gitignore .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.{ts,md,json,yml}\" --ignore-path .gitignore",
|
||||
"build": "tsc",
|
||||
"build:docs": "typedoc --hideGenerator --exclude \"**/*+(index|.spec).ts\" src",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/domutils.git"
|
||||
},
|
||||
"keywords": [
|
||||
"dom",
|
||||
"htmlparser2"
|
||||
],
|
||||
"dependencies": {
|
||||
"dom-serializer": "^1.0.1",
|
||||
"domelementtype": "^2.2.0",
|
||||
"domhandler": "^4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.1",
|
||||
"@types/node": "^16.7.2",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
||||
"@typescript-eslint/parser": "^4.29.3",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-jsdoc": "^36.0.8",
|
||||
"htmlparser2": "~7.0.0",
|
||||
"jest": "^27.1.0",
|
||||
"prettier": "^2.0.5",
|
||||
"ts-jest": "^27.0.5",
|
||||
"typedoc": "^0.21.6",
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4
|
||||
}
|
||||
}
|
||||
31
node_modules/hexo-deployer-git/node_modules/domutils/readme.md
generated
vendored
Normal file
31
node_modules/hexo-deployer-git/node_modules/domutils/readme.md
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# domutils [](https://travis-ci.com/fb55/domutils)
|
||||
|
||||
Utilities for working with [htmlparser2](https://github.com/fb55/htmlparser2)'s DOM.
|
||||
|
||||
All functions are exported as a single module. Look [through the docs](https://domutils.js.org/modules.html) to see what is available.
|
||||
|
||||
## Ecosystem
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------- |
|
||||
| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser |
|
||||
| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM |
|
||||
| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM |
|
||||
| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM |
|
||||
| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM |
|
||||
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM |
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## `domutils` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `domutils` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-domutils?utm_source=npm-domutils&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
11
node_modules/hexo-deployer-git/node_modules/entities/LICENSE
generated
vendored
Normal file
11
node_modules/hexo-deployer-git/node_modules/entities/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
15
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
15
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import htmlDecodeTree from "./generated/decode-data-html";
|
||||
import xmlDecodeTree from "./generated/decode-data-xml";
|
||||
export { htmlDecodeTree, xmlDecodeTree };
|
||||
export declare enum BinTrieFlags {
|
||||
HAS_VALUE = 32768,
|
||||
BRANCH_LENGTH = 32512,
|
||||
MULTI_BYTE = 128,
|
||||
JUMP_TABLE = 127
|
||||
}
|
||||
export declare const JUMP_OFFSET_BASE: number;
|
||||
export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number;
|
||||
export declare function decodeHTML(str: string): string;
|
||||
export declare function decodeHTMLStrict(str: string): string;
|
||||
export declare function decodeXML(str: string): string;
|
||||
//# sourceMappingURL=decode.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAIxD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAczC,oBAAY,YAAY;IACpB,SAAS,QAAwB;IACjC,aAAa,QAAwB;IACrC,UAAU,MAAwB;IAClC,UAAU,MAAwB;CACrC;AAED,eAAO,MAAM,gBAAgB,QAAqB,CAAC;AAmGnD,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CA0CR;AAKD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
||||
145
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.js
generated
vendored
Normal file
145
node_modules/hexo-deployer-git/node_modules/entities/lib/decode.js
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTML = exports.determineBranch = exports.JUMP_OFFSET_BASE = exports.BinTrieFlags = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0;
|
||||
var decode_data_html_1 = __importDefault(require("./generated/decode-data-html"));
|
||||
exports.htmlDecodeTree = decode_data_html_1.default;
|
||||
var decode_data_xml_1 = __importDefault(require("./generated/decode-data-xml"));
|
||||
exports.xmlDecodeTree = decode_data_xml_1.default;
|
||||
var decode_codepoint_1 = __importDefault(require("./decode_codepoint"));
|
||||
var BinTrieFlags;
|
||||
(function (BinTrieFlags) {
|
||||
BinTrieFlags[BinTrieFlags["HAS_VALUE"] = 32768] = "HAS_VALUE";
|
||||
BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 32512] = "BRANCH_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["MULTI_BYTE"] = 128] = "MULTI_BYTE";
|
||||
BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
||||
})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {}));
|
||||
exports.JUMP_OFFSET_BASE = 48 /* ZERO */ - 1;
|
||||
function getDecoder(decodeTree) {
|
||||
return function decodeHTMLBinary(str, strict) {
|
||||
var ret = "";
|
||||
var lastIdx = 0;
|
||||
var strIdx = 0;
|
||||
while ((strIdx = str.indexOf("&", strIdx)) >= 0) {
|
||||
ret += str.slice(lastIdx, strIdx);
|
||||
lastIdx = strIdx;
|
||||
// Skip the "&"
|
||||
strIdx += 1;
|
||||
// If we have a numeric entity, handle this separately.
|
||||
if (str.charCodeAt(strIdx) === 35 /* NUM */) {
|
||||
// Skip the leading "&#". For hex entities, also skip the leading "x".
|
||||
var start = strIdx + 1;
|
||||
var base = 10;
|
||||
var cp = str.charCodeAt(start);
|
||||
if ((cp | 32 /* To_LOWER_BIT */) === 120 /* LOWER_X */) {
|
||||
base = 16;
|
||||
strIdx += 1;
|
||||
start += 1;
|
||||
}
|
||||
while (((cp = str.charCodeAt(++strIdx)) >= 48 /* ZERO */ &&
|
||||
cp <= 57 /* NINE */) ||
|
||||
(base === 16 &&
|
||||
(cp | 32 /* To_LOWER_BIT */) >= 97 /* LOWER_A */ &&
|
||||
(cp | 32 /* To_LOWER_BIT */) <= 102 /* LOWER_F */))
|
||||
;
|
||||
if (start !== strIdx) {
|
||||
var entity = str.substring(start, strIdx);
|
||||
var parsed = parseInt(entity, base);
|
||||
if (str.charCodeAt(strIdx) === 59 /* SEMI */) {
|
||||
strIdx += 1;
|
||||
}
|
||||
else if (strict) {
|
||||
continue;
|
||||
}
|
||||
ret += decode_codepoint_1.default(parsed);
|
||||
lastIdx = strIdx;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
var result = null;
|
||||
var excess = 1;
|
||||
var treeIdx = 0;
|
||||
var current = decodeTree[treeIdx];
|
||||
for (; strIdx < str.length; strIdx++, excess++) {
|
||||
treeIdx = determineBranch(decodeTree, current, treeIdx + 1, str.charCodeAt(strIdx));
|
||||
if (treeIdx < 0)
|
||||
break;
|
||||
current = decodeTree[treeIdx];
|
||||
// If the branch is a value, store it and continue
|
||||
if (current & BinTrieFlags.HAS_VALUE) {
|
||||
// If we have a legacy entity while parsing strictly, just skip the number of bytes
|
||||
if (strict && str.charCodeAt(strIdx) !== 59 /* SEMI */) {
|
||||
// No need to consider multi-byte values, as the legacy entity is always a single byte
|
||||
treeIdx += 1;
|
||||
}
|
||||
else {
|
||||
// If this is a surrogate pair, combine the higher bits from the node with the next byte
|
||||
result =
|
||||
current & BinTrieFlags.MULTI_BYTE
|
||||
? String.fromCharCode(decodeTree[++treeIdx], decodeTree[++treeIdx])
|
||||
: String.fromCharCode(decodeTree[++treeIdx]);
|
||||
excess = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result != null) {
|
||||
ret += result;
|
||||
lastIdx = strIdx - excess + 1;
|
||||
}
|
||||
}
|
||||
return ret + str.slice(lastIdx);
|
||||
};
|
||||
}
|
||||
function determineBranch(decodeTree, current, nodeIdx, char) {
|
||||
if (current <= 128) {
|
||||
return char === current ? nodeIdx : -1;
|
||||
}
|
||||
var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 8;
|
||||
if (branchCount === 0) {
|
||||
return -1;
|
||||
}
|
||||
if (branchCount === 1) {
|
||||
return char === decodeTree[nodeIdx] ? nodeIdx + 1 : -1;
|
||||
}
|
||||
var jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
||||
if (jumpOffset) {
|
||||
var value = char - exports.JUMP_OFFSET_BASE - jumpOffset;
|
||||
return value < 0 || value > branchCount
|
||||
? -1
|
||||
: decodeTree[nodeIdx + value] - 1;
|
||||
}
|
||||
// Binary search for the character.
|
||||
var lo = nodeIdx;
|
||||
var hi = lo + branchCount - 1;
|
||||
while (lo <= hi) {
|
||||
var mid = (lo + hi) >>> 1;
|
||||
var midVal = decodeTree[mid];
|
||||
if (midVal < char) {
|
||||
lo = mid + 1;
|
||||
}
|
||||
else if (midVal > char) {
|
||||
hi = mid - 1;
|
||||
}
|
||||
else {
|
||||
return decodeTree[mid + branchCount];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
exports.determineBranch = determineBranch;
|
||||
var htmlDecoder = getDecoder(decode_data_html_1.default);
|
||||
var xmlDecoder = getDecoder(decode_data_xml_1.default);
|
||||
function decodeHTML(str) {
|
||||
return htmlDecoder(str, false);
|
||||
}
|
||||
exports.decodeHTML = decodeHTML;
|
||||
function decodeHTMLStrict(str) {
|
||||
return htmlDecoder(str, true);
|
||||
}
|
||||
exports.decodeHTMLStrict = decodeHTMLStrict;
|
||||
function decodeXML(str) {
|
||||
return xmlDecoder(str, true);
|
||||
}
|
||||
exports.decodeXML = decodeXML;
|
||||
2
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
2
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export default function decodeCodePoint(codePoint: number): string;
|
||||
//# sourceMappingURL=decode_codepoint.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"","sources":["../src/decode_codepoint.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMjE"}
|
||||
54
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
54
node_modules/hexo-deployer-git/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var decodeMap = new Map([
|
||||
[0, 65533],
|
||||
[128, 8364],
|
||||
[130, 8218],
|
||||
[131, 402],
|
||||
[132, 8222],
|
||||
[133, 8230],
|
||||
[134, 8224],
|
||||
[135, 8225],
|
||||
[136, 710],
|
||||
[137, 8240],
|
||||
[138, 352],
|
||||
[139, 8249],
|
||||
[140, 338],
|
||||
[142, 381],
|
||||
[145, 8216],
|
||||
[146, 8217],
|
||||
[147, 8220],
|
||||
[148, 8221],
|
||||
[149, 8226],
|
||||
[150, 8211],
|
||||
[151, 8212],
|
||||
[152, 732],
|
||||
[153, 8482],
|
||||
[154, 353],
|
||||
[155, 8250],
|
||||
[156, 339],
|
||||
[158, 382],
|
||||
[159, 376],
|
||||
]);
|
||||
var fromCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
||||
String.fromCodePoint ||
|
||||
function (codePoint) {
|
||||
var output = "";
|
||||
if (codePoint > 0xffff) {
|
||||
codePoint -= 0x10000;
|
||||
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
||||
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
||||
}
|
||||
output += String.fromCharCode(codePoint);
|
||||
return output;
|
||||
};
|
||||
function decodeCodePoint(codePoint) {
|
||||
var _a;
|
||||
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
||||
return "\uFFFD";
|
||||
}
|
||||
return fromCodePoint((_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint);
|
||||
}
|
||||
exports.default = decodeCodePoint;
|
||||
8
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.d.ts
generated
vendored
Normal file
8
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export declare const getCodePoint: (str: string, index: number) => number;
|
||||
export declare function encodeHTMLTrieRe(regExp: RegExp, str: string): string;
|
||||
export interface TrieNode {
|
||||
value?: string;
|
||||
next?: Map<number, TrieNode>;
|
||||
}
|
||||
export declare function getTrie(map: Record<string, string>): Map<number, TrieNode>;
|
||||
//# sourceMappingURL=encode-trie.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"encode-trie.d.ts","sourceRoot":"","sources":["../src/encode-trie.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,QAGT,MAAM,SAAS,MAAM,KAAG,MAQD,CAAC;AAIxC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkCpE;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAChC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAmB1E"}
|
||||
77
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.js
generated
vendored
Normal file
77
node_modules/hexo-deployer-git/node_modules/entities/lib/encode-trie.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getTrie = exports.encodeHTMLTrieRe = exports.getCodePoint = void 0;
|
||||
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||
function isHighSurrugate(c) {
|
||||
return (c & 64512 /* Mask */) === 55296 /* High */;
|
||||
}
|
||||
// For compatibility with node < 4, we wrap `codePointAt`
|
||||
exports.getCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
String.prototype.codePointAt != null
|
||||
? function (str, index) { return str.codePointAt(index); }
|
||||
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
function (c, index) {
|
||||
return isHighSurrugate(c.charCodeAt(index))
|
||||
? (c.charCodeAt(index) - 55296 /* High */) * 0x400 +
|
||||
c.charCodeAt(index + 1) -
|
||||
0xdc00 +
|
||||
0x10000
|
||||
: c.charCodeAt(index);
|
||||
};
|
||||
var htmlTrie = getTrie(entities_json_1.default);
|
||||
function encodeHTMLTrieRe(regExp, str) {
|
||||
var _a;
|
||||
var ret = "";
|
||||
var lastIdx = 0;
|
||||
var match;
|
||||
while ((match = regExp.exec(str)) !== null) {
|
||||
var i = match.index;
|
||||
var char = str.charCodeAt(i);
|
||||
var next = htmlTrie.get(char);
|
||||
if (next) {
|
||||
if (next.next != null && i + 1 < str.length) {
|
||||
var value = (_a = next.next.get(str.charCodeAt(i + 1))) === null || _a === void 0 ? void 0 : _a.value;
|
||||
if (value != null) {
|
||||
ret += str.substring(lastIdx, i) + value;
|
||||
regExp.lastIndex += 1;
|
||||
lastIdx = i + 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ret += str.substring(lastIdx, i) + next.value;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
ret += str.substring(lastIdx, i) + "&#x" + exports.getCodePoint(str, i).toString(16) + ";";
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = regExp.lastIndex += Number(isHighSurrugate(char));
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
exports.encodeHTMLTrieRe = encodeHTMLTrieRe;
|
||||
function getTrie(map) {
|
||||
var _a, _b, _c, _d;
|
||||
var trie = new Map();
|
||||
for (var _i = 0, _e = Object.keys(map); _i < _e.length; _i++) {
|
||||
var value = _e[_i];
|
||||
var key = map[value];
|
||||
// Resolve the key
|
||||
var lastMap = trie;
|
||||
for (var i = 0; i < key.length - 1; i++) {
|
||||
var char = key.charCodeAt(i);
|
||||
var next = (_a = lastMap.get(char)) !== null && _a !== void 0 ? _a : {};
|
||||
lastMap.set(char, next);
|
||||
lastMap = (_b = next.next) !== null && _b !== void 0 ? _b : (next.next = new Map());
|
||||
}
|
||||
var val = (_c = lastMap.get(key.charCodeAt(key.length - 1))) !== null && _c !== void 0 ? _c : {};
|
||||
(_d = val.value) !== null && _d !== void 0 ? _d : (val.value = "&" + value + ";");
|
||||
lastMap.set(key.charCodeAt(key.length - 1), val);
|
||||
}
|
||||
return trie;
|
||||
}
|
||||
exports.getTrie = getTrie;
|
||||
46
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
46
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeXML(str: string): string;
|
||||
/**
|
||||
* Encodes all entities and non-ASCII characters in the input.
|
||||
*
|
||||
* This includes characters that are valid ASCII characters in HTML documents.
|
||||
* For example `#` will be encoded as `#`. To get a more compact output,
|
||||
* consider using the `encodeNonAsciiHTML` function.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeHTML(data: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeNonAsciiHTML(data: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escape: typeof encodeXML;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare function escapeUTF8(data: string): string;
|
||||
//# sourceMappingURL=encode.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0B7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAoCD;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,kBAAY,CAAC;AAEhC;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB/C"}
|
||||
126
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.js
generated
vendored
Normal file
126
node_modules/hexo-deployer-git/node_modules/entities/lib/encode.js
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;
|
||||
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
||||
var encode_trie_1 = require("./encode-trie");
|
||||
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||
var htmlReplacer = getCharRegExp(entities_json_1.default, true);
|
||||
var xmlReplacer = getCharRegExp(xml_json_1.default, true);
|
||||
var xmlInvalidChars = getCharRegExp(xml_json_1.default, false);
|
||||
var xmlCodeMap = new Map(Object.keys(xml_json_1.default).map(function (k) { return [
|
||||
xml_json_1.default[k].charCodeAt(0),
|
||||
"&" + k + ";",
|
||||
]; }));
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeXML(str) {
|
||||
var ret = "";
|
||||
var lastIdx = 0;
|
||||
var match;
|
||||
while ((match = xmlReplacer.exec(str)) !== null) {
|
||||
var i = match.index;
|
||||
var char = str.charCodeAt(i);
|
||||
var next = xmlCodeMap.get(char);
|
||||
if (next) {
|
||||
ret += str.substring(lastIdx, i) + next;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
ret += str.substring(lastIdx, i) + "&#x" + encode_trie_1.getCodePoint(str, i).toString(16) + ";";
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = xmlReplacer.lastIndex += Number((char & 65408) === 0xd800);
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
exports.encodeXML = encodeXML;
|
||||
/**
|
||||
* Encodes all entities and non-ASCII characters in the input.
|
||||
*
|
||||
* This includes characters that are valid ASCII characters in HTML documents.
|
||||
* For example `#` will be encoded as `#`. To get a more compact output,
|
||||
* consider using the `encodeNonAsciiHTML` function.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeHTML(data) {
|
||||
return encode_trie_1.encodeHTMLTrieRe(htmlReplacer, data);
|
||||
}
|
||||
exports.encodeHTML = encodeHTML;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeNonAsciiHTML(data) {
|
||||
return encode_trie_1.encodeHTMLTrieRe(xmlReplacer, data);
|
||||
}
|
||||
exports.encodeNonAsciiHTML = encodeNonAsciiHTML;
|
||||
function getCharRegExp(map, nonAscii) {
|
||||
// Collect the start characters of all entities
|
||||
var chars = Object.keys(map)
|
||||
.map(function (k) { return "\\" + map[k].charAt(0); })
|
||||
.filter(function (v) { return !nonAscii || v.charCodeAt(1) < 128; })
|
||||
.sort(function (a, b) { return a.charCodeAt(1) - b.charCodeAt(1); })
|
||||
// Remove duplicates
|
||||
.filter(function (v, i, a) { return v !== a[i + 1]; });
|
||||
// Add ranges to single characters.
|
||||
for (var start = 0; start < chars.length - 1; start++) {
|
||||
// Find the end of a run of characters
|
||||
var end = start;
|
||||
while (end < chars.length - 1 &&
|
||||
chars[end].charCodeAt(1) + 1 === chars[end + 1].charCodeAt(1)) {
|
||||
end += 1;
|
||||
}
|
||||
var count = 1 + end - start;
|
||||
// We want to replace at least three characters
|
||||
if (count < 3)
|
||||
continue;
|
||||
chars.splice(start, count, chars[start] + "-" + chars[end]);
|
||||
}
|
||||
return new RegExp("[" + chars.join("") + (nonAscii ? "\\x80-\\uFFFF" : "") + "]", "g");
|
||||
}
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
exports.escape = encodeXML;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
function escapeUTF8(data) {
|
||||
var match;
|
||||
var lastIdx = 0;
|
||||
var result = "";
|
||||
while ((match = xmlInvalidChars.exec(data))) {
|
||||
if (lastIdx !== match.index) {
|
||||
result += data.substring(lastIdx, match.index);
|
||||
}
|
||||
// We know that this chararcter will be in `inverseXML`
|
||||
result += xmlCodeMap.get(match[0].charCodeAt(0));
|
||||
// Every match will be of length 1
|
||||
lastIdx = match.index + 1;
|
||||
}
|
||||
return result + data.substring(lastIdx);
|
||||
}
|
||||
exports.escapeUTF8 = escapeUTF8;
|
||||
3
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.d.ts
generated
vendored
Normal file
3
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-html.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode-data-html.d.ts","sourceRoot":"","sources":["../../src/generated/decode-data-html.ts"],"names":[],"mappings":";AAEA,wBAAox9E"}
|
||||
5
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.js
generated
vendored
Normal file
5
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.d.ts
generated
vendored
Normal file
3
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-xml.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"","sources":["../../src/generated/decode-data-xml.ts"],"names":[],"mappings":";AAEA,wBAA4K"}
|
||||
5
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.js
generated
vendored
Normal file
5
node_modules/hexo-deployer-git/node_modules/entities/lib/generated/decode-data-xml.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Generated using scripts/write-decode-map.ts
|
||||
// prettier-ignore
|
||||
exports.default = new Uint16Array([1024, 97, 103, 108, 113, 9, 23, 27, 31, 1086, 15, 0, 0, 19, 112, 59, 32768, 38, 111, 115, 59, 32768, 39, 116, 59, 32768, 62, 116, 59, 32768, 60, 117, 111, 116, 59, 32768, 34]);
|
||||
91
node_modules/hexo-deployer-git/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
91
node_modules/hexo-deployer-git/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
/** The level of entities to support. */
|
||||
export declare enum EntityLevel {
|
||||
/** Support only XML entities. */
|
||||
XML = 0,
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
HTML = 1
|
||||
}
|
||||
/** Determines whether some entities are allowed to be written without a trailing `;`. */
|
||||
export declare enum DecodingMode {
|
||||
/** Support legacy HTML entities. */
|
||||
Legacy = 0,
|
||||
/** Do not support legacy HTML entities. */
|
||||
Strict = 1
|
||||
}
|
||||
export declare enum EncodingMode {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* HTML will be escaped.
|
||||
*/
|
||||
UTF8 = 0,
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
ASCII = 1,
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
Extensive = 2
|
||||
}
|
||||
interface DecodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default EntityLevel.XML
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Decoding mode. If `Legacy`, will support legacy entities not terminated
|
||||
* with a semicolon (`;`).
|
||||
*
|
||||
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
|
||||
* an attribute value.
|
||||
*
|
||||
* The deprecated `decodeStrict` function defaults this to `Strict`.
|
||||
*
|
||||
* @default DecodingMode.Legacy
|
||||
*/
|
||||
mode?: DecodingMode;
|
||||
}
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Options for `encode`.
|
||||
*/
|
||||
export interface EncodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default EntityLevel.XML
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Output format.
|
||||
* @default EncodingMode.Extensive
|
||||
*/
|
||||
mode?: EncodingMode;
|
||||
}
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string;
|
||||
export { encodeXML, encodeHTML, encodeNonAsciiHTML, escape, escapeUTF8, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode";
|
||||
export { decodeXML, decodeHTML, decodeHTMLStrict, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,yFAAyF;AACzF,oBAAY,YAAY;IACpB,oCAAoC;IACpC,MAAM,IAAI;IACV,2CAA2C;IAC3C,MAAM,IAAI;CACb;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI,IAAA;IACJ;;;;OAIG;IACH,KAAK,IAAA;IACL;;;OAGG;IACH,SAAS,IAAA;CACZ;AAED,UAAU,eAAe;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAWR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAWR;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAgBR;AAED,OAAO,EACH,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,UAAU,EAEV,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EACH,SAAS,EACT,UAAU,EACV,gBAAgB,EAEhB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,UAAU,CAAC"}
|
||||
118
node_modules/hexo-deployer-git/node_modules/entities/lib/index.js
generated
vendored
Normal file
118
node_modules/hexo-deployer-git/node_modules/entities/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.DecodingMode = exports.EntityLevel = void 0;
|
||||
var decode_1 = require("./decode");
|
||||
var encode_1 = require("./encode");
|
||||
/** The level of entities to support. */
|
||||
var EntityLevel;
|
||||
(function (EntityLevel) {
|
||||
/** Support only XML entities. */
|
||||
EntityLevel[EntityLevel["XML"] = 0] = "XML";
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
|
||||
})(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {}));
|
||||
/** Determines whether some entities are allowed to be written without a trailing `;`. */
|
||||
var DecodingMode;
|
||||
(function (DecodingMode) {
|
||||
/** Support legacy HTML entities. */
|
||||
DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
|
||||
/** Do not support legacy HTML entities. */
|
||||
DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
|
||||
})(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {}));
|
||||
var EncodingMode;
|
||||
(function (EncodingMode) {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* HTML will be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
|
||||
})(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {}));
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
function decode(data, options) {
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var opts = typeof options === "number" ? { level: options } : options;
|
||||
if (opts.level === EntityLevel.HTML) {
|
||||
if (opts.mode === DecodingMode.Strict) {
|
||||
return decode_1.decodeHTMLStrict(data);
|
||||
}
|
||||
return decode_1.decodeHTML(data);
|
||||
}
|
||||
return decode_1.decodeXML(data);
|
||||
}
|
||||
exports.decode = decode;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
function decodeStrict(data, options) {
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var opts = typeof options === "number" ? { level: options } : options;
|
||||
if (opts.level === EntityLevel.HTML) {
|
||||
if (opts.mode === DecodingMode.Legacy) {
|
||||
return decode_1.decodeHTML(data);
|
||||
}
|
||||
return decode_1.decodeHTMLStrict(data);
|
||||
}
|
||||
return decode_1.decodeXML(data);
|
||||
}
|
||||
exports.decodeStrict = decodeStrict;
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
function encode(data, options) {
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var opts = typeof options === "number" ? { level: options } : options;
|
||||
// Mode `UTF8` just escapes XML entities
|
||||
if (opts.mode === EncodingMode.UTF8)
|
||||
return encode_1.escapeUTF8(data);
|
||||
if (opts.level === EntityLevel.HTML) {
|
||||
if (opts.mode === EncodingMode.ASCII) {
|
||||
return encode_1.encodeNonAsciiHTML(data);
|
||||
}
|
||||
return encode_1.encodeHTML(data);
|
||||
}
|
||||
// ASCII and Extensive are equivalent
|
||||
return encode_1.encodeXML(data);
|
||||
}
|
||||
exports.encode = encode;
|
||||
var encode_2 = require("./encode");
|
||||
Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return encode_2.encodeXML; } });
|
||||
Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } });
|
||||
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return encode_2.escape; } });
|
||||
Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return encode_2.escapeUTF8; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_2.encodeHTML; } });
|
||||
var decode_2 = require("./decode");
|
||||
Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
||||
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_2.decodeXML; } });
|
||||
1
node_modules/hexo-deployer-git/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/hexo-deployer-git/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
1
node_modules/hexo-deployer-git/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\"","QUOT":"\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user