mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Fix eslint warnings (#2151)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: LE GOFF Vincent <g_n_s@hotmail.fr>
This commit is contained in:
parent
6cded14bdf
commit
9dfebbc949
75 changed files with 1110 additions and 931 deletions
|
@ -289,18 +289,24 @@ for (const key of Object.keys(encodingMap)) {
|
|||
// A map of functions that return new instances of a decoder indexed by the
|
||||
// encoding type.
|
||||
const decoders = new Map<string, (options: DecoderOptions) => Decoder>();
|
||||
decoders.set("utf-8", (options: DecoderOptions) => {
|
||||
return new UTF8Decoder(options);
|
||||
});
|
||||
decoders.set(
|
||||
"utf-8",
|
||||
(options: DecoderOptions): UTF8Decoder => {
|
||||
return new UTF8Decoder(options);
|
||||
}
|
||||
);
|
||||
|
||||
// Single byte decoders are an array of code point lookups
|
||||
const encodingIndexes = new Map<string, number[]>();
|
||||
// prettier-ignore
|
||||
encodingIndexes.set("windows-1252", [8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]);
|
||||
for (const [key, index] of encodingIndexes) {
|
||||
decoders.set(key, (options: DecoderOptions) => {
|
||||
return new SingleByteDecoder(index, options);
|
||||
});
|
||||
decoders.set(
|
||||
key,
|
||||
(options: DecoderOptions): SingleByteDecoder => {
|
||||
return new SingleByteDecoder(index, options);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function codePointsToString(codePoints: number[]): string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue