@cogs/config 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -8
- package/dist/cjs/correct-env.js +44 -0
- package/dist/cjs/dotenv-checkers.js +176 -0
- package/dist/cjs/dotenv-correlation.js +95 -0
- package/dist/cjs/dotenv-files.js +43 -0
- package/dist/cjs/dotenv-fixers.js +88 -0
- package/dist/cjs/dotenv-with-expand.js +123 -0
- package/dist/cjs/envs.js +93 -0
- package/dist/cjs/index.js +23 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/preload.js +18 -0
- package/dist/cjs/process-env.js +39 -0
- package/dist/cjs/redact.js +27 -0
- package/dist/cjs/utils.js +65 -0
- package/dist/cli-core.d.ts +72 -0
- package/dist/cli-core.d.ts.map +1 -0
- package/dist/cli-core.js +311 -0
- package/dist/cli-core.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +17 -0
- package/dist/cli.js.map +1 -0
- package/dist/correct-env.d.ts.map +1 -1
- package/dist/correct-env.js.map +1 -1
- package/dist/dotenv-checkers.d.ts +61 -11
- package/dist/dotenv-checkers.d.ts.map +1 -1
- package/dist/dotenv-checkers.js +87 -25
- package/dist/dotenv-checkers.js.map +1 -1
- package/dist/dotenv-correlation.d.ts +23 -0
- package/dist/dotenv-correlation.d.ts.map +1 -0
- package/dist/dotenv-correlation.js +92 -0
- package/dist/dotenv-correlation.js.map +1 -0
- package/dist/dotenv-files.d.ts +24 -0
- package/dist/dotenv-files.d.ts.map +1 -0
- package/dist/dotenv-files.js +40 -0
- package/dist/dotenv-files.js.map +1 -0
- package/dist/dotenv-fixers.d.ts.map +1 -1
- package/dist/dotenv-fixers.js +7 -7
- package/dist/dotenv-fixers.js.map +1 -1
- package/dist/dotenv-with-expand.d.ts +1 -1
- package/dist/dotenv-with-expand.d.ts.map +1 -1
- package/dist/dotenv-with-expand.js +5 -5
- package/dist/dotenv-with-expand.js.map +1 -1
- package/dist/envs.d.ts +9 -1
- package/dist/envs.d.ts.map +1 -1
- package/dist/envs.js +58 -31
- package/dist/envs.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/preload.js +3 -3
- package/dist/preload.js.map +1 -1
- package/dist/process-env.d.ts.map +1 -1
- package/dist/process-env.js.map +1 -1
- package/dist/redact.d.ts +18 -0
- package/dist/redact.d.ts.map +1 -0
- package/dist/redact.js +24 -0
- package/dist/redact.js.map +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/package.json +18 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv-checkers.js","sourceRoot":"","sources":["../src/dotenv-checkers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"dotenv-checkers.js","sourceRoot":"","sources":["../src/dotenv-checkers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAgBtD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE;IACrE,0EAA0E;IAC1E,sEAAsE;IACtE,uBAAuB;IACvB,MAAM,UAAU,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAA;IACjD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACzC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACnD,OAAO,CAAC,GAAG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,iBAAiB,GAAG;IAC/B,yBAAyB;IACzB,uBAAuB;IACvB,mBAAmB;CACpB,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,qBAAqB;IACrB,yBAAyB;IACzB,yBAAyB;CAC1B,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Correlates each key in a raw `.env` file's contents back to the value **as it
|
|
3
|
+
* literally appears in the file**, wrapping quotes intact.
|
|
4
|
+
*
|
|
5
|
+
* Why this module exists: `dotenv.parse` strips wrapping quotes at parse time
|
|
6
|
+
* (`dotenv-with-expand.ts:70`), so a checker fed a parsed value structurally
|
|
7
|
+
* cannot observe the quote-wrapping defect it exists to detect. The checkers
|
|
8
|
+
* need the pre-parse substring, and `dotenv` exports no line splitter to get it
|
|
9
|
+
* (its parser is a single module-private regex).
|
|
10
|
+
*
|
|
11
|
+
* Internal module — deliberately NOT re-exported from `index.ts`.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Map every key in `contents` to its raw pre-parse value.
|
|
15
|
+
*
|
|
16
|
+
* Duplicate keys resolve **last-match-wins**, matching `dotenv.parse`'s own
|
|
17
|
+
* behavior (verified: parsing `DUP=first\nDUP=second` returns `{DUP:'second'}`).
|
|
18
|
+
*
|
|
19
|
+
* @param contents - The raw text of a `.env` file.
|
|
20
|
+
* @returns Key → raw value, quotes intact. See {@link normalizeRawValue}.
|
|
21
|
+
*/
|
|
22
|
+
export declare const correlateRawValues: (contents: string) => Map<string, string>;
|
|
23
|
+
//# sourceMappingURL=dotenv-correlation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenv-correlation.d.ts","sourceRoot":"","sources":["../src/dotenv-correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA0DH;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAoBvE,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Correlates each key in a raw `.env` file's contents back to the value **as it
|
|
3
|
+
* literally appears in the file**, wrapping quotes intact.
|
|
4
|
+
*
|
|
5
|
+
* Why this module exists: `dotenv.parse` strips wrapping quotes at parse time
|
|
6
|
+
* (`dotenv-with-expand.ts:70`), so a checker fed a parsed value structurally
|
|
7
|
+
* cannot observe the quote-wrapping defect it exists to detect. The checkers
|
|
8
|
+
* need the pre-parse substring, and `dotenv` exports no line splitter to get it
|
|
9
|
+
* (its parser is a single module-private regex).
|
|
10
|
+
*
|
|
11
|
+
* Internal module — deliberately NOT re-exported from `index.ts`.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Vendored, version-pinned adaptation of `dotenv`'s `LINE` regex.
|
|
15
|
+
*
|
|
16
|
+
* Source: `node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js:8`
|
|
17
|
+
* as of `dotenv@16.6.1`. Copied byte-for-byte — the whole point is to split
|
|
18
|
+
* lines exactly the way `dotenv` itself does, so `parse()`'s keys and this
|
|
19
|
+
* module's keys can never disagree.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ VERSION DRIFT: `package.json` depends on `dotenv` at the caret range
|
|
22
|
+
* `^16.6.1`, so a minor/patch bump can land without a code change here. On any
|
|
23
|
+
* `dotenv` version bump, re-read `lib/main.js`'s `LINE` constant and re-verify
|
|
24
|
+
* this copy against it. See
|
|
25
|
+
* `.omc/plans/2026-09-07-config-lint-prevention-at-source.md` (AC3).
|
|
26
|
+
*
|
|
27
|
+
* Structure, for readers who would rather not parse it by eye:
|
|
28
|
+
* - an optional leading `export ` is consumed *outside* both capture groups
|
|
29
|
+
* - group 1 is the key
|
|
30
|
+
* - group 2 is the value: either a quoted alternative (`'…'`, `"…"`, `` `…` ``,
|
|
31
|
+
* each using a `[^X]` character class that matches `\n`, which is what makes
|
|
32
|
+
* multiline quoted values correlate correctly in a single match) or the
|
|
33
|
+
* unquoted alternative `[^#\r\n]+`, which stops at a `#` and therefore already
|
|
34
|
+
* excludes any inline comment
|
|
35
|
+
* - group 2 is optional, so `KEY=` yields `undefined`
|
|
36
|
+
*/
|
|
37
|
+
const DOTENV_LINE_SOURCE = '(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*\'(?:\\\\\'|[^\'])*\'|\\s*"(?:\\\\"|[^"])*"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)';
|
|
38
|
+
/** A value that is wrapped in a matched pair of `'`, `"`, or `` ` ``. */
|
|
39
|
+
const MATCHED_QUOTE_PAIR = /^(['"`])[\s\S]*\1$/;
|
|
40
|
+
/**
|
|
41
|
+
* Normalize one raw capture into the `rawValue` contract the value checkers
|
|
42
|
+
* expect.
|
|
43
|
+
*
|
|
44
|
+
* - a missing capture (`KEY=`) becomes `''`, mirroring `main.js:25`'s
|
|
45
|
+
* `(match[2] || '')` — never `undefined`, which would throw in the checkers
|
|
46
|
+
* - the leading whitespace the three quoted alternatives each absorb via their
|
|
47
|
+
* own `\s*` is a regex artifact, not part of the value, and is stripped
|
|
48
|
+
* - a quoted value is then returned **exactly as captured, quotes intact**, with
|
|
49
|
+
* no further trimming: the closing quote already bounds it precisely
|
|
50
|
+
* - an unquoted value has any trailing inline comment and the whitespace before
|
|
51
|
+
* it removed, mirroring `main.js:29`'s unconditional `.trim()` of unquoted
|
|
52
|
+
* captures. (The regex's `[^#\r\n]+` alternative already stops at the `#`, so
|
|
53
|
+
* in practice only the trailing whitespace is left to strip; the explicit
|
|
54
|
+
* comment strip below is belt-and-braces and cannot fire on a capture this
|
|
55
|
+
* regex produced.)
|
|
56
|
+
*/
|
|
57
|
+
const normalizeRawValue = (captured) => {
|
|
58
|
+
if (captured === undefined)
|
|
59
|
+
return '';
|
|
60
|
+
const value = captured.trimStart();
|
|
61
|
+
if (MATCHED_QUOTE_PAIR.test(value))
|
|
62
|
+
return value;
|
|
63
|
+
return value.replace(/\s*#[^\n]*$/, '').trimEnd();
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Map every key in `contents` to its raw pre-parse value.
|
|
67
|
+
*
|
|
68
|
+
* Duplicate keys resolve **last-match-wins**, matching `dotenv.parse`'s own
|
|
69
|
+
* behavior (verified: parsing `DUP=first\nDUP=second` returns `{DUP:'second'}`).
|
|
70
|
+
*
|
|
71
|
+
* @param contents - The raw text of a `.env` file.
|
|
72
|
+
* @returns Key → raw value, quotes intact. See {@link normalizeRawValue}.
|
|
73
|
+
*/
|
|
74
|
+
export const correlateRawValues = (contents) => {
|
|
75
|
+
// Built per call rather than hoisted: a `g`-flagged regex carries mutable
|
|
76
|
+
// `lastIndex`, and a shared instance would make concurrent or aborted scans
|
|
77
|
+
// silently skip entries.
|
|
78
|
+
const line = new RegExp(DOTENV_LINE_SOURCE, 'mg');
|
|
79
|
+
// Normalize line breaks exactly as `main.js:19` does before matching.
|
|
80
|
+
const normalized = contents.replace(/\r\n?/gm, '\n');
|
|
81
|
+
const rawValues = new Map();
|
|
82
|
+
let match = line.exec(normalized);
|
|
83
|
+
while (match !== null) {
|
|
84
|
+
const key = match[1];
|
|
85
|
+
if (key !== undefined) {
|
|
86
|
+
rawValues.set(key, normalizeRawValue(match[2]));
|
|
87
|
+
}
|
|
88
|
+
match = line.exec(normalized);
|
|
89
|
+
}
|
|
90
|
+
return rawValues;
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=dotenv-correlation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenv-correlation.js","sourceRoot":"","sources":["../src/dotenv-correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,kBAAkB,GACtB,kKAAkK,CAAA;AAEpK,yEAAyE;AACzE,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|
|
2
|
+
* Resolve the canonical layered `.env*` file chain, low → high precedence.
|
|
3
|
+
*
|
|
4
|
+
* Extracted verbatim from `envs.ts` so the `config-lint` bin can lint exactly
|
|
5
|
+
* the files `envs()` would load, without reimplementing the precedence order.
|
|
6
|
+
*
|
|
7
|
+
* Internal module — deliberately NOT re-exported from `index.ts`.
|
|
8
|
+
*
|
|
9
|
+
* @param options.appDirectory - App root. Relative entries resolve against it;
|
|
10
|
+
* when empty the chain is empty, matching `envs()`'s existing behavior.
|
|
11
|
+
* @param options.secretsPath - Optional injected-secrets file, slotted between
|
|
12
|
+
* `.env.${env}` and `.env.${env}.local`.
|
|
13
|
+
* @param options.nodeEnv - `NODE_ENV`. `.env.local` is skipped when `'test'` so
|
|
14
|
+
* personal-machine overrides never leak into a deterministic test run.
|
|
15
|
+
* @param options.env - `ENV`, the stage selector.
|
|
16
|
+
* @returns Absolute paths in precedence order (later wins).
|
|
17
|
+
*/
|
|
18
|
+
export declare const resolveDotenvFileChain: ({ appDirectory, secretsPath, nodeEnv, env, }: {
|
|
19
|
+
appDirectory?: string;
|
|
20
|
+
secretsPath?: string;
|
|
21
|
+
nodeEnv?: string;
|
|
22
|
+
env?: string;
|
|
23
|
+
}) => string[];
|
|
24
|
+
//# sourceMappingURL=dotenv-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenv-files.d.ts","sourceRoot":"","sources":["../src/dotenv-files.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,GAAI,8CAKpC;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,KAAG,MAAM,EAqBT,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isAbsolute } from 'node:path';
|
|
2
|
+
import { resolveApp } from './utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the canonical layered `.env*` file chain, low → high precedence.
|
|
5
|
+
*
|
|
6
|
+
* Extracted verbatim from `envs.ts` so the `config-lint` bin can lint exactly
|
|
7
|
+
* the files `envs()` would load, without reimplementing the precedence order.
|
|
8
|
+
*
|
|
9
|
+
* Internal module — deliberately NOT re-exported from `index.ts`.
|
|
10
|
+
*
|
|
11
|
+
* @param options.appDirectory - App root. Relative entries resolve against it;
|
|
12
|
+
* when empty the chain is empty, matching `envs()`'s existing behavior.
|
|
13
|
+
* @param options.secretsPath - Optional injected-secrets file, slotted between
|
|
14
|
+
* `.env.${env}` and `.env.${env}.local`.
|
|
15
|
+
* @param options.nodeEnv - `NODE_ENV`. `.env.local` is skipped when `'test'` so
|
|
16
|
+
* personal-machine overrides never leak into a deterministic test run.
|
|
17
|
+
* @param options.env - `ENV`, the stage selector.
|
|
18
|
+
* @returns Absolute paths in precedence order (later wins).
|
|
19
|
+
*/
|
|
20
|
+
export const resolveDotenvFileChain = ({ appDirectory = '', secretsPath = '', nodeEnv, env, }) => {
|
|
21
|
+
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
22
|
+
const dotenvFiles = [
|
|
23
|
+
'.env',
|
|
24
|
+
// Don't include `.env.local` for `test` environment since normally you
|
|
25
|
+
// expect tests to produce the same results for everyone
|
|
26
|
+
nodeEnv !== 'test' && '.env.local',
|
|
27
|
+
env && `.env.${env}`,
|
|
28
|
+
secretsPath,
|
|
29
|
+
env && `.env.${env}.local`,
|
|
30
|
+
].filter(Boolean);
|
|
31
|
+
if (!appDirectory) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return dotenvFiles.reduce((acc, dotenvFile) => {
|
|
35
|
+
return isAbsolute(dotenvFile)
|
|
36
|
+
? acc.concat(dotenvFile)
|
|
37
|
+
: acc.concat(resolveApp(dotenvFile, appDirectory));
|
|
38
|
+
}, []);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=dotenv-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotenv-files.js","sourceRoot":"","sources":["../src/dotenv-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,YAAY,GAAG,EAAE,EACjB,WAAW,GAAG,EAAE,EAChB,OAAO,EACP,GAAG,GAMJ,EAAY,EAAE;IACb,oEAAoE;IACpE,MAAM,WAAW,GAAG;QAClB,MAAM;QACN,uEAAuE;QACvE,wDAAwD;QACxD,OAAO,KAAK,MAAM,IAAI,YAAY;QAClC,GAAG,IAAI,QAAQ,GAAG,EAAE;QACpB,WAAW;QACX,GAAG,IAAI,QAAQ,GAAG,QAAQ;KAC3B,CAAC,MAAM,CAAC,OAAO,CAAa,CAAA;IAE7B,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAW,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;QACtD,OAAO,UAAU,CAAC,UAAU,CAAC;YAC3B,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;YACxB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;IACtD,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv-fixers.d.ts","sourceRoot":"","sources":["../src/dotenv-fixers.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAUhE,
|
|
1
|
+
{"version":3,"file":"dotenv-fixers.d.ts","sourceRoot":"","sources":["../src/dotenv-fixers.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAUhE,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAO9D,CAAA;AAGD,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAM1D,CAAA;AAKD,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAO5D,CAAA;AAGD,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAMhE,CAAA;AAID,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,aAehE,CAAA;AAED,eAAO,MAAM,eAAe,SAvEiB,MAAM,QAAQ,MAAM,gBA2EhE,CAAA;AAED,eAAO,MAAM,gBAAgB,SA3CY,MAAM,QAAQ,MAAM,gBA+C5D,CAAA"}
|
package/dist/dotenv-fixers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { incorrectDelimiterChecker, leadingCharacterChecker, lowercaseKeyChecker, quoteCharacterChecker, trailingWhitespaceChecker, valueWithoutQuotesChecker, } from
|
|
2
|
-
import { removeInvalidLeadingChars } from
|
|
1
|
+
import { incorrectDelimiterChecker, leadingCharacterChecker, lowercaseKeyChecker, quoteCharacterChecker, trailingWhitespaceChecker, valueWithoutQuotesChecker, } from './dotenv-checkers.js';
|
|
2
|
+
import { removeInvalidLeadingChars } from './utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* Fixes incorrect delimiters by replacing non-alphanumeric characters with
|
|
5
5
|
* underscores ('_'). Also ensures that an underscore separates words in the key.
|
|
@@ -14,7 +14,7 @@ export const incorrectDelimiterFixer = (key, line) => {
|
|
|
14
14
|
}
|
|
15
15
|
let cleanedKey = removeInvalidLeadingChars(key);
|
|
16
16
|
const startIdx = key.length - cleanedKey.length;
|
|
17
|
-
cleanedKey = key.slice(startIdx).replace(/[^a-z0-9]/gi,
|
|
17
|
+
cleanedKey = key.slice(startIdx).replace(/[^a-z0-9]/gi, '_');
|
|
18
18
|
return [`${key.substring(0, startIdx)}${cleanedKey}`, line];
|
|
19
19
|
};
|
|
20
20
|
// Fixes key that starts with an unallowed character.
|
|
@@ -36,10 +36,10 @@ export const lowercaseKeyFixer = (key, line) => {
|
|
|
36
36
|
// skips if the value is multiline, contains whitespaces, newline characters or
|
|
37
37
|
// hash signs:
|
|
38
38
|
export const quoteCharacterFixer = (key, line) => {
|
|
39
|
-
if (!quoteCharacterChecker(line)) {
|
|
39
|
+
if (!quoteCharacterChecker(key, line)) {
|
|
40
40
|
return [key, line];
|
|
41
41
|
}
|
|
42
|
-
const pureVal = line.replace(/"|'/g,
|
|
42
|
+
const pureVal = line.replace(/"|'/g, '');
|
|
43
43
|
return [key, pureVal];
|
|
44
44
|
};
|
|
45
45
|
// Fixes trailing whitespace.
|
|
@@ -52,10 +52,10 @@ export const trailingWhitespaceFixer = (key, line) => {
|
|
|
52
52
|
// Value without quotes: Detects if a value contains whitespaces and at the
|
|
53
53
|
// same time doesn't contain quote characters (`'` / `"`):
|
|
54
54
|
export const valueWithoutQuotesFixer = (key, line) => {
|
|
55
|
-
if (!valueWithoutQuotesChecker(line)) {
|
|
55
|
+
if (!valueWithoutQuotesChecker(key, line)) {
|
|
56
56
|
return [key, line];
|
|
57
57
|
}
|
|
58
|
-
let pureVal =
|
|
58
|
+
let pureVal = '';
|
|
59
59
|
if (line.includes("'")) {
|
|
60
60
|
pureVal = `"${line}"`;
|
|
61
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv-fixers.js","sourceRoot":"","sources":["../src/dotenv-fixers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,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,OAAO,GAAG,EAAE,CAAA;IAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,IAAI,IAAI,GAAG,CAAA;IACvB,CAAC;SAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,IAAI,IAAI,GAAG,CAAA;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,IAAI,IAAI,GAAG,CAAA;IACvB,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,uBAAuB;IACvB,qBAAqB;IACrB,iBAAiB;CAClB,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,mBAAmB;IACnB,uBAAuB;IACvB,uBAAuB;CACxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv-with-expand.d.ts","sourceRoot":"","sources":["../src/dotenv-with-expand.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"dotenv-with-expand.d.ts","sourceRoot":"","sources":["../src/dotenv-with-expand.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAIpE,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAExB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC;AA0BD;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAChB,KAAK,MAAM,GAAG,MAAM,EACpB,WAAW,OAAO,EAClB,aAAa,mBAAmB,KAC/B,iBAUF,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,GAAG,MAAM,EACpB,WAAW,OAAO,EAClB,aAAa,mBAAmB,KAC/B,iBAWF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GACjB,OAAO,aAAa,KACnB;IACD,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAA;CAItC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readFileSync } from
|
|
2
|
-
import dotenv from
|
|
3
|
-
import dotenvExpand from
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import dotenv from 'dotenv';
|
|
3
|
+
import dotenvExpand from 'dotenv-expand';
|
|
4
4
|
const dotenvExpandOverrideFix = (parsed) => {
|
|
5
5
|
const obj = {};
|
|
6
6
|
dotenvExpand.expand({ parsed, processEnv: obj });
|
|
@@ -88,8 +88,8 @@ const configHelper = (options) => {
|
|
|
88
88
|
for (const optPath of optionPaths) {
|
|
89
89
|
try {
|
|
90
90
|
let parsed;
|
|
91
|
-
const contents = readFileSync(optPath, { encoding:
|
|
92
|
-
if (optPath?.endsWith(
|
|
91
|
+
const contents = readFileSync(optPath, { encoding: 'utf8' });
|
|
92
|
+
if (optPath?.endsWith('.json')) {
|
|
93
93
|
parsed = parseJSON(contents, options?.override);
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv-with-expand.js","sourceRoot":"","sources":["../src/dotenv-with-expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"dotenv-with-expand.js","sourceRoot":"","sources":["../src/dotenv-with-expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,YAAY,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-9,7 +9,15 @@
|
|
|
9
9
|
* @param options - Configuration options.
|
|
10
10
|
* @param options.appDirectory - The directory of the app.
|
|
11
11
|
* @param options.secretsPath - The path to an injected secrets file.
|
|
12
|
-
* @param options.lint - Whether to perform linting on the loaded
|
|
12
|
+
* @param options.lint - Whether to perform `.env` hygiene linting on the loaded
|
|
13
|
+
* variables. **Defaults to `false`** — linting is opt-in. It used to default
|
|
14
|
+
* to `true` and ran on every consumer's boot via `./preload`, but its output
|
|
15
|
+
* was never correct (three of six checkers were fed the key where a value was
|
|
16
|
+
* expected, and the two quote checkers were fed post-parse values with the
|
|
17
|
+
* wrapping quotes already stripped, so they structurally could not observe the
|
|
18
|
+
* defect they exist to detect). Nothing could have correctly depended on the
|
|
19
|
+
* old default. Pass `lint: true` to run the checkers deliberately, or use the
|
|
20
|
+
* `config-lint` bin.
|
|
13
21
|
* @param options.override - Whether file values override existing process.env values.
|
|
14
22
|
* @returns An object containing the loaded environment variables.
|
|
15
23
|
*/
|
package/dist/envs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envs.d.ts","sourceRoot":"","sources":["../src/envs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envs.d.ts","sourceRoot":"","sources":["../src/envs.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,IAAI,GAAI,iDAKlB;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACd,KAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAuE5C,CAAA"}
|
package/dist/envs.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { incorrectDelimiterChecker, leadingCharacterChecker, lowercaseKeyChecker, quoteCharacterChecker, trailingWhitespaceChecker, valueWithoutQuotesChecker, } from './dotenv-checkers.js';
|
|
3
|
+
import { correlateRawValues } from './dotenv-correlation.js';
|
|
4
|
+
import { resolveDotenvFileChain } from './dotenv-files.js';
|
|
5
|
+
import { parse, parseJSON } from './dotenv-with-expand.js';
|
|
6
|
+
import { mergeAssign, mergeDefaults } from './utils.js';
|
|
6
7
|
/**
|
|
7
8
|
* Load environment variables from .env* files and optionally perform linting.
|
|
8
9
|
* Suppress warnings using silent if this file is missing. Dotenv files are
|
|
@@ -14,48 +15,74 @@ import { mergeAssign, mergeDefaults, resolveApp } from "./utils.js";
|
|
|
14
15
|
* @param options - Configuration options.
|
|
15
16
|
* @param options.appDirectory - The directory of the app.
|
|
16
17
|
* @param options.secretsPath - The path to an injected secrets file.
|
|
17
|
-
* @param options.lint - Whether to perform linting on the loaded
|
|
18
|
+
* @param options.lint - Whether to perform `.env` hygiene linting on the loaded
|
|
19
|
+
* variables. **Defaults to `false`** — linting is opt-in. It used to default
|
|
20
|
+
* to `true` and ran on every consumer's boot via `./preload`, but its output
|
|
21
|
+
* was never correct (three of six checkers were fed the key where a value was
|
|
22
|
+
* expected, and the two quote checkers were fed post-parse values with the
|
|
23
|
+
* wrapping quotes already stripped, so they structurally could not observe the
|
|
24
|
+
* defect they exist to detect). Nothing could have correctly depended on the
|
|
25
|
+
* old default. Pass `lint: true` to run the checkers deliberately, or use the
|
|
26
|
+
* `config-lint` bin.
|
|
18
27
|
* @param options.override - Whether file values override existing process.env values.
|
|
19
28
|
* @returns An object containing the loaded environment variables.
|
|
20
29
|
*/
|
|
21
|
-
export const envs = ({ appDirectory =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const ENV = process.env.ENV;
|
|
25
|
-
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
26
|
-
const dotenvFiles = [
|
|
27
|
-
".env",
|
|
28
|
-
// Don't include `.env.local` for `test` environment since normally you
|
|
29
|
-
// expect tests to produce the same results for everyone
|
|
30
|
-
NODE_ENV !== "test" && ".env.local",
|
|
31
|
-
ENV && `.env.${ENV}`,
|
|
30
|
+
export const envs = ({ appDirectory = '', lint = false, secretsPath = '', override = false, } = {}) => {
|
|
31
|
+
const absDotenvFiles = resolveDotenvFileChain({
|
|
32
|
+
appDirectory,
|
|
32
33
|
secretsPath,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return isAbsolute(dotenvFile)
|
|
38
|
-
? acc.concat(dotenvFile)
|
|
39
|
-
: acc.concat(resolveApp(dotenvFile, appDirectory));
|
|
40
|
-
}, []);
|
|
41
|
-
}
|
|
34
|
+
nodeEnv: process.env.NODE_ENV,
|
|
35
|
+
env: process.env.ENV,
|
|
36
|
+
});
|
|
37
|
+
const findings = [];
|
|
42
38
|
const resolvedEnv = absDotenvFiles.reduce((acc, dotenvFile) => {
|
|
43
39
|
if (!existsSync(dotenvFile)) {
|
|
44
40
|
return acc;
|
|
45
41
|
}
|
|
46
|
-
const contents = readFileSync(dotenvFile, { encoding:
|
|
47
|
-
const
|
|
42
|
+
const contents = readFileSync(dotenvFile, { encoding: 'utf8' });
|
|
43
|
+
const isJson = dotenvFile.endsWith('.json');
|
|
44
|
+
const envs = isJson
|
|
48
45
|
? parseJSON(contents, false, {})
|
|
49
46
|
: parse(contents, false, {});
|
|
50
47
|
if (lint && envs) {
|
|
48
|
+
// Correlate against the `contents` already in scope — no second read.
|
|
49
|
+
// A `.json` secrets file is not dotenv syntax, so the raw-value line
|
|
50
|
+
// checkers do not apply to it; the key checkers still do.
|
|
51
|
+
const rawValues = isJson
|
|
52
|
+
? new Map()
|
|
53
|
+
: correlateRawValues(contents);
|
|
51
54
|
Object.entries(envs).forEach(([key, value]) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
// Key checkers: unchanged call shape, unchanged `console.log` output.
|
|
56
|
+
incorrectDelimiterChecker(key, value);
|
|
57
|
+
leadingCharacterChecker(key);
|
|
58
|
+
lowercaseKeyChecker(key);
|
|
59
|
+
// UNCHANGED, deliberately. Under the previous uniform
|
|
60
|
+
// `checker(key, value)` call this single-parameter checker bound its
|
|
61
|
+
// `line` parameter to the *key*, never the value. Fixing that is an
|
|
62
|
+
// explicit, documented scope cut (see the plan's v3 changelog and
|
|
63
|
+
// follow-up 1), so its behavior is preserved exactly rather than
|
|
64
|
+
// quietly "improved" — zero regression in either direction.
|
|
65
|
+
trailingWhitespaceChecker(key);
|
|
66
|
+
if (isJson) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Line checkers: fed the raw pre-parse value, wrapping quotes intact.
|
|
70
|
+
const rawValue = rawValues.get(key) ?? '';
|
|
71
|
+
const quoteFinding = quoteCharacterChecker(key, rawValue);
|
|
72
|
+
if (quoteFinding)
|
|
73
|
+
findings.push(quoteFinding);
|
|
74
|
+
const unquotedFinding = valueWithoutQuotesChecker(key, rawValue);
|
|
75
|
+
if (unquotedFinding)
|
|
76
|
+
findings.push(unquotedFinding);
|
|
55
77
|
});
|
|
56
78
|
}
|
|
57
79
|
return mergeAssign(acc, envs);
|
|
58
80
|
}, {});
|
|
81
|
+
// Sole formatting/printing point for findings. Every message already has its
|
|
82
|
+
// value masked to the last 4 characters by the checker that produced it.
|
|
83
|
+
for (const finding of findings) {
|
|
84
|
+
console.log(`warning: ${finding.message}`);
|
|
85
|
+
}
|
|
59
86
|
return override
|
|
60
87
|
? mergeAssign(process.env, resolvedEnv)
|
|
61
88
|
: mergeDefaults(process.env, resolvedEnv);
|
package/dist/envs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envs.js","sourceRoot":"","sources":["../src/envs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,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,CAAA;YACrD,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/B,CAAC,EACD,EAA4C,CAC7C,CAAA;IAED,6EAA6E;IAC7E,yEAAyE;IACzE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,QAAQ;QACb,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC;QACvC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;AAC7C,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './correct-env.js';
|
|
2
|
+
export * from './dotenv-checkers.js';
|
|
3
|
+
export * from './dotenv-fixers.js';
|
|
4
|
+
export * from './dotenv-with-expand.js';
|
|
5
|
+
export * from './envs.js';
|
|
6
|
+
export * from './process-env.js';
|
|
7
|
+
export * from './utils.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './correct-env.js';
|
|
2
|
+
export * from './dotenv-checkers.js';
|
|
3
|
+
export * from './dotenv-fixers.js';
|
|
4
|
+
export * from './dotenv-with-expand.js';
|
|
5
|
+
export * from './envs.js';
|
|
6
|
+
export * from './process-env.js';
|
|
7
|
+
export * from './utils.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA"}
|
package/dist/preload.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// evaluated. Wire it via `NODE_OPTIONS="--import @cogs/config/preload"` (Node
|
|
4
4
|
// >= 20.6, ESM). Importing this module runs `correctEnv()` and then `envs()` as
|
|
5
5
|
// a side effect.
|
|
6
|
-
import { correctEnv } from
|
|
7
|
-
import { envs } from
|
|
6
|
+
import { correctEnv } from './correct-env.js';
|
|
7
|
+
import { envs } from './envs.js';
|
|
8
8
|
correctEnv();
|
|
9
9
|
envs({
|
|
10
10
|
appDirectory: process.cwd(),
|
|
@@ -12,6 +12,6 @@ envs({
|
|
|
12
12
|
// literal string 'undefinedsecrets.json'.
|
|
13
13
|
secretsPath: process.env.SECRETS_PATH
|
|
14
14
|
? `${process.env.SECRETS_PATH}secrets.json`
|
|
15
|
-
:
|
|
15
|
+
: '',
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=preload.js.map
|
package/dist/preload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preload.js","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,iBAAiB;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"preload.js","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,iBAAiB;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,UAAU,EAAE,CAAA;AAEZ,IAAI,CAAC;IACH,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE;IAC3B,wEAAwE;IACxE,0CAA0C;IAC1C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACnC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,cAAc;QAC3C,CAAC,CAAC,EAAE;CACP,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-env.d.ts","sourceRoot":"","sources":["../src/process-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"process-env.d.ts","sourceRoot":"","sources":["../src/process-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CACnC,KAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CA6CvC,CAAA"}
|
package/dist/process-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-env.js","sourceRoot":"","sources":["../src/process-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAE1B,EAA0C,EAAE;IAC3C,4EAA4E;IAC5E,iDAAiD;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"process-env.js","sourceRoot":"","sources":["../src/process-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAE1B,EAA0C,EAAE;IAC3C,4EAA4E;IAC5E,iDAAiD;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAA;IACpC,8EAA8E;IAC9E,oEAAoE;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAA;IAEjC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAC1C,CAAC,GAAG,EAAE,GAAW,EAAE,EAAE;QACnB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QACtB,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,EAA4C,CAC7C,CAAA;IAED,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CACnD,CAAC,GAAG,EAAE,GAAW,EAAE,EAAE;QACnB,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B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