(filepath: string, content: string | object, options: JSONStringifyOptions = {})
| 39 | } |
| 40 | |
| 41 | export async function writeJSON(filepath: string, content: string | object, options: JSONStringifyOptions = {}) { |
| 42 | options.space = options.space ?? 2; |
| 43 | if (typeof content === 'object') { |
| 44 | content = JSON.stringify(content, options.replacer, options.space) + '\n'; |
| 45 | } |
| 46 | await mkdir(dirname(filepath), { recursive: true }); |
| 47 | await writeFile(filepath, content, 'utf8'); |
| 48 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…