Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
9
test/isValidJSON/isValidJSON.js
Normal file
9
test/isValidJSON/isValidJSON.js
Normal file
@ -0,0 +1,9 @@
|
||||
const isValidJSON = obj => {
|
||||
try {
|
||||
JSON.parse(obj);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
module.exports = isValidJSON;
|
||||
Reference in New Issue
Block a user