absxn / process-env-parser

Purpose-built utility to parse environment variables into safe runtime types in your TypeScript Node application
https://www.npmjs.com/package/@absxn/process-env-parser
17 stars 1 forks source link

Mask arguments cannot be currently inferred from default or parser options #4

Open teijo opened 4 years ago

teijo commented 4 years ago

Logically the arguments for the masking function are as documented in README:

mask?: boolean | ((value: Parser | string | Default) => string);

Currently the value will get inferred (not explicitly passing it as type argument) as any. It might be limitation of TypeScript (3.7.4 at the time of writing) to not be able to infer type from a sibling property (default: Default or parser: () => Parser).

Fix if / when possible.