diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d537030..31228df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ 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) + +### Added + +- Added type definition for `decrypt` function + +### Changed + +- Fixed `{crypto: false}` in `packageJson.browser` + ## [16.1.0](https://github.com/motdotla/dotenv/compare/v16.0.3...v16.1.0) (2023-05-30) ### Added 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; 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"