From cb9a51a9ca46455fcdc5f6c93741acc1dfb4938d Mon Sep 17 00:00:00 2001 From: Scott Motte Date: Tue, 30 May 2023 09:58:25 -0700 Subject: [PATCH 1/2] Add crypto to browser false list --- CHANGELOG.md | 6 ++++++ package.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d537030..0332a9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. See [standa ## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.1.0...master) +## [16.1.1](https://github.com/motdotla/dotenv/compare/v16.1.0...v16.1.1) (2023-05-30) + +### Changed + +- Added `{crypto: false}` to `packageJson.browser` + ## [16.1.0](https://github.com/motdotla/dotenv/compare/v16.0.3...v16.1.0) (2023-05-30) ### Added diff --git a/package.json b/package.json index b39e0a9c..ad06b037 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "browser": { "fs": false, "path": false, - "os": false + "os": false, + "crypto": false }, "engines": { "node": ">=12" From 0d94e7181309042ebe71731f24fa8b97e73f481b Mon Sep 17 00:00:00 2001 From: Scott Motte Date: Tue, 30 May 2023 11:38:36 -0700 Subject: [PATCH 2/2] Add type definition for decrypt function --- CHANGELOG.md | 6 +++++- lib/main.d.ts | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0332a9aa..31228df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,13 @@ All notable changes to this project will be documented in this file. See [standa ## [16.1.1](https://github.com/motdotla/dotenv/compare/v16.1.0...v16.1.1) (2023-05-30) +### Added + +- Added type definition for `decrypt` function + ### Changed -- Added `{crypto: false}` to `packageJson.browser` +- Fixed `{crypto: false}` in `packageJson.browser` ## [16.1.0](https://github.com/motdotla/dotenv/compare/v16.0.3...v16.1.0) (2023-05-30) diff --git a/lib/main.d.ts b/lib/main.d.ts index 049909c1..35ca384f 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -105,10 +105,22 @@ export function config(options?: DotenvConfigOptions): DotenvConfigOutput; * * See https://docs.dotenv.org * - * @param target - the target JSON object - * @param source - the source JSON object + * @param processEnv - the target JSON object. in most cases use process.env but you can also pass your own JSON object + * @param parsed - the source JSON object * @param options - additional options. example: `{ debug: true, override: false }` * @returns {void} * */ -export function populate(target: DotenvPopulateInput, source: DotenvPopulateInput, options?: DotenvConfigOptions): DotenvPopulateOutput; +export function populate(processEnv: DotenvPopulateInput, parsed: DotenvPopulateInput, options?: DotenvConfigOptions): DotenvPopulateOutput; + +/** + * Decrypt ciphertext + * + * See https://docs.dotenv.org + * + * @param encrypted - the encrypted ciphertext string + * @param keyStr - the decryption key string + * @returns {string} + * + */ +export function decrypt(encrypted: string, keyStr: string): string;