Update Bot

This commit is contained in:
2026-03-15 11:58:43 +01:00
parent b67c111ffc
commit cd99275933
560 changed files with 23173 additions and 55113 deletions

View File

@@ -1,52 +1,48 @@
"use strict";
"use strict"
var BOMChar = '\uFEFF';
var BOMChar = "\uFEFF"
exports.PrependBOM = PrependBOMWrapper
function PrependBOMWrapper(encoder, options) {
this.encoder = encoder;
this.addBOM = true;
function PrependBOMWrapper (encoder, options) {
this.encoder = encoder
this.addBOM = true
}
PrependBOMWrapper.prototype.write = function(str) {
if (this.addBOM) {
str = BOMChar + str;
this.addBOM = false;
}
PrependBOMWrapper.prototype.write = function (str) {
if (this.addBOM) {
str = BOMChar + str
this.addBOM = false
}
return this.encoder.write(str);
return this.encoder.write(str)
}
PrependBOMWrapper.prototype.end = function() {
return this.encoder.end();
PrependBOMWrapper.prototype.end = function () {
return this.encoder.end()
}
// ------------------------------------------------------------------------------
//------------------------------------------------------------------------------
exports.StripBOM = StripBOMWrapper;
function StripBOMWrapper(decoder, options) {
this.decoder = decoder;
this.pass = false;
this.options = options || {};
exports.StripBOM = StripBOMWrapper
function StripBOMWrapper (decoder, options) {
this.decoder = decoder
this.pass = false
this.options = options || {}
}
StripBOMWrapper.prototype.write = function(buf) {
var res = this.decoder.write(buf);
if (this.pass || !res)
return res;
StripBOMWrapper.prototype.write = function (buf) {
var res = this.decoder.write(buf)
if (this.pass || !res) { return res }
if (res[0] === BOMChar) {
res = res.slice(1);
if (typeof this.options.stripBOM === 'function')
this.options.stripBOM();
}
if (res[0] === BOMChar) {
res = res.slice(1)
if (typeof this.options.stripBOM === "function") { this.options.stripBOM() }
}
this.pass = true;
return res;
this.pass = true
return res
}
StripBOMWrapper.prototype.end = function() {
return this.decoder.end();
StripBOMWrapper.prototype.end = function () {
return this.decoder.end()
}

View File

@@ -6,15 +6,22 @@
*--------------------------------------------------------------------------------------------*/
declare module 'iconv-lite' {
export function decode(buffer: Buffer, encoding: string, options?: Options): string;
// Basic API
export function decode(buffer: Buffer | Uint8Array, encoding: string, options?: Options): string;
export function encode(content: string, encoding: string, options?: Options): Buffer;
export function encodingExists(encoding: string): boolean;
// Stream API
export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
// Low-level stream APIs
export function getEncoder(encoding: string, options?: Options): EncoderStream;
export function getDecoder(encoding: string, options?: Options): DecoderStream;
}
export interface Options {
@@ -22,3 +29,13 @@ export interface Options {
addBOM?: boolean;
defaultEncoding?: string;
}
export interface EncoderStream {
write(str: string): Buffer;
end(): Buffer | undefined;
}
export interface DecoderStream {
write(buf: Buffer): string;
end(): string | undefined;
}

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

@@ -1,153 +1,183 @@
"use strict";
"use strict"
// Some environments don't have global Buffer (e.g. React Native).
// Solution would be installing npm modules "buffer" and "stream" explicitly.
var Buffer = require("safer-buffer").Buffer;
var Buffer = require("safer-buffer").Buffer
var bomHandling = require("./bom-handling"),
iconv = module.exports;
var bomHandling = require("./bom-handling")
var mergeModules = require("./helpers/merge-exports")
var iconv = module.exports
// All codecs and aliases are kept here, keyed by encoding name/alias.
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
iconv.encodings = null;
// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true
iconv.encodings = null
// Characters emitted in case of error.
iconv.defaultCharUnicode = '<27>';
iconv.defaultCharSingleByte = '?';
iconv.defaultCharUnicode = "<22>"
iconv.defaultCharSingleByte = "?"
// Public API.
iconv.encode = function encode(str, encoding, options) {
str = "" + (str || ""); // Ensure string.
iconv.encode = function encode (str, encoding, options) {
str = "" + (str || "") // Ensure string.
var encoder = iconv.getEncoder(encoding, options);
var encoder = iconv.getEncoder(encoding, options)
var res = encoder.write(str);
var trail = encoder.end();
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
var res = encoder.write(str)
var trail = encoder.end()
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res
}
iconv.decode = function decode(buf, encoding, options) {
if (typeof buf === 'string') {
if (!iconv.skipDecodeWarning) {
console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
iconv.skipDecodeWarning = true;
}
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
iconv.decode = function decode (buf, encoding, options) {
if (typeof buf === "string") {
if (!iconv.skipDecodeWarning) {
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding")
iconv.skipDecodeWarning = true
}
var decoder = iconv.getDecoder(encoding, options);
buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer.
}
var res = decoder.write(buf);
var trail = decoder.end();
var decoder = iconv.getDecoder(encoding, options)
return trail ? (res + trail) : res;
var res = decoder.write(buf)
var trail = decoder.end()
return trail ? (res + trail) : res
}
iconv.encodingExists = function encodingExists(enc) {
try {
iconv.getCodec(enc);
return true;
} catch (e) {
return false;
}
iconv.encodingExists = function encodingExists (enc) {
try {
iconv.getCodec(enc)
return true
} catch (e) {
return false
}
}
// Legacy aliases to convert functions
iconv.toEncoding = iconv.encode;
iconv.fromEncoding = iconv.decode;
iconv.toEncoding = iconv.encode
iconv.fromEncoding = iconv.decode
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
iconv._codecDataCache = {};
iconv.getCodec = function getCodec(encoding) {
if (!iconv.encodings)
iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
var enc = iconv._canonicalizeEncoding(encoding);
iconv._codecDataCache = { __proto__: null }
// Traverse iconv.encodings to find actual codec.
var codecOptions = {};
while (true) {
var codec = iconv._codecDataCache[enc];
if (codec)
return codec;
iconv.getCodec = function getCodec (encoding) {
if (!iconv.encodings) {
var raw = require("../encodings")
// TODO: In future versions when old nodejs support is removed can use object.assign
iconv.encodings = { __proto__: null } // Initialize as empty object.
mergeModules(iconv.encodings, raw)
}
var codecDef = iconv.encodings[enc];
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
var enc = iconv._canonicalizeEncoding(encoding)
switch (typeof codecDef) {
case "string": // Direct alias to other encoding.
enc = codecDef;
break;
// Traverse iconv.encodings to find actual codec.
var codecOptions = {}
while (true) {
var codec = iconv._codecDataCache[enc]
case "object": // Alias with options. Can be layered.
for (var key in codecDef)
codecOptions[key] = codecDef[key];
if (codec) { return codec }
if (!codecOptions.encodingName)
codecOptions.encodingName = enc;
enc = codecDef.type;
break;
var codecDef = iconv.encodings[enc]
case "function": // Codec itself.
if (!codecOptions.encodingName)
codecOptions.encodingName = enc;
switch (typeof codecDef) {
case "string": // Direct alias to other encoding.
enc = codecDef
break
// The codec function must load all tables and return object with .encoder and .decoder methods.
// It'll be called only once (for each different options object).
codec = new codecDef(codecOptions, iconv);
case "object": // Alias with options. Can be layered.
for (var key in codecDef) { codecOptions[key] = codecDef[key] }
iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
return codec;
if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
default:
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
}
enc = codecDef.type
break
case "function": // Codec itself.
if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
// The codec function must load all tables and return object with .encoder and .decoder methods.
// It'll be called only once (for each different options object).
//
codec = new codecDef(codecOptions, iconv)
iconv._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later.
return codec
default:
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')")
}
}
}
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._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);
iconv.getEncoder = function getEncoder (encoding, options) {
var codec = iconv.getCodec(encoding)
var encoder = new codec.encoder(options, codec)
if (codec.bomAware && options && options.addBOM)
encoder = new bomHandling.PrependBOM(encoder, options);
if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) }
return encoder;
return encoder
}
iconv.getDecoder = function getDecoder(encoding, options) {
var codec = iconv.getCodec(encoding),
decoder = new codec.decoder(options, codec);
iconv.getDecoder = function getDecoder (encoding, options) {
var codec = iconv.getCodec(encoding)
var decoder = new codec.decoder(options, codec)
if (codec.bomAware && !(options && options.stripBOM === false))
decoder = new bomHandling.StripBOM(decoder, options);
if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) }
return decoder;
return decoder
}
// Streaming API
// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add
// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
// If you would like to enable it explicitly, please add the following code to your app:
// > iconv.enableStreamingAPI(require('stream'));
iconv.enableStreamingAPI = function enableStreamingAPI (streamModule) {
if (iconv.supportsStreams) { return }
// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
if (nodeVer) {
// Dependency-inject stream module to create IconvLite stream classes.
var streams = require("./streams")(streamModule)
// Load streaming support in Node v0.10+
var nodeVerArr = nodeVer.split(".").map(Number);
if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
require("./streams")(iconv);
}
// Not public API yet, but expose the stream classes.
iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream
iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream
// Load Node primitive extensions.
require("./extend-node")(iconv);
// Streaming API.
iconv.encodeStream = function encodeStream (encoding, options) {
return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options)
}
iconv.decodeStream = function decodeStream (encoding, options) {
return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options)
}
iconv.supportsStreams = true
}
if ("Ā" != "\u0100") {
console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
var streamModule
try {
streamModule = require("stream")
} catch (e) {}
if (streamModule && streamModule.Transform) {
iconv.enableStreamingAPI(streamModule)
} else {
// In rare cases where 'stream' module is not available by default, throw a helpful exception.
iconv.encodeStream = iconv.decodeStream = function () {
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")
}
}
// Some environments, such as browsers, may not load JavaScript files as UTF-8
// eslint-disable-next-line no-constant-condition
if ("Ā" !== "\u0100") {
console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.")
}

View File

@@ -1,121 +1,105 @@
"use strict";
"use strict"
var Buffer = require("buffer").Buffer,
Transform = require("stream").Transform;
var Buffer = require("safer-buffer").Buffer
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
// we opt to dependency-inject it instead of creating a hard dependency.
module.exports = function (streamModule) {
var Transform = streamModule.Transform
// == Exports ==================================================================
module.exports = function(iconv) {
// Additional Public API.
iconv.encodeStream = function encodeStream(encoding, options) {
return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
}
// == Encoder stream =======================================================
iconv.decodeStream = function decodeStream(encoding, options) {
return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
}
function IconvLiteEncoderStream (conv, options) {
this.conv = conv
options = options || {}
options.decodeStrings = false // We accept only strings, so we don't need to decode them.
Transform.call(this, options)
}
iconv.supportsStreams = true;
// Not published yet.
iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;
iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;
iconv._collect = IconvLiteDecoderStream.prototype.collect;
};
// == Encoder stream =======================================================
function IconvLiteEncoderStream(conv, options) {
this.conv = conv;
options = options || {};
options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
Transform.call(this, options);
}
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
constructor: { value: IconvLiteEncoderStream }
});
})
IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) {
if (typeof chunk !== "string") {
return done(new Error("Iconv encoding stream needs strings as its input."))
}
IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
if (typeof chunk != 'string')
return done(new Error("Iconv encoding stream needs strings as its input."));
try {
var res = this.conv.write(chunk);
if (res && res.length) this.push(res);
done();
var res = this.conv.write(chunk)
if (res && res.length) this.push(res)
done()
} catch (e) {
done(e)
}
catch (e) {
done(e);
}
}
}
IconvLiteEncoderStream.prototype._flush = function(done) {
IconvLiteEncoderStream.prototype._flush = function (done) {
try {
var res = this.conv.end();
if (res && res.length) this.push(res);
done();
var res = this.conv.end()
if (res && res.length) this.push(res)
done()
} catch (e) {
done(e)
}
catch (e) {
done(e);
}
}
}
IconvLiteEncoderStream.prototype.collect = function(cb) {
var chunks = [];
this.on('error', cb);
this.on('data', function(chunk) { chunks.push(chunk); });
this.on('end', function() {
cb(null, Buffer.concat(chunks));
});
return this;
}
IconvLiteEncoderStream.prototype.collect = function (cb) {
var chunks = []
this.on("error", cb)
this.on("data", function (chunk) { chunks.push(chunk) })
this.on("end", function () {
cb(null, Buffer.concat(chunks))
})
return this
}
// == Decoder stream =======================================================
// == Decoder stream =======================================================
function IconvLiteDecoderStream(conv, options) {
this.conv = conv;
options = options || {};
options.encoding = this.encoding = 'utf8'; // We output strings.
Transform.call(this, options);
}
function IconvLiteDecoderStream (conv, options) {
this.conv = conv
options = options || {}
options.encoding = this.encoding = "utf8" // We output strings.
Transform.call(this, options)
}
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
constructor: { value: IconvLiteDecoderStream }
});
})
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
if (!Buffer.isBuffer(chunk))
return done(new Error("Iconv decoding stream needs buffers as its input."));
IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) {
if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) }
try {
var res = this.conv.write(chunk);
if (res && res.length) this.push(res, this.encoding);
done();
var res = this.conv.write(chunk)
if (res && res.length) this.push(res, this.encoding)
done()
} catch (e) {
done(e)
}
catch (e) {
done(e);
}
}
}
IconvLiteDecoderStream.prototype._flush = function(done) {
IconvLiteDecoderStream.prototype._flush = function (done) {
try {
var res = this.conv.end();
if (res && res.length) this.push(res, this.encoding);
done();
var res = this.conv.end()
if (res && res.length) this.push(res, this.encoding)
done()
} catch (e) {
done(e)
}
catch (e) {
done(e);
}
}
}
IconvLiteDecoderStream.prototype.collect = function(cb) {
var res = '';
this.on('error', cb);
this.on('data', function(chunk) { res += chunk; });
this.on('end', function() {
cb(null, res);
});
return this;
}
IconvLiteDecoderStream.prototype.collect = function (cb) {
var res = ""
this.on("error", cb)
this.on("data", function (chunk) { res += chunk })
this.on("end", function () {
cb(null, res)
})
return this
}
return {
IconvLiteEncoderStream: IconvLiteEncoderStream,
IconvLiteDecoderStream: IconvLiteDecoderStream
}
}