(content)
| 44 | } |
| 45 | |
| 46 | export function stripBom(content) { |
| 47 | // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified |
| 48 | if (Buffer.isBuffer(content)) { |
| 49 | content = content.toString('utf8'); |
| 50 | } |
| 51 | return content.replace(/^\uFEFF/, ''); |
| 52 | } |
| 53 | |
| 54 | export function writeJsonSync(file, obj, options = {}) { |
| 55 | const str = stringify(obj, options); |
no test coverage detected