mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
env-to-object: fix 2nd argument
Official README is wrong.
This commit is contained in:
parent
6435478e4d
commit
0a4823399e
@ -26,8 +26,10 @@ const map = {
|
||||
|
||||
const result1:any = envToObject(map);
|
||||
const result2:any = envToObject(map, {
|
||||
'my-custom-type': (str: string, opts: any) => {
|
||||
let foo: any = JSON.parse(str);
|
||||
return foo;
|
||||
parsers: {
|
||||
'my-custom-type': (str: string, opts: any) => {
|
||||
let foo: any = JSON.parse(str);
|
||||
return foo;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
6
env-to-object/index.d.ts
vendored
6
env-to-object/index.d.ts
vendored
@ -29,7 +29,11 @@ declare namespace env {
|
||||
export interface Parsers {
|
||||
[parserName: string]: (str: string, opts: any) => any;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
parsers: Parsers;
|
||||
}
|
||||
}
|
||||
|
||||
declare function env(map: env.Mappings, parsers?: env.Parsers): any;
|
||||
declare function env(map: env.Mappings, options?: env.Options): any;
|
||||
export = env;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user