Total Complexity | 6 |
Complexity/F | 6 |
Lines of Code | 10 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | |||
5 | export default function printJson(obj, escapeString) { |
||
6 | if(typeof obj !== 'undefined' && obj !== null) { |
||
7 | return (typeof escapeString !== null && escapeString !== null && escapeString === 1) ? |
||
8 | escape(JSON.stringify(obj).replace(/'/g, '%27')) : |
||
9 | JSON.stringify(obj).replace(/'/g, '%27') |
||
10 | }else { |
||
11 | return '{}' |
||
12 | } |
||
13 | |||
14 | } |
||
15 |