File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 3131 node-version : [14.x, 16.x, 18.x]
3232 opa-version :
3333 - 0.30.2 # last version with ABI 1.1, 0.31.0+ has ABI 1.2
34- - 0.41 .0 # 0.35.0 is the first release with https://github.com/open-policy-agent/opa/pull/4055
34+ - 0.45 .0 # 0.35.0 is the first release with https://github.com/open-policy-agent/opa/pull/4055
3535
3636 steps :
3737 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change 11function isValidJSON ( str ) {
22 if ( typeof str !== "string" ) {
3- return ;
3+ return false ;
44 }
55 try {
66 JSON . parse ( str ) ;
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ function parse(str) {
3030}
3131
3232module . exports = {
33- // is_valid is expected to return nothing if input is invalid otherwise
34- // true/false for it being valid YAML.
35- "yaml.is_valid" : ( str ) => typeof str === "string" ? parse ( str ) . ok : undefined ,
33+ // is_valid is expected to return false if input is invalid; and true/false for it being valid YAML.
34+ "yaml.is_valid" : ( str ) => typeof str === "string" && parse ( str ) . ok ,
3635 "yaml.marshal" : ( data ) => yaml . stringify ( data ) ,
3736 "yaml.unmarshal" : ( str ) => parse ( str ) . result ,
3837} ;
You can’t perform that action at this time.
0 commit comments