@optique/env 1.0.0-dev.1136 → 1.0.0-dev.1163
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/index.cjs +4 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -63,6 +63,7 @@ function defaultEnvSource(key) {
|
|
|
63
63
|
*
|
|
64
64
|
* @param options Environment context options.
|
|
65
65
|
* @returns A context that provides environment source annotations.
|
|
66
|
+
* @throws {TypeError} If `prefix` is not a string.
|
|
66
67
|
* @throws {TypeError} If `source` is not a function.
|
|
67
68
|
* @since 1.0.0
|
|
68
69
|
*/
|
|
@@ -71,7 +72,9 @@ function createEnvContext(options = {}) {
|
|
|
71
72
|
const rawSource = options.source;
|
|
72
73
|
if (rawSource !== void 0 && typeof rawSource !== "function") throw new TypeError(`Expected source to be a function, but got: ${rawSource === null ? "null" : Array.isArray(rawSource) ? "array" : typeof rawSource}.`);
|
|
73
74
|
const source = rawSource ?? defaultEnvSource;
|
|
74
|
-
const
|
|
75
|
+
const rawPrefix = options.prefix;
|
|
76
|
+
if (rawPrefix !== void 0 && typeof rawPrefix !== "string") throw new TypeError(`Expected prefix to be a string, but got: ${rawPrefix === null ? "null" : Array.isArray(rawPrefix) ? "array" : typeof rawPrefix}.`);
|
|
77
|
+
const prefix = rawPrefix ?? "";
|
|
75
78
|
return {
|
|
76
79
|
id: contextId,
|
|
77
80
|
prefix,
|
package/dist/index.d.cts
CHANGED
|
@@ -72,6 +72,7 @@ declare function clearActiveEnvSource(contextId: symbol): void;
|
|
|
72
72
|
*
|
|
73
73
|
* @param options Environment context options.
|
|
74
74
|
* @returns A context that provides environment source annotations.
|
|
75
|
+
* @throws {TypeError} If `prefix` is not a string.
|
|
75
76
|
* @throws {TypeError} If `source` is not a function.
|
|
76
77
|
* @since 1.0.0
|
|
77
78
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ declare function clearActiveEnvSource(contextId: symbol): void;
|
|
|
72
72
|
*
|
|
73
73
|
* @param options Environment context options.
|
|
74
74
|
* @returns A context that provides environment source annotations.
|
|
75
|
+
* @throws {TypeError} If `prefix` is not a string.
|
|
75
76
|
* @throws {TypeError} If `source` is not a function.
|
|
76
77
|
* @since 1.0.0
|
|
77
78
|
*/
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ function defaultEnvSource(key) {
|
|
|
40
40
|
*
|
|
41
41
|
* @param options Environment context options.
|
|
42
42
|
* @returns A context that provides environment source annotations.
|
|
43
|
+
* @throws {TypeError} If `prefix` is not a string.
|
|
43
44
|
* @throws {TypeError} If `source` is not a function.
|
|
44
45
|
* @since 1.0.0
|
|
45
46
|
*/
|
|
@@ -48,7 +49,9 @@ function createEnvContext(options = {}) {
|
|
|
48
49
|
const rawSource = options.source;
|
|
49
50
|
if (rawSource !== void 0 && typeof rawSource !== "function") throw new TypeError(`Expected source to be a function, but got: ${rawSource === null ? "null" : Array.isArray(rawSource) ? "array" : typeof rawSource}.`);
|
|
50
51
|
const source = rawSource ?? defaultEnvSource;
|
|
51
|
-
const
|
|
52
|
+
const rawPrefix = options.prefix;
|
|
53
|
+
if (rawPrefix !== void 0 && typeof rawPrefix !== "string") throw new TypeError(`Expected prefix to be a string, but got: ${rawPrefix === null ? "null" : Array.isArray(rawPrefix) ? "array" : typeof rawPrefix}.`);
|
|
54
|
+
const prefix = rawPrefix ?? "";
|
|
52
55
|
return {
|
|
53
56
|
id: contextId,
|
|
54
57
|
prefix,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/env",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.1163+65b042cd",
|
|
4
4
|
"description": "Environment variable support for Optique",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false,
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@optique/core": "1.0.0-dev.
|
|
57
|
+
"@optique/core": "1.0.0-dev.1163+65b042cd"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^20.19.9",
|