arkenv 0.2.0 → 0.3.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 +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `arkenv`
|
|
2
2
|
|
|
3
|
-
Hello, developers! Welcome to the
|
|
3
|
+
Hello, developers! Welcome to the `arkenv` package codebase. This directory contains the core implementation of ArkEnv, providing typesafe environment variable parsing and validation for Node.js.
|
|
4
4
|
|
|
5
|
-
For more information, please refer to the
|
|
5
|
+
For more information, please refer to the [README](../../README.md) in the monorepo root.
|
|
6
6
|
|
|
7
7
|
Happy coding!
|
package/dist/index.cjs
CHANGED
|
@@ -30,8 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
createEnv: () => createEnv,
|
|
33
34
|
default: () => index_default,
|
|
34
|
-
defineEnv: () => defineEnv,
|
|
35
35
|
host: () => host,
|
|
36
36
|
port: () => port
|
|
37
37
|
});
|
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
40
40
|
// src/define-env.ts
|
|
41
41
|
var define_env_exports = {};
|
|
42
42
|
__export(define_env_exports, {
|
|
43
|
-
|
|
43
|
+
createEnv: () => createEnv
|
|
44
44
|
});
|
|
45
45
|
var import_arktype = require("arktype");
|
|
46
46
|
|
|
@@ -76,7 +76,7 @@ ${indent(formatErrors(errors))}
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
// src/define-env.ts
|
|
79
|
-
var
|
|
79
|
+
var createEnv = (def, env = process.env) => {
|
|
80
80
|
const schema = (0, import_arktype.type)(def);
|
|
81
81
|
const requiredEnvKeys = Object.keys(
|
|
82
82
|
def
|
|
@@ -113,7 +113,7 @@ var host = (0, import_arktype2.type)("string.ip | 'localhost'");
|
|
|
113
113
|
var index_default = { ...define_env_exports, ...types_exports };
|
|
114
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
115
115
|
0 && (module.exports = {
|
|
116
|
-
|
|
116
|
+
createEnv,
|
|
117
117
|
host,
|
|
118
118
|
port
|
|
119
119
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ type EnvSchema<T extends Record<string, string | undefined> = Record<string, str
|
|
|
12
12
|
* @param env - The environment variables to validate, defaults to `process.env`
|
|
13
13
|
* @returns The validated environment variable schema
|
|
14
14
|
*/
|
|
15
|
-
declare const
|
|
15
|
+
declare const createEnv: <const T extends Record<string, string | undefined>>(def: EnvSchema<T>, env?: UserEnvironment) => distill.Out<type.infer<T>>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* A `string` that can be parsed into a number between 0 and 65535
|
|
@@ -26,9 +26,9 @@ declare const host: arktype_internal_methods_string_ts.StringType<string, {}>;
|
|
|
26
26
|
declare const _default: {
|
|
27
27
|
port: arktype_internal_methods_morph_ts.MorphType<(In: string) => arktype_internal_attributes_ts.Out<number>, {}>;
|
|
28
28
|
host: arktype_internal_methods_string_ts.StringType<string, {}>;
|
|
29
|
-
|
|
29
|
+
createEnv: <const T extends Record<string, string | undefined>>(def: EnvSchema<T>, env?: {
|
|
30
30
|
[x: string]: string | undefined;
|
|
31
31
|
}) => arktype.distill.Out<arktype.type.infer<T>>;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export { type EnvSchema, _default as default,
|
|
34
|
+
export { type EnvSchema, createEnv, _default as default, host, port };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ type EnvSchema<T extends Record<string, string | undefined> = Record<string, str
|
|
|
12
12
|
* @param env - The environment variables to validate, defaults to `process.env`
|
|
13
13
|
* @returns The validated environment variable schema
|
|
14
14
|
*/
|
|
15
|
-
declare const
|
|
15
|
+
declare const createEnv: <const T extends Record<string, string | undefined>>(def: EnvSchema<T>, env?: UserEnvironment) => distill.Out<type.infer<T>>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* A `string` that can be parsed into a number between 0 and 65535
|
|
@@ -26,9 +26,9 @@ declare const host: arktype_internal_methods_string_ts.StringType<string, {}>;
|
|
|
26
26
|
declare const _default: {
|
|
27
27
|
port: arktype_internal_methods_morph_ts.MorphType<(In: string) => arktype_internal_attributes_ts.Out<number>, {}>;
|
|
28
28
|
host: arktype_internal_methods_string_ts.StringType<string, {}>;
|
|
29
|
-
|
|
29
|
+
createEnv: <const T extends Record<string, string | undefined>>(def: EnvSchema<T>, env?: {
|
|
30
30
|
[x: string]: string | undefined;
|
|
31
31
|
}) => arktype.distill.Out<arktype.type.infer<T>>;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export { type EnvSchema, _default as default,
|
|
34
|
+
export { type EnvSchema, createEnv, _default as default, host, port };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
// src/define-env.ts
|
|
8
8
|
var define_env_exports = {};
|
|
9
9
|
__export(define_env_exports, {
|
|
10
|
-
|
|
10
|
+
createEnv: () => createEnv
|
|
11
11
|
});
|
|
12
12
|
import { type } from "arktype";
|
|
13
13
|
|
|
@@ -43,7 +43,7 @@ ${indent(formatErrors(errors))}
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
// src/define-env.ts
|
|
46
|
-
var
|
|
46
|
+
var createEnv = (def, env = process.env) => {
|
|
47
47
|
const schema = type(def);
|
|
48
48
|
const requiredEnvKeys = Object.keys(
|
|
49
49
|
def
|
|
@@ -79,8 +79,8 @@ var host = type2("string.ip | 'localhost'");
|
|
|
79
79
|
// src/index.ts
|
|
80
80
|
var index_default = { ...define_env_exports, ...types_exports };
|
|
81
81
|
export {
|
|
82
|
+
createEnv,
|
|
82
83
|
index_default as default,
|
|
83
|
-
defineEnv,
|
|
84
84
|
host,
|
|
85
85
|
port
|
|
86
86
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkenv",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"validation"
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
|
-
"homepage": "https://
|
|
26
|
+
"homepage": "https://arkenv.js.org",
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
29
|
"url": "git+https://github.com/yamcodes/arkenv.git"
|