Created
April 6, 2018 15:12
-
-
Save rnagy/df6c3f5016eec705794669d30a536088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/checks.coffee b/src/checks.coffee | |
index 792032c..e538a9b 100644 | |
--- a/src/checks.coffee | |
+++ b/src/checks.coffee | |
@@ -167,6 +167,10 @@ exports.json_array_format = (rules) -> | |
for r in rule | |
errmsg = "Arguments to #{i} in exec form must not contain single quotes on line #{r.line}" | |
for argument in r.arguments | |
+ try JSON.parse(argument) | |
+ catch e | |
+ return 'ok' | |
+ | |
# Check if we're dealing with Array notation | |
if argument.match /^\[.*\]/ | |
# Break the literal array into it's logical components | |
@@ -174,6 +178,7 @@ exports.json_array_format = (rules) -> | |
if not arg.trim().match /^(\[?(\s+)?\".*\"(\s+)?\]?)|(\[\])$/ | |
utils.log 'ERROR', errmsg | |
return 'failed' | |
+ | |
return 'ok' | |
# Ensure the exec form contains a balanced number of double quotes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment