mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 04:10:04 +02:00
update packages to latest version
This commit is contained in:
2
node_modules/tr46/LICENSE.md
generated
vendored
2
node_modules/tr46/LICENSE.md
generated
vendored
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Sebastian Mayr
|
||||
Copyright (c) Sebastian Mayr
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
38
node_modules/tr46/README.md
generated
vendored
38
node_modules/tr46/README.md
generated
vendored
@@ -2,17 +2,16 @@
|
||||
|
||||
An JavaScript implementation of [Unicode Technical Standard #46: Unicode IDNA Compatibility Processing](https://unicode.org/reports/tr46/).
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
[Node.js](http://nodejs.org) ≥ 8 is required. To install, type this at the command line:
|
||||
[Node.js](http://nodejs.org) ≥ 12 is required. To install, type this at the command line:
|
||||
|
||||
```shell
|
||||
npm install tr46
|
||||
# or
|
||||
yarn add tr46
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### `toASCII(domainName[, options])`
|
||||
@@ -20,6 +19,7 @@ yarn add tr46
|
||||
Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols.
|
||||
|
||||
Available options:
|
||||
|
||||
* [`checkBidi`](#checkBidi)
|
||||
* [`checkHyphens`](#checkHyphens)
|
||||
* [`checkJoiners`](#checkJoiners)
|
||||
@@ -32,41 +32,47 @@ Available options:
|
||||
Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols.
|
||||
|
||||
Available options:
|
||||
|
||||
* [`checkBidi`](#checkBidi)
|
||||
* [`checkHyphens`](#checkHyphens)
|
||||
* [`checkJoiners`](#checkJoiners)
|
||||
* [`processingOption`](#processingOption)
|
||||
* [`useSTD3ASCIIRules`](#useSTD3ASCIIRules)
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
### `checkBidi`
|
||||
Type: `Boolean`
|
||||
Default value: `false`
|
||||
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
When set to `true`, any bi-directional text within the input will be checked for validation.
|
||||
|
||||
### `checkHyphens`
|
||||
Type: `Boolean`
|
||||
Default value: `false`
|
||||
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
When set to `true`, the positions of any hyphen characters within the input will be checked for validation.
|
||||
|
||||
### `checkJoiners`
|
||||
Type: `Boolean`
|
||||
Default value: `false`
|
||||
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
When set to `true`, any word joiner characters within the input will be checked for validation.
|
||||
|
||||
### `processingOption`
|
||||
Type: `String`
|
||||
Default value: `"nontransitional"`
|
||||
|
||||
Type: `string`
|
||||
Default value: `"nontransitional"`
|
||||
When set to `"transitional"`, symbols within the input will be validated according to the older IDNA2003 protocol. When set to `"nontransitional"`, the current IDNA2008 protocol will be used.
|
||||
|
||||
### `useSTD3ASCIIRules`
|
||||
Type: `Boolean`
|
||||
Default value: `false`
|
||||
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules).
|
||||
|
||||
### `verifyDNSLength`
|
||||
Type: `Boolean`
|
||||
Default value: `false`
|
||||
|
||||
Type: `boolean`
|
||||
Default value: `false`
|
||||
When set to `true`, the length of each DNS label within the input will be checked for validation.
|
||||
|
9
node_modules/tr46/index.js
generated
vendored
9
node_modules/tr46/index.js
generated
vendored
@@ -6,7 +6,7 @@ const mappingTable = require("./lib/mappingTable.json");
|
||||
const { STATUS_MAPPING } = require("./lib/statusMapping.js");
|
||||
|
||||
function containsNonASCII(str) {
|
||||
return /[^\x00-\x7F]/.test(str);
|
||||
return /[^\x00-\x7F]/u.test(str);
|
||||
}
|
||||
|
||||
function findStatus(val, { useSTD3ASCIIRules }) {
|
||||
@@ -204,10 +204,11 @@ function processing(domainName, options) {
|
||||
if (error) {
|
||||
continue;
|
||||
}
|
||||
const validation = validateLabel(label, Object.assign({}, options, {
|
||||
const validation = validateLabel(label, {
|
||||
...options,
|
||||
processingOption: curProcessing,
|
||||
checkBidi: options.checkBidi && isBidi
|
||||
}));
|
||||
});
|
||||
if (!validation) {
|
||||
error = true;
|
||||
}
|
||||
@@ -242,7 +243,7 @@ function toASCII(domainName, {
|
||||
labels = labels.map(l => {
|
||||
if (containsNonASCII(l)) {
|
||||
try {
|
||||
return "xn--" + punycode.encode(l);
|
||||
return `xn--${punycode.encode(l)}`;
|
||||
} catch (e) {
|
||||
result.error = true;
|
||||
}
|
||||
|
2
node_modules/tr46/lib/mappingTable.json
generated
vendored
2
node_modules/tr46/lib/mappingTable.json
generated
vendored
File diff suppressed because one or more lines are too long
18
node_modules/tr46/lib/regexes.js
generated
vendored
18
node_modules/tr46/lib/regexes.js
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/tr46/lib/statusMapping.js
generated
vendored
4
node_modules/tr46/lib/statusMapping.js
generated
vendored
@@ -4,8 +4,8 @@ module.exports.STATUS_MAPPING = {
|
||||
mapped: 1,
|
||||
valid: 2,
|
||||
disallowed: 3,
|
||||
disallowed_STD3_valid: 4, // eslint-disable-line camelcase
|
||||
disallowed_STD3_mapped: 5, // eslint-disable-line camelcase
|
||||
disallowed_STD3_valid: 4,
|
||||
disallowed_STD3_mapped: 5,
|
||||
deviation: 6,
|
||||
ignored: 7
|
||||
};
|
||||
|
35
node_modules/tr46/package.json
generated
vendored
35
node_modules/tr46/package.json
generated
vendored
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"_from": "tr46@^2.1.0",
|
||||
"_id": "tr46@2.1.0",
|
||||
"_from": "tr46@^3.0.0",
|
||||
"_id": "tr46@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
|
||||
"_integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",
|
||||
"_location": "/tr46",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "tr46@^2.1.0",
|
||||
"raw": "tr46@^3.0.0",
|
||||
"name": "tr46",
|
||||
"escapedName": "tr46",
|
||||
"rawSpec": "^2.1.0",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.1.0"
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/whatwg-url"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
|
||||
"_shasum": "fa87aa81ca5d5941da8cbf1f9b749dc969a4e240",
|
||||
"_spec": "tr46@^2.1.0",
|
||||
"_resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz",
|
||||
"_shasum": "555c4e297a950617e8eeddef633c87d4d9d6cbf9",
|
||||
"_spec": "tr46@^3.0.0",
|
||||
"_where": "D:\\Projects\\minifyfromhtml\\node_modules\\whatwg-url",
|
||||
"author": {
|
||||
"name": "Sebastian Mayr",
|
||||
@@ -42,14 +42,15 @@
|
||||
"deprecated": false,
|
||||
"description": "An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing",
|
||||
"devDependencies": {
|
||||
"eslint": "^7.27.0",
|
||||
"mocha": "^8.4.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"regenerate": "^1.4.2",
|
||||
"unicode-13.0.0": "^0.8.0"
|
||||
"@domenic/eslint-config": "^1.4.0",
|
||||
"@unicode/unicode-14.0.0": "^1.2.1",
|
||||
"eslint": "^7.32.0",
|
||||
"minipass-fetch": "^1.4.1",
|
||||
"mocha": "^9.1.1",
|
||||
"regenerate": "^1.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=12"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
@@ -79,6 +80,6 @@
|
||||
"pretest": "node scripts/getLatestTests.js",
|
||||
"test": "mocha"
|
||||
},
|
||||
"unicodeVersion": "13.0.0",
|
||||
"version": "2.1.0"
|
||||
"unicodeVersion": "14.0.0",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user