mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #52543 update(dotenv-parse-variables): v2 update by @peterblazejewicz
- new `ingoreFunctions` option - version bump - tests amended https://github.com/niftylettuce/dotenv-parse-variables/compare/v0.2.3...v2.0.0 Thanks!
This commit is contained in:
committed by
GitHub
parent
c38c576631
commit
2392033d97
@@ -1,9 +1,9 @@
|
||||
import dotenvParseVariables = require('dotenv-parse-variables');
|
||||
import dotenvParseVariables = require("dotenv-parse-variables");
|
||||
|
||||
dotenvParseVariables({ a: 'b' });
|
||||
dotenvParseVariables({ a: "b" });
|
||||
|
||||
dotenvParseVariables({ c: 'd', e: 'f' }, { assignToProcessEnv: true });
|
||||
dotenvParseVariables({ c: "d", e: "f" }, { assignToProcessEnv: true });
|
||||
|
||||
dotenvParseVariables({ g: 'h' }, { overrideProcessEnv: false });
|
||||
dotenvParseVariables({ g: "h" }, { overrideProcessEnv: false });
|
||||
|
||||
dotenvParseVariables({ i: 'j' }, { assignToProcessEnv: false, overrideProcessEnv: true });
|
||||
dotenvParseVariables({ i: "j" }, { assignToProcessEnv: false, overrideProcessEnv: true, ignoreFunctions: false });
|
||||
|
||||
16
types/dotenv-parse-variables/index.d.ts
vendored
16
types/dotenv-parse-variables/index.d.ts
vendored
@@ -1,15 +1,27 @@
|
||||
// Type definitions for dotenv-parse-variables 0.2
|
||||
// Type definitions for dotenv-parse-variables 2.0
|
||||
// Project: https://github.com/niftylettuce/dotenv-parse-variables
|
||||
// Definitions by: Gary King <https://github.com/garyking>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Minimum TypeScript Version: 3.0
|
||||
|
||||
declare namespace dotenvParseVariables {
|
||||
type Parsed = Record<string, string>;
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* whether or not to assign the parsed values to `process.env`
|
||||
* @default true
|
||||
*/
|
||||
assignToProcessEnv?: boolean;
|
||||
/**
|
||||
* whether or not to override existing values in `process.env`
|
||||
* @default false
|
||||
*/
|
||||
overrideProcessEnv?: boolean;
|
||||
/**
|
||||
* whether or not to ignore functions in the parsed values returned
|
||||
* @default true
|
||||
*/
|
||||
ignoreFunctions?: boolean;
|
||||
}
|
||||
|
||||
type ParsedVariables = Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user