(string)
| 43 | } |
| 44 | |
| 45 | function escapeString(string) { |
| 46 | // Modified code, original code by Douglas Crockford |
| 47 | // Original: https://github.com/douglascrockford/JSON-js/blob/master/json2.js |
| 48 | |
| 49 | // If the string contains no control characters, no quote characters, and no |
| 50 | // backslash characters, then we can safely slap some quotes around it. |
| 51 | // Otherwise we must also replace the offending characters with safe escape |
| 52 | // sequences. |
| 53 | |
| 54 | return string.replace(rxEscapable, (a) => { |
| 55 | const c = meta[a]; |
| 56 | return typeof c === 'string' ? c : `\\u${a.charCodeAt(0).toString(16).padStart(4, '0')}`; |
| 57 | }); |
| 58 | } |
| 59 | |
| 60 | let primitiveToJSON: (value: any) => string; |
| 61 |
no outgoing calls
no test coverage detected
searching dependent graphs…