Skip to content

Commit

Permalink
fix: avoid optional chaining for node 12.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 7, 2022
1 parent 9f11df0 commit a4349ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function withDefaults (options?: RCOptions | string): RCOptions {
return { ...defaults, ...options }
}

export function parse (contents: string, options?: RCOptions): RC {
export function parse (contents: string, options: RCOptions = {}): RC {
const config: RC = {}

const lines = contents.split(RE_LINES)
Expand All @@ -56,7 +56,7 @@ export function parse (contents: string, options?: RCOptions): RC {
config[key] = val
}

return options?.flat ? config : flat.unflatten(config, { overwrite: true })
return options.flat ? config : flat.unflatten(config, { overwrite: true })
}

export function parseFile (path: string, options?: RCOptions): RC {
Expand Down

0 comments on commit a4349ab

Please sign in to comment.