(json)
| 35 | exports.isJson = isJson; |
| 36 | |
| 37 | function isJson5(json) { |
| 38 | if (!json) { |
| 39 | return false; |
| 40 | } |
| 41 | try { |
| 42 | json = json5.parse(json); |
| 43 | return json; |
| 44 | } catch (e) { |
| 45 | return false; |
| 46 | } |
| 47 | } |
| 48 | exports.safeArray = function(arr) { |
| 49 | return Array.isArray(arr) ? arr : []; |
| 50 | }; |
no outgoing calls
no test coverage detected