From 50a79584cb12129b3db1ef3e0eb9d0c8b9f20b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 30 May 2019 14:59:30 +0200 Subject: chore: Implement strict mode (denoland/deno_std#453) Original: https://github.com/denoland/deno_std/commit/be24677d15494e83eea2e99bfc5ccfdde31cb892 --- encoding/csv.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'encoding/csv.ts') diff --git a/encoding/csv.ts b/encoding/csv.ts index 191961ace..aa2ceb1cf 100644 --- a/encoding/csv.ts +++ b/encoding/csv.ts @@ -28,7 +28,7 @@ export interface ParseOptions { function chkOptions(opt: ParseOptions): void { if ( INVALID_RUNE.includes(opt.comma) || - INVALID_RUNE.includes(opt.comment) || + (opt.comment && INVALID_RUNE.includes(opt.comment)) || opt.comma === opt.comment ) { throw new Error("Invalid Delimiter"); @@ -130,7 +130,7 @@ export async function readAll( } if (lineResult.length > 0) { - if (_nbFields && _nbFields !== lineResult.length) { + if (_nbFields! && _nbFields! !== lineResult.length) { throw new ParseError(lineIndex, lineIndex, "wrong number of fields"); } result.push(lineResult); -- cgit v1.2.3