mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
refactor: Cleanup options object parameters (#4296)
This commit is contained in:
parent
fbc4731256
commit
6443e4aed1
17 changed files with 110 additions and 164 deletions
|
@ -154,11 +154,14 @@ class SingleByteDecoder implements Decoder {
|
|||
private _index: number[];
|
||||
private _fatal: boolean;
|
||||
|
||||
constructor(index: number[], options: DecoderOptions) {
|
||||
if (options.ignoreBOM) {
|
||||
constructor(
|
||||
index: number[],
|
||||
{ ignoreBOM = false, fatal = false }: DecoderOptions = {}
|
||||
) {
|
||||
if (ignoreBOM) {
|
||||
throw new TypeError("Ignoring the BOM is available only with utf-8.");
|
||||
}
|
||||
this._fatal = options.fatal || false;
|
||||
this._fatal = fatal;
|
||||
this._index = index;
|
||||
}
|
||||
handler(stream: Stream, byte: number): number {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue