Skip to content

Commit

Permalink
[Fix] parse: throw a TypeError instead of an Error for bad charset
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 14, 2020
1 parent 0889878 commit 233aed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Expand Up @@ -201,7 +201,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
}

if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
}
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;

Expand Down

0 comments on commit 233aed4

Please sign in to comment.