Skip to content

Commit

Permalink
feat: pretty write config.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
liuweiGL committed Jul 21, 2021
1 parent 3e22e65 commit 0a556ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/plugin/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ export const deepMerge = (target: any, ...source: any[]) => {
return source.reduce((a, b) => mergeObj(a, b), target)
}

export const prettyLog = (obj?: Record<string, any>) => {
return obj ? JSON.stringify(obj, null, 2) : obj
export const prettyLog = (obj: Record<string, any>) => {
return JSON.stringify(obj, null, 2)
}
4 changes: 1 addition & 3 deletions packages/plugin/src/mkcert/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ class Config {
}

private async serialize() {
const str = JSON.stringify(this)

await writeFile(CONFIG_FILE_PATH, str)
await writeFile(CONFIG_FILE_PATH, prettyLog(this))
}

// deep merge
Expand Down

0 comments on commit 0a556ab

Please sign in to comment.