We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
jsonString
1 parent e60ad00 commit 681f8b8Copy full SHA for 681f8b8
index.js
@@ -17,6 +17,10 @@ const isEscaped = (jsonString, quotePosition) => {
17
};
18
19
module.exports = (jsonString, options = {}) => {
20
+ if (typeof jsonString !== 'string') {
21
+ throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
22
+ }
23
+
24
const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
25
26
let insideString = false;
0 commit comments