summaryrefslogtreecommitdiff
path: root/cli/js/web/text_encoding.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/web/text_encoding.ts')
-rw-r--r--cli/js/web/text_encoding.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/js/web/text_encoding.ts b/cli/js/web/text_encoding.ts
index d225c6928..97848cb77 100644
--- a/cli/js/web/text_encoding.ts
+++ b/cli/js/web/text_encoding.ts
@@ -105,7 +105,7 @@ export function atob(s: string): string {
if (rem === 1 || /[^+/0-9A-Za-z]/.test(s)) {
throw new DOMException(
"The string to be decoded is not correctly encoded",
- "DataDecodeError"
+ "DataDecodeError",
);
}
@@ -129,7 +129,7 @@ export function btoa(s: string): string {
if (charCode > 0xff) {
throw new TypeError(
"The string to be encoded contains characters " +
- "outside of the Latin1 range."
+ "outside of the Latin1 range.",
);
}
byteArray.push(charCode);
@@ -157,7 +157,7 @@ class SingleByteDecoder implements Decoder {
constructor(
index: number[],
- { ignoreBOM = false, fatal = false }: DecoderOptions = {}
+ { ignoreBOM = false, fatal = false }: DecoderOptions = {},
) {
if (ignoreBOM) {
throw new TypeError("Ignoring the BOM is available only with utf-8.");
@@ -222,7 +222,7 @@ const decoders = new Map<string, (options: DecoderOptions) => Decoder>();
// Single byte decoders are an array of code point lookups
const encodingIndexes = new Map<string, number[]>();
-// prettier-ignore
+// deno-fmt-ignore
encodingIndexes.set("windows-1252", [
8364,
129,
@@ -358,7 +358,7 @@ for (const [key, index] of encodingIndexes) {
key,
(options: DecoderOptions): SingleByteDecoder => {
return new SingleByteDecoder(index, options);
- }
+ },
);
}
@@ -442,7 +442,7 @@ export class TextDecoder {
const encoding = encodings.get(label);
if (!encoding) {
throw new RangeError(
- `The encoding label provided ('${label}') is invalid.`
+ `The encoding label provided ('${label}') is invalid.`,
);
}
if (!decoders.has(encoding) && encoding !== "utf-8") {
@@ -453,7 +453,7 @@ export class TextDecoder {
decode(
input?: BufferSource,
- options: TextDecodeOptions = { stream: false }
+ options: TextDecodeOptions = { stream: false },
): string {
if (options.stream) {
throw new TypeError("Stream not supported.");