File tree 3 files changed +4
-5
lines changed
3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 31
31
node-version : [14.x, 16.x, 18.x]
32
32
opa-version :
33
33
- 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
35
35
36
36
steps :
37
37
- uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1
1
function isValidJSON ( str ) {
2
2
if ( typeof str !== "string" ) {
3
- return ;
3
+ return false ;
4
4
}
5
5
try {
6
6
JSON . parse ( str ) ;
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ function parse(str) {
30
30
}
31
31
32
32
module . 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 ,
36
35
"yaml.marshal" : ( data ) => yaml . stringify ( data ) ,
37
36
"yaml.unmarshal" : ( str ) => parse ( str ) . result ,
38
37
} ;
You can’t perform that action at this time.
0 commit comments