From 6cb74a6c8eb76fea14fc60852999ed473eded57e Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Tue, 4 Dec 2018 14:27:55 +0000 Subject: [PATCH] Travis build: 848 [cron] --- dist/_30s.es5.js | 4 ++-- dist/_30s.esm.js | 4 ++-- dist/_30s.js | 4 ++-- snippet_data/snippetList.json | 2 +- snippet_data/snippets.json | 8 ++++---- vscode_snippets/snippets.json | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js index 7c5e0ac36..0aa66112b 100644 --- a/dist/_30s.es5.js +++ b/dist/_30s.es5.js @@ -1274,9 +1274,9 @@ var isUpperCase = function isUpperCase(str) { return str === str.toUpperCase(); }; - var isValidJSON = function isValidJSON(obj) { + var isValidJSON = function isValidJSON(str) { try { - JSON.parse(obj); + JSON.parse(str); return true; } catch (e) { return false; diff --git a/dist/_30s.esm.js b/dist/_30s.esm.js index 6e5dd08d9..f2878c723 100644 --- a/dist/_30s.esm.js +++ b/dist/_30s.esm.js @@ -610,9 +610,9 @@ const isSymbol = val => typeof val === 'symbol'; const isTravisCI = () => 'TRAVIS' in process.env && 'CI' in process.env; const isUndefined = val => val === undefined; const isUpperCase = str => str === str.toUpperCase(); -const isValidJSON = obj => { +const isValidJSON = str => { try { - JSON.parse(obj); + JSON.parse(str); return true; } catch (e) { return false; diff --git a/dist/_30s.js b/dist/_30s.js index 9f9e2cb06..13c0ee32a 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -616,9 +616,9 @@ const isTravisCI = () => 'TRAVIS' in process.env && 'CI' in process.env; const isUndefined = val => val === undefined; const isUpperCase = str => str === str.toUpperCase(); - const isValidJSON = obj => { + const isValidJSON = str => { try { - JSON.parse(obj); + JSON.parse(str); return true; } catch (e) { return false; diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 70fd0b4a8..be7519591 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -2467,7 +2467,7 @@ "archived": false }, "meta": { - "hash": "b4417a972f391836241e88587797a8cd995f32ee71fbfcfe9e590c8fa8675558" + "hash": "9a304bb4dbaddc9c5e0cdc56606ee8286c891d6f82076e5742514f251b30a891" } }, { diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 8e54e9e57..fecef0ab3 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -3622,10 +3622,10 @@ "type": "snippet", "attributes": { "fileName": "isValidJSON.md", - "text": "Checks if the provided argument is a valid JSON.\n\nUse `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON.", + "text": "Checks if the provided string is a valid JSON.\n\nUse `JSON.parse()` and a `try... catch` block to check if the provided string is a valid JSON.", "codeBlocks": { - "es6": "const isValidJSON = obj => {\n try {\n JSON.parse(obj);\n return true;\n } catch (e) {\n return false;\n }\n};", - "es5": "var isValidJSON = function isValidJSON(obj) {\n try {\n JSON.parse(obj);\n return true;\n } catch (e) {\n return false;\n }\n};", + "es6": "const isValidJSON = str => {\n try {\n JSON.parse(str);\n return true;\n } catch (e) {\n return false;\n }\n};", + "es5": "var isValidJSON = function isValidJSON(str) {\n try {\n JSON.parse(str);\n return true;\n } catch (e) {\n return false;\n }\n};", "example": "isValidJSON('{\"name\":\"Adam\",\"age\":20}'); // true\nisValidJSON('{\"name\":\"Adam\",age:\"20\"}'); // false\nisValidJSON(null); // true" }, "tags": [ @@ -3636,7 +3636,7 @@ }, "meta": { "archived": false, - "hash": "b4417a972f391836241e88587797a8cd995f32ee71fbfcfe9e590c8fa8675558" + "hash": "9a304bb4dbaddc9c5e0cdc56606ee8286c891d6f82076e5742514f251b30a891" } }, { diff --git a/vscode_snippets/snippets.json b/vscode_snippets/snippets.json index 3f17c519f..014eaf89c 100644 --- a/vscode_snippets/snippets.json +++ b/vscode_snippets/snippets.json @@ -1578,16 +1578,16 @@ "isValidJSON": { "prefix": "30s_isValidJSON", "body": [ - "const isValidJSON = obj => {", + "const isValidJSON = str => {", " try {", - " JSON.parse(obj);", + " JSON.parse(str);", " return true;", " } catch (e) {", " return false;", " }", "};" ], - "description": "Checks if the provided argument is a valid JSON.\n\nUse `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON" + "description": "Checks if the provided string is a valid JSON.\n\nUse `JSON.parse()` and a `try... catch` block to check if the provided string is a valid JSON" }, "isWritableStream": { "prefix": "30s_isWritableStream",