@pitininja/envious 6.0.0-beta4 → 6.0.0-beta6
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/dist/common/error.d.ts
CHANGED
|
@@ -17,7 +17,5 @@ type ResolverErrorsToEnviousErrorsOptions<T> = {
|
|
|
17
17
|
};
|
|
18
18
|
resolverErrors: T[];
|
|
19
19
|
};
|
|
20
|
-
export declare const resolverErrorsToEnviousErrors: <T>({
|
|
21
|
-
|
|
22
|
-
resolverErrors
|
|
23
|
-
}: ResolverErrorsToEnviousErrorsOptions<T>) => EnviousErrorVariable[];
|
|
20
|
+
export declare const resolverErrorsToEnviousErrors: <T>({ transform, resolverErrors }: ResolverErrorsToEnviousErrorsOptions<T>) => EnviousErrorVariable[];
|
|
21
|
+
export {};
|
package/dist/common/error.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
3
|
exports.resolverErrorsToEnviousErrors = exports.EnviousError = void 0;
|
|
3
4
|
class EnviousError extends Error {
|
|
4
5
|
variables;
|
|
@@ -22,4 +23,4 @@ const resolverErrorsToEnviousErrors = ({ transform, resolverErrors }) => {
|
|
|
22
23
|
return enviousErrors;
|
|
23
24
|
};
|
|
24
25
|
exports.resolverErrorsToEnviousErrors = resolverErrorsToEnviousErrors;
|
|
25
|
-
//# sourceMappingURL=error.js.map
|
|
26
|
+
//# sourceMappingURL=error.js.map
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { EnviousError, type EnviousErrorVariable } from '../../common/error';
|
|
2
|
+
export { EnviousError, type EnviousErrorVariable };
|
|
1
3
|
type EnviousResolver<T> = (env: NodeJS.ProcessEnv) => T;
|
|
2
4
|
export type EnviousOptions<T> = {
|
|
3
5
|
resolver: EnviousResolver<T>;
|
|
4
6
|
logErrors?: boolean;
|
|
5
7
|
logger?: (message: string) => void;
|
|
6
8
|
};
|
|
7
|
-
export declare const envious: <T>({
|
|
8
|
-
resolver,
|
|
9
|
-
logErrors,
|
|
10
|
-
logger
|
|
11
|
-
}: EnviousOptions<T>) => T;
|
|
9
|
+
export declare const envious: <T>({ resolver, logErrors, logger }: EnviousOptions<T>) => T;
|
package/dist/core/src/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
exports
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.envious = exports.EnviousError = void 0;
|
|
4
|
+
const error_1 = require("../../common/error");
|
|
5
|
+
Object.defineProperty(exports, "EnviousError", { enumerable: true, get: function () { return error_1.EnviousError; } });
|
|
4
6
|
const logErrorVariables = (variables, logger) => {
|
|
5
7
|
// biome-ignore lint/suspicious/noConsole: console default is the default logger here
|
|
6
8
|
const log = logger ?? console.error;
|
|
@@ -12,7 +14,8 @@ const logErrorVariables = (variables, logger) => {
|
|
|
12
14
|
const envious = ({ resolver, logErrors, logger }) => {
|
|
13
15
|
try {
|
|
14
16
|
return resolver(process.env);
|
|
15
|
-
}
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
16
19
|
if (err instanceof error_1.EnviousError) {
|
|
17
20
|
if (logErrors) {
|
|
18
21
|
logErrorVariables(err.variables, logger);
|
|
@@ -25,4 +28,4 @@ const envious = ({ resolver, logErrors, logger }) => {
|
|
|
25
28
|
}
|
|
26
29
|
};
|
|
27
30
|
exports.envious = envious;
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAA6E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAA6E;6FAApE,oBAAY;AAYrB,MAAM,iBAAiB,GAAG,CACtB,SAAiC,EACjC,MAAkC,EACpC,EAAE,CAAC;IACD,qFAAqF;IACrF,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC;IACpC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACjD,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,SAAS,EAAE,CAAC;QACzC,GAAG,CAAC,OAAO,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;AAAA,CACJ,CAAC;AAEK,MAAM,OAAO,GAAG,CAAI,EACvB,QAAQ,EACR,SAAS,EACT,MAAM,EACU,EAAE,EAAE,CAAC;IACrB,IAAI,CAAC;QACD,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,IAAI,GAAG,YAAY,oBAAY,EAAE,CAAC;YAC9B,IAAI,SAAS,EAAE,CAAC;gBACZ,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,GAAG,CAAC;QACd,CAAC;QACD,MAAM,IAAI,oBAAY,CAAC;YACnB,OAAO,EAAE,uDAAuD,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;SACpH,CAAC,CAAC;IACP,CAAC;AAAA,CACJ,CAAC;AAlBW,QAAA,OAAO,GAAP,OAAO,CAkBlB"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pitininja/envious",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-beta6",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"homepage": "https://codeberg.org/pitininja/envious",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://codeberg.org/pitininja/envious"
|
|
9
9
|
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
10
13
|
"files": [
|
|
11
14
|
"./dist",
|
|
12
15
|
"./package.json"
|
|
13
16
|
],
|
|
14
|
-
"main": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
17
|
+
"main": "./dist/core/src/index.js",
|
|
18
|
+
"types": "./dist/core/src/index.d.ts",
|
|
16
19
|
"scripts": {
|
|
17
20
|
"build": "npx tsgo --build --clean tsconfig.json && npx tsgo -b ./tsconfig.json"
|
|
18
21
|
}
|