mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 04:10:04 +02:00
update node modules
This commit is contained in:
11
node_modules/iconv-lite/lib/index.js
generated
vendored
11
node_modules/iconv-lite/lib/index.js
generated
vendored
@@ -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);
|
||||
|
Reference in New Issue
Block a user