1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-02 12:00:03 +02:00

update node modules

This commit is contained in:
s2
2019-03-29 15:56:41 +01:00
parent f114871153
commit 89c32fb4e6
8347 changed files with 390123 additions and 159877 deletions

6
node_modules/iconv-lite/.npmignore generated vendored
View File

@@ -1,6 +0,0 @@
*~
*sublime-*
generation
test
wiki
coverage

23
node_modules/iconv-lite/.travis.yml generated vendored
View File

@@ -1,23 +0,0 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.11"
- "0.12"
- "iojs"
- "4"
- "6"
- "8"
- "node"
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8

28
node_modules/iconv-lite/Changelog.md generated vendored
View File

@@ -1,3 +1,31 @@
# 0.4.24 / 2018-08-22
* Added MIK encoding (#196, by @Ivan-Kalatchev)
# 0.4.23 / 2018-05-07
* Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann)
* Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn)
# 0.4.22 / 2018-05-05
* Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson)
* Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson)
# 0.4.21 / 2018-04-06
* Fix encoding canonicalization (#156)
* Fix the paths in the "browser" field in package.json (#174 by @LMLB)
* Removed "contributors" section in package.json - see Git history instead.
# 0.4.20 / 2018-04-06
* Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)
# 0.4.19 / 2017-09-09

6
node_modules/iconv-lite/README.md generated vendored
View File

@@ -20,7 +20,7 @@
var iconv = require('iconv-lite');
// Convert from an encoded buffer to js string.
str = iconv.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
// Convert from js string to an encoded buffer.
buf = iconv.encode("Sample input string", 'win1251');
@@ -154,7 +154,3 @@ $ # To view test coverage:
$ npm run coverage
$ open coverage/lcov-report/index.html
```
## Adoption
[![NPM](https://nodei.co/npm-dl/iconv-lite.png)](https://nodei.co/npm/iconv-lite/)
[![Codeship Status for ashtuchkin/iconv-lite](https://www.codeship.com/projects/81670840-fa72-0131-4520-4a01a6c01acc/status)](https://www.codeship.com/projects/29053)

View File

@@ -1,5 +1,5 @@
"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
@@ -281,7 +281,7 @@ function DBCSEncoder(options, codec) {
}
DBCSEncoder.prototype.write = function(str) {
var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)),
var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
leadSurrogate = this.leadSurrogate,
seqObj = this.seqObj, nextChar = -1,
i = 0, j = 0;
@@ -404,7 +404,7 @@ DBCSEncoder.prototype.end = function() {
if (this.leadSurrogate === -1 && this.seqObj === undefined)
return; // All clean. Most often case.
var newBuf = new Buffer(10), j = 0;
var newBuf = Buffer.alloc(10), j = 0;
if (this.seqObj) { // We're in the sequence.
var dbcsCode = this.seqObj[DEF_CHAR];
@@ -440,7 +440,7 @@ DBCSEncoder.prototype.findIdx = findIdx;
function DBCSDecoder(options, codec) {
// Decoder state
this.nodeIdx = 0;
this.prevBuf = new Buffer(0);
this.prevBuf = Buffer.alloc(0);
// Static data
this.decodeTables = codec.decodeTables;
@@ -450,7 +450,7 @@ function DBCSDecoder(options, codec) {
}
DBCSDecoder.prototype.write = function(buf) {
var newBuf = new Buffer(buf.length*2),
var newBuf = Buffer.alloc(buf.length*2),
nodeIdx = this.nodeIdx,
prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
@@ -527,7 +527,7 @@ DBCSDecoder.prototype.end = function() {
var buf = this.prevBuf.slice(1);
// Parse remaining as usual.
this.prevBuf = new Buffer(0);
this.prevBuf = Buffer.alloc(0);
this.nodeIdx = 0;
if (buf.length > 0)
ret += this.write(buf);

View File

@@ -1,5 +1,5 @@
"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
// Export Node.js internal encodings.
@@ -33,7 +33,7 @@ function InternalCodec(codecOptions, iconv) {
this.encoder = InternalEncoderCesu8;
// Add decoder for versions of Node not supporting CESU-8
if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') {
if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
this.decoder = InternalDecoderCesu8;
this.defaultCharUnicode = iconv.defaultCharUnicode;
}
@@ -67,7 +67,7 @@ function InternalEncoder(options, codec) {
}
InternalEncoder.prototype.write = function(str) {
return new Buffer(str, this.enc);
return Buffer.from(str, this.enc);
}
InternalEncoder.prototype.end = function() {
@@ -87,11 +87,11 @@ InternalEncoderBase64.prototype.write = function(str) {
this.prevStr = str.slice(completeQuads);
str = str.slice(0, completeQuads);
return new Buffer(str, "base64");
return Buffer.from(str, "base64");
}
InternalEncoderBase64.prototype.end = function() {
return new Buffer(this.prevStr, "base64");
return Buffer.from(this.prevStr, "base64");
}
@@ -102,7 +102,7 @@ function InternalEncoderCesu8(options, codec) {
}
InternalEncoderCesu8.prototype.write = function(str) {
var buf = new Buffer(str.length * 3), bufIdx = 0;
var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
for (var i = 0; i < str.length; i++) {
var charCode = str.charCodeAt(i);
// Naive implementation, but it works because CESU-8 is especially easy

View File

@@ -1,5 +1,5 @@
"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
// correspond to encoded bytes (if 128 - then lower half is ASCII).
@@ -20,11 +20,10 @@ function SBCSCodec(codecOptions, iconv) {
codecOptions.chars = asciiString + codecOptions.chars;
}
this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2');
this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
// Encoding buffer.
var encodeBuf = new Buffer(65536);
encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0));
var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
for (var i = 0; i < codecOptions.chars.length; i++)
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
@@ -41,7 +40,7 @@ function SBCSEncoder(options, codec) {
}
SBCSEncoder.prototype.write = function(str) {
var buf = new Buffer(str.length);
var buf = Buffer.alloc(str.length);
for (var i = 0; i < str.length; i++)
buf[i] = this.encodeBuf[str.charCodeAt(i)];
@@ -59,7 +58,7 @@ function SBCSDecoder(options, codec) {
SBCSDecoder.prototype.write = function(buf) {
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
var decodeBuf = this.decodeBuf;
var newBuf = new Buffer(buf.length*2);
var newBuf = Buffer.alloc(buf.length*2);
var idx1 = 0, idx2 = 0;
for (var i = 0; i < buf.length; i++) {
idx1 = buf[i]*2; idx2 = i*2;

View File

@@ -17,6 +17,11 @@ module.exports = {
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
},
"mik": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
// Aliases of generated encodings.
"ascii8bit": "ascii",
"usascii": "ascii",

View File

@@ -1,5 +1,5 @@
"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
@@ -20,7 +20,7 @@ function Utf16BEEncoder() {
}
Utf16BEEncoder.prototype.write = function(str) {
var buf = new Buffer(str, 'ucs2');
var buf = Buffer.from(str, 'ucs2');
for (var i = 0; i < buf.length; i += 2) {
var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
}
@@ -41,7 +41,7 @@ Utf16BEDecoder.prototype.write = function(buf) {
if (buf.length == 0)
return '';
var buf2 = new Buffer(buf.length + 1),
var buf2 = Buffer.alloc(buf.length + 1),
i = 0, j = 0;
if (this.overflowByte !== -1) {

View File

@@ -1,5 +1,5 @@
"use strict";
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
@@ -26,7 +26,7 @@ function Utf7Encoder(options, codec) {
Utf7Encoder.prototype.write = function(str) {
// Naive implementation.
// Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
return new Buffer(str.replace(nonDirectChars, function(chunk) {
return Buffer.from(str.replace(nonDirectChars, function(chunk) {
return "+" + (chunk === '+' ? '' :
this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
+ "-";
@@ -75,7 +75,7 @@ Utf7Decoder.prototype.write = function(buf) {
res += "+";
} else {
var b64str = base64Accum + buf.slice(lastI, i).toString();
res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be");
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
}
if (buf[i] != minusChar) // Minus is absorbed after base64.
@@ -97,7 +97,7 @@ Utf7Decoder.prototype.write = function(buf) {
base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
b64str = b64str.slice(0, canBeDecoded);
res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be");
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
}
this.inBase64 = inBase64;
@@ -109,7 +109,7 @@ Utf7Decoder.prototype.write = function(buf) {
Utf7Decoder.prototype.end = function() {
var res = "";
if (this.inBase64 && this.base64Accum.length > 0)
res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be");
res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
this.inBase64 = false;
this.base64Accum = '';
@@ -144,7 +144,7 @@ Utf7IMAPCodec.prototype.bomAware = true;
function Utf7IMAPEncoder(options, codec) {
this.iconv = codec.iconv;
this.inBase64 = false;
this.base64Accum = new Buffer(6);
this.base64Accum = Buffer.alloc(6);
this.base64AccumIdx = 0;
}
@@ -152,7 +152,7 @@ Utf7IMAPEncoder.prototype.write = function(str) {
var inBase64 = this.inBase64,
base64Accum = this.base64Accum,
base64AccumIdx = this.base64AccumIdx,
buf = new Buffer(str.length*5 + 10), bufIdx = 0;
buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
for (var i = 0; i < str.length; i++) {
var uChar = str.charCodeAt(i);
@@ -198,7 +198,7 @@ Utf7IMAPEncoder.prototype.write = function(str) {
}
Utf7IMAPEncoder.prototype.end = function() {
var buf = new Buffer(10), bufIdx = 0;
var buf = Buffer.alloc(10), bufIdx = 0;
if (this.inBase64) {
if (this.base64AccumIdx > 0) {
bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
@@ -246,7 +246,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) {
res += "&";
} else {
var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');
res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be");
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
}
if (buf[i] != minusChar) // Minus may be absorbed after base64.
@@ -268,7 +268,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) {
base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
b64str = b64str.slice(0, canBeDecoded);
res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be");
res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
}
this.inBase64 = inBase64;
@@ -280,7 +280,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) {
Utf7IMAPDecoder.prototype.end = function() {
var res = "";
if (this.inBase64 && this.base64Accum.length > 0)
res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be");
res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
this.inBase64 = false;
this.base64Accum = '';

View File

@@ -1,5 +1,6 @@
"use strict";
var Buffer = require("buffer").Buffer;
// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
// == Extend Node primitives to use iconv-lite =================================
@@ -8,7 +9,8 @@ module.exports = function (iconv) {
// Node authors rewrote Buffer internals to make it compatible with
// Uint8Array and we cannot patch key functions since then.
iconv.supportsNodeEncodingsExtension = !(new Buffer(0) instanceof Uint8Array);
// Note: this does use older Buffer API on a purpose
iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
iconv.extendNodeEncodings = function extendNodeEncodings() {
if (original) return;

View File

@@ -6,9 +6,9 @@
*--------------------------------------------------------------------------------------------*/
declare module 'iconv-lite' {
export function decode(buffer: NodeBuffer, encoding: string, options?: Options): string;
export function decode(buffer: Buffer, encoding: string, options?: Options): string;
export function encode(content: string, encoding: string, options?: Options): NodeBuffer;
export function encode(content: string, encoding: string, options?: Options): Buffer;
export function encodingExists(encoding: string): boolean;

11
node_modules/iconv-lite/lib/index.js generated vendored
View File

@@ -2,7 +2,7 @@
// Some environments don't have global Buffer (e.g. React Native).
// Solution would be installing npm modules "buffer" and "stream" explicitly.
var Buffer = require("buffer").Buffer;
var Buffer = require("safer-buffer").Buffer;
var bomHandling = require("./bom-handling"),
iconv = module.exports;
@@ -34,7 +34,7 @@ iconv.decode = function decode(buf, encoding, options) {
iconv.skipDecodeWarning = true;
}
buf = new Buffer("" + (buf || ""), "binary"); // Ensure buffer.
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
}
var decoder = iconv.getDecoder(encoding, options);
@@ -65,7 +65,7 @@ iconv.getCodec = function getCodec(encoding) {
iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
var enc = (''+encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, "");
var enc = iconv._canonicalizeEncoding(encoding);
// Traverse iconv.encodings to find actual codec.
var codecOptions = {};
@@ -108,6 +108,11 @@ iconv.getCodec = function getCodec(encoding) {
}
}
iconv._canonicalizeEncoding = function(encoding) {
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
}
iconv.getEncoder = function getEncoder(encoding, options) {
var codec = iconv.getCodec(encoding),
encoder = new codec.encoder(options, codec);

83
node_modules/iconv-lite/package.json generated vendored
View File

@@ -1,89 +1,42 @@
{
"_from": "iconv-lite@0.4.19",
"_id": "iconv-lite@0.4.19",
"_from": "iconv-lite@0.4.24",
"_id": "iconv-lite@0.4.24",
"_inBundle": false,
"_integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==",
"_integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"_location": "/iconv-lite",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "iconv-lite@0.4.19",
"raw": "iconv-lite@0.4.24",
"name": "iconv-lite",
"escapedName": "iconv-lite",
"rawSpec": "0.4.19",
"rawSpec": "0.4.24",
"saveSpec": null,
"fetchSpec": "0.4.19"
"fetchSpec": "0.4.24"
},
"_requiredBy": [
"/whatwg-encoding"
],
"_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"_shasum": "f7468f60135f5e5dad3399c0a81be9a1603a082b",
"_spec": "iconv-lite@0.4.19",
"_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/whatwg-encoding",
"_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"_shasum": "2022b4b25fbddc21d2f524974a474aafe733908b",
"_spec": "iconv-lite@0.4.24",
"_where": "E:\\projects\\p\\minifyfromhtml\\node_modules\\whatwg-encoding",
"author": {
"name": "Alexander Shtuchkin",
"email": "ashtuchkin@gmail.com"
},
"browser": {
"./extend-node": false,
"./streams": false
"./lib/extend-node": false,
"./lib/streams": false
},
"bugs": {
"url": "https://github.com/ashtuchkin/iconv-lite/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jinwu Zhan",
"url": "https://github.com/jenkinv"
},
{
"name": "Adamansky Anton",
"url": "https://github.com/adamansky"
},
{
"name": "George Stagas",
"url": "https://github.com/stagas"
},
{
"name": "Mike D Pilsbury",
"url": "https://github.com/pekim"
},
{
"name": "Niggler",
"url": "https://github.com/Niggler"
},
{
"name": "wychi",
"url": "https://github.com/wychi"
},
{
"name": "David Kuo",
"url": "https://github.com/david50407"
},
{
"name": "ChangZhuo Chen",
"url": "https://github.com/czchen"
},
{
"name": "Lee Treveil",
"url": "https://github.com/leetreveil"
},
{
"name": "Brian White",
"url": "https://github.com/mscdex"
},
{
"name": "Mithgol",
"url": "https://github.com/Mithgol"
},
{
"name": "Nazar Leush",
"url": "https://github.com/nleush"
}
],
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
"deprecated": false,
"description": "Convert character encodings in pure javascript.",
"devDependencies": {
@@ -91,8 +44,8 @@
"errto": "*",
"iconv": "*",
"istanbul": "*",
"mocha": "*",
"request": "*",
"mocha": "^3.1.0",
"request": "~2.87.0",
"semver": "*",
"unorm": "*"
},
@@ -119,5 +72,5 @@
"test": "mocha --reporter spec --grep ."
},
"typings": "./lib/index.d.ts",
"version": "0.4.19"
"version": "0.4.24"
}