mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
remove dotenv (#39164)
* remove dotenv * add missing dependencies * Add TS header
This commit is contained in:
parent
a2bceed52a
commit
46322caeb1
@ -756,6 +756,12 @@
|
||||
"sourceRepoURL": "https://github.com/sindresorhus/dot-prop",
|
||||
"asOfVersion": "5.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "dotenv",
|
||||
"typingsPackageName": "dotenv",
|
||||
"sourceRepoURL": "https://github.com/motdotla/dotenv",
|
||||
"asOfVersion": "8.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "dva",
|
||||
"typingsPackageName": "dva",
|
||||
|
||||
1
types/dotenv-safe/index.d.ts
vendored
1
types/dotenv-safe/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/rolodato/dotenv-safe
|
||||
// Definitions by: Stan Goldmann <https://github.com/krenor>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import env = require("dotenv")
|
||||
|
||||
|
||||
6
types/dotenv-safe/package.json
Normal file
6
types/dotenv-safe/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"dotenv": "^8.2.0"
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
import dotenv = require("dotenv");
|
||||
|
||||
const env = dotenv.config();
|
||||
const dbUrl: string | null = env.error || !env.parsed ? null : env.parsed["BASIC"];
|
||||
|
||||
dotenv.config({
|
||||
path: ".env-example",
|
||||
encoding: "utf8",
|
||||
debug: true
|
||||
});
|
||||
|
||||
const parsed = dotenv.parse("NODE_ENV=production\nDB_HOST=a.b.c");
|
||||
const dbHost: string = parsed["DB_HOST"];
|
||||
|
||||
const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n"), {
|
||||
debug: true
|
||||
});
|
||||
const justice: string = parsedFromBuffer["JUSTICE"];
|
||||
66
types/dotenv/index.d.ts
vendored
66
types/dotenv/index.d.ts
vendored
@ -1,66 +0,0 @@
|
||||
// Type definitions for dotenv 6.1
|
||||
// Project: https://github.com/motdotla/dotenv
|
||||
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula>
|
||||
// Borek Bernard <https://github.com/borekb>
|
||||
// Eric Naeseth <https://github.com/enaeseth>
|
||||
// Max Beatty <https://github.com/maxbeatty>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface DotenvParseOptions {
|
||||
/**
|
||||
* You may turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export interface DotenvParseOutput {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string or buffer in the .env file format into an object.
|
||||
*
|
||||
* @param src - contents to be parsed
|
||||
* @param options - additional options
|
||||
* @returns an object with keys and values based on `src`
|
||||
*/
|
||||
export function parse(
|
||||
src: string | Buffer,
|
||||
options?: DotenvParseOptions
|
||||
): DotenvParseOutput;
|
||||
|
||||
export interface DotenvConfigOptions {
|
||||
/**
|
||||
* You may specify a custom path if your file containing environment variables is located elsewhere.
|
||||
*/
|
||||
path?: string;
|
||||
|
||||
/**
|
||||
* You may specify the encoding of your file containing environment variables.
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* You may turn on logging to help debug why certain keys or values are not being set as you expect.
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export interface DotenvConfigOutput {
|
||||
error?: Error;
|
||||
parsed?: DotenvParseOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}.
|
||||
* Example: 'KEY=value' becomes { parsed: { KEY: 'value' } }
|
||||
*
|
||||
* @param options - controls behavior
|
||||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred
|
||||
*
|
||||
*/
|
||||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
|
||||
/** @deprecated since v7.0.0 Use config instead. */
|
||||
export const load: typeof config;
|
||||
@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dotenv-tests.ts"
|
||||
]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -1,26 +0,0 @@
|
||||
import dotenv = require('dotenv');
|
||||
|
||||
// typically, result will be an Object
|
||||
const env = dotenv.config({
|
||||
silent: true
|
||||
});
|
||||
const dbUrl: string | null = !env ? null : env['DATABASE_URL'];
|
||||
|
||||
// ... but it might also be `false`
|
||||
const result = dotenv.config({
|
||||
path: '.non-existing-env'
|
||||
});
|
||||
|
||||
dotenv.config({
|
||||
path: '.env'
|
||||
});
|
||||
|
||||
dotenv.config({
|
||||
encoding: 'utf8'
|
||||
});
|
||||
|
||||
const parsed = dotenv.parse("ENVIRONMENT=production\nDEBUG=no\n");
|
||||
const debug: string = parsed['DEBUG'];
|
||||
|
||||
const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n"));
|
||||
const justice: string = parsedFromBuffer['JUSTICE'];
|
||||
41
types/dotenv/v2/index.d.ts
vendored
41
types/dotenv/v2/index.d.ts
vendored
@ -1,41 +0,0 @@
|
||||
// Type definitions for dotenv 2.0
|
||||
// Project: https://github.com/motdotla/dotenv
|
||||
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula>, Borek Bernard <https://github.com/borekb>, Eric Naeseth <https://github.com/enaeseth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* Parses a string or buffer in the .env file format into an object.
|
||||
*/
|
||||
export function parse(src: string | Buffer): {[name: string]: string};
|
||||
|
||||
/**
|
||||
* Loads `.env` into `process.env`.
|
||||
*
|
||||
* @return Object Object with the parsed keys and values, e.g., 'KEY=value' becomes { KEY: 'value' }
|
||||
*/
|
||||
export function config(options?: DotenvOptions): {[name: string]: string} | false;
|
||||
|
||||
export interface DotenvOptions {
|
||||
/**
|
||||
* Dotenv outputs a warning to your console if missing a .env file. Suppress this warning using silent.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* You can specify a custom path if your file containing environment variables is named or located differently.
|
||||
*
|
||||
* @default '.env'
|
||||
*/
|
||||
path?: string;
|
||||
|
||||
/**
|
||||
* You may specify the encoding of your file containing environment variables using this option.
|
||||
*
|
||||
* @default 'utf8'
|
||||
*/
|
||||
encoding?: string;
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"dotenv": [
|
||||
"dotenv/v2"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dotenv-tests.ts"
|
||||
]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
6
types/oracledb/package.json
Normal file
6
types/oracledb/package.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"dotenv": "^8.2.0"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user