Skip to content

Commit

Permalink
Data is a Record<string, string> (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhl8 committed Jul 29, 2021
1 parent 6697314 commit 691c528
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Parse an envfile string */
export function parse<T>(src: string): T {
export function parse(src: string): Record<string, string> {
// Try parse envfile string
const result: { [key: string]: any } = {}
const result: { [key: string]: string } = {}
const lines = src.toString().split('\n')
for (const line of lines) {
const match = line.match(/^([^=:#]+?)[=:](.*)/)
Expand All @@ -11,7 +11,7 @@ export function parse<T>(src: string): T {
result[key] = value
}
}
return result as T
return result
}

/** Turn an object into an envfile string */
Expand Down

0 comments on commit 691c528

Please sign in to comment.