@lindorm/config 0.1.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/.env.test +1 -0
- package/CHANGELOG.md +11 -0
- package/README.md +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/configuration.d.ts +14 -0
- package/dist/utils/configuration.d.ts.map +1 -0
- package/dist/utils/configuration.js +27 -0
- package/dist/utils/configuration.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/private/find-process-env-value.d.ts +3 -0
- package/dist/utils/private/find-process-env-value.d.ts.map +1 -0
- package/dist/utils/private/find-process-env-value.js +24 -0
- package/dist/utils/private/find-process-env-value.js.map +1 -0
- package/dist/utils/private/index.d.ts +2 -0
- package/dist/utils/private/index.d.ts.map +1 -0
- package/dist/utils/private/index.js +18 -0
- package/dist/utils/private/index.js.map +1 -0
- package/dist/utils/private/merge-object-with-process-env.d.ts +4 -0
- package/dist/utils/private/merge-object-with-process-env.d.ts.map +1 -0
- package/dist/utils/private/merge-object-with-process-env.js +17 -0
- package/dist/utils/private/merge-object-with-process-env.js.map +1 -0
- package/dist/utils/private/merge-value-with-process-env.d.ts +3 -0
- package/dist/utils/private/merge-value-with-process-env.d.ts.map +1 -0
- package/dist/utils/private/merge-value-with-process-env.js +10 -0
- package/dist/utils/private/merge-value-with-process-env.js.map +1 -0
- package/package.json +40 -0
package/.env.test
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
WITH_DOT_ENV_REPLACEMENT="two"
|
package/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
# 0.1.0 (2024-09-20)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- initialise config package ([cd119e3](https://github.com/lindorm-io/monorepo/commit/cd119e37df2a5fa9979d21e56e5835864ba0744b))
|
11
|
+
- initialise configuration package ([42b8b41](https://github.com/lindorm-io/monorepo/commit/42b8b414a6fc2845a79fa89fabd0c0ff89dd3477))
|
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# @lindorm/config
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./utils"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./types"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ChangeCase } from "@lindorm/case";
|
2
|
+
import { Dict } from "@lindorm/types";
|
3
|
+
type NpmInformation = {
|
4
|
+
npm: {
|
5
|
+
package: {
|
6
|
+
name: string;
|
7
|
+
version: string;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
};
|
11
|
+
type Configuration<T extends Dict = Dict> = NpmInformation & T;
|
12
|
+
export declare const configuration: <T extends Dict = Dict>(mode?: ChangeCase) => Configuration<T>;
|
13
|
+
export {};
|
14
|
+
//# sourceMappingURL=configuration.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAc,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE;QACH,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,cAAc,GAAG,CAAC,CAAC;AAE/D,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,IAAI,gBACpC,UAAU,KACf,aAAa,CAAC,CAAC,CAiBjB,CAAC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.configuration = void 0;
|
7
|
+
const dotenvx_1 = __importDefault(require("@dotenvx/dotenvx"));
|
8
|
+
const case_1 = require("@lindorm/case");
|
9
|
+
const config_1 = __importDefault(require("config"));
|
10
|
+
const private_1 = require("./private");
|
11
|
+
const configuration = (mode = case_1.ChangeCase.Camel) => {
|
12
|
+
dotenvx_1.default.config({
|
13
|
+
path: process.env.NODE_ENV ? [`.env.${process.env.NODE_ENV}`, ".env"] : ".env",
|
14
|
+
quiet: true,
|
15
|
+
});
|
16
|
+
const merged = (0, private_1.mergeObjectWithProcessEnv)(process.env, config_1.default.util.toObject());
|
17
|
+
const config = (0, case_1.changeKeys)(merged, mode);
|
18
|
+
const npm = {
|
19
|
+
package: {
|
20
|
+
name: process.env.npm_package_name || "",
|
21
|
+
version: process.env.npm_package_version || "",
|
22
|
+
},
|
23
|
+
};
|
24
|
+
return { npm, ...config };
|
25
|
+
};
|
26
|
+
exports.configuration = configuration;
|
27
|
+
//# sourceMappingURL=configuration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/utils/configuration.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAuC;AACvC,wCAAuD;AAEvD,oDAAuB;AACvB,uCAAsD;AAa/C,MAAM,aAAa,GAAG,CAC3B,OAAmB,iBAAU,CAAC,KAAK,EACjB,EAAE;IACpB,iBAAO,CAAC,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM;QAC9E,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,mCAAyB,EAAI,OAAO,CAAC,GAAG,EAAE,gBAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAI,MAAM,EAAE,IAAI,CAAC,CAAC;IAE3C,MAAM,GAAG,GAAG;QACV,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;YACxC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE;SAC/C;KACF,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;AAC5B,CAAC,CAAC;AAnBW,QAAA,aAAa,iBAmBxB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./configuration"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"find-process-env-value.d.ts","sourceRoot":"","sources":["../../../src/utils/private/find-process-env-value.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC,eAAO,MAAM,mBAAmB,eAClB,UAAU,OACjB,MAAM,cACC,MAAM,KACjB,MAAM,GAAG,IAYX,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.findProcessEnvValue = void 0;
|
4
|
+
const case_1 = require("@lindorm/case");
|
5
|
+
const is_1 = require("@lindorm/is");
|
6
|
+
const tryParse = (value) => {
|
7
|
+
try {
|
8
|
+
return JSON.parse(value);
|
9
|
+
}
|
10
|
+
catch {
|
11
|
+
return value;
|
12
|
+
}
|
13
|
+
};
|
14
|
+
const findProcessEnvValue = (processEnv, key, parentKey) => {
|
15
|
+
const k = (0, case_1.changeCase)(key, case_1.ChangeCase.Constant);
|
16
|
+
const p = parentKey ? (0, case_1.changeCase)(parentKey, case_1.ChangeCase.Constant) : null;
|
17
|
+
const search = p ? `${p}_${k}` : k;
|
18
|
+
const value = processEnv[search] ? processEnv[search] : null;
|
19
|
+
const parsed = value ? tryParse(value) : null;
|
20
|
+
const splitArray = (0, is_1.isString)(parsed) && parsed.includes(";") ? parsed.split(";").map(tryParse) : null;
|
21
|
+
return splitArray ? splitArray : parsed;
|
22
|
+
};
|
23
|
+
exports.findProcessEnvValue = findProcessEnvValue;
|
24
|
+
//# sourceMappingURL=find-process-env-value.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"find-process-env-value.js","sourceRoot":"","sources":["../../../src/utils/private/find-process-env-value.ts"],"names":[],"mappings":";;;AAAA,wCAAuD;AACvD,oCAAuC;AAGvC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAO,EAAE;IACtC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,CACjC,UAAsB,EACtB,GAAW,EACX,SAAkB,EACH,EAAE;IACjB,MAAM,CAAC,GAAW,IAAA,iBAAU,EAAC,GAAG,EAAE,iBAAU,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,GAAkB,SAAS,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,SAAS,EAAE,iBAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvF,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE7D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,MAAM,UAAU,GACd,IAAA,aAAQ,EAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEpF,OAAO,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;AAC1C,CAAC,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/private/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./merge-object-with-process-env"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/private/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { Dict } from "@lindorm/types";
|
2
|
+
import { ProcessEnv } from "../../types";
|
3
|
+
export declare const mergeObjectWithProcessEnv: <T extends Dict = Dict>(processEnv: ProcessEnv, config: T, parentKey?: string) => T;
|
4
|
+
//# sourceMappingURL=merge-object-with-process-env.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"merge-object-with-process-env.d.ts","sourceRoot":"","sources":["../../../src/utils/private/merge-object-with-process-env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,IAAI,qBAC1C,UAAU,UACd,CAAC,cACG,MAAM,KACjB,CAYF,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mergeObjectWithProcessEnv = void 0;
|
4
|
+
const is_1 = require("@lindorm/is");
|
5
|
+
const merge_value_with_process_env_1 = require("./merge-value-with-process-env");
|
6
|
+
const mergeObjectWithProcessEnv = (processEnv, config, parentKey) => {
|
7
|
+
const result = {};
|
8
|
+
for (const [key, value] of Object.entries(config)) {
|
9
|
+
const p = parentKey ? `${parentKey}_${key}` : key;
|
10
|
+
result[key] = (0, is_1.isObject)(value)
|
11
|
+
? (0, exports.mergeObjectWithProcessEnv)(processEnv, value, p)
|
12
|
+
: (0, merge_value_with_process_env_1.mergeValueWithProcessEnv)(processEnv, value, key, parentKey);
|
13
|
+
}
|
14
|
+
return result;
|
15
|
+
};
|
16
|
+
exports.mergeObjectWithProcessEnv = mergeObjectWithProcessEnv;
|
17
|
+
//# sourceMappingURL=merge-object-with-process-env.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"merge-object-with-process-env.js","sourceRoot":"","sources":["../../../src/utils/private/merge-object-with-process-env.ts"],"names":[],"mappings":";;;AAAA,oCAAuC;AAGvC,iFAA0E;AAEnE,MAAM,yBAAyB,GAAG,CACvC,UAAsB,EACtB,MAAS,EACT,SAAkB,EACf,EAAE;IACL,MAAM,MAAM,GAAS,EAAE,CAAC;IAExB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAElD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAA,aAAQ,EAAC,KAAK,CAAC;YAC3B,CAAC,CAAC,IAAA,iCAAyB,EAAC,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YACjD,CAAC,CAAC,IAAA,uDAAwB,EAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,MAAW,CAAC;AACrB,CAAC,CAAC;AAhBW,QAAA,yBAAyB,6BAgBpC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"merge-value-with-process-env.d.ts","sourceRoot":"","sources":["../../../src/utils/private/merge-value-with-process-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,eAAO,MAAM,wBAAwB,eACvB,UAAU,SACf,MAAM,OACR,MAAM,cACC,MAAM,KACjB,MAIF,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mergeValueWithProcessEnv = void 0;
|
4
|
+
const find_process_env_value_1 = require("./find-process-env-value");
|
5
|
+
const mergeValueWithProcessEnv = (processEnv, value, key, parentKey) => {
|
6
|
+
const envValue = (0, find_process_env_value_1.findProcessEnvValue)(processEnv, key, parentKey);
|
7
|
+
return envValue ? envValue : value;
|
8
|
+
};
|
9
|
+
exports.mergeValueWithProcessEnv = mergeValueWithProcessEnv;
|
10
|
+
//# sourceMappingURL=merge-value-with-process-env.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"merge-value-with-process-env.js","sourceRoot":"","sources":["../../../src/utils/private/merge-value-with-process-env.ts"],"names":[],"mappings":";;;AACA,qEAA+D;AAExD,MAAM,wBAAwB,GAAG,CACtC,UAAsB,EACtB,KAAa,EACb,GAAW,EACX,SAAkB,EACV,EAAE;IACV,MAAM,QAAQ,GAAG,IAAA,4CAAmB,EAAC,UAAU,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAEjE,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AACrC,CAAC,CAAC;AATW,QAAA,wBAAwB,4BASnC"}
|
package/package.json
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"name": "@lindorm/config",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"license": "AGPL-3.0-or-later",
|
5
|
+
"author": "Jonn Nilsson",
|
6
|
+
"repository": {
|
7
|
+
"url": "https://github.com/lindorm-io/monorepo",
|
8
|
+
"directory": "packages/config"
|
9
|
+
},
|
10
|
+
"bugs": "https://github.com/lindorm-io/monorepo/issues",
|
11
|
+
"publishConfig": {
|
12
|
+
"access": "public"
|
13
|
+
},
|
14
|
+
"main": "dist/index.js",
|
15
|
+
"typings": "dist/index.d.ts",
|
16
|
+
"scripts": {
|
17
|
+
"build": "rimraf dist && tsc -b ./tsconfig.build.json",
|
18
|
+
"example": "ts-node example",
|
19
|
+
"integration": "compd --file docker-compose.yml jest --config jest.config.integration.js --watch --",
|
20
|
+
"test:ci": "npm run test:unit",
|
21
|
+
"test:integration": "jest --config jest.config.integration.js --",
|
22
|
+
"test:unit": "jest --config jest.config.js --",
|
23
|
+
"test": "jest --watch --",
|
24
|
+
"typecheck:ci": "tsc",
|
25
|
+
"typecheck": "tsc --watch",
|
26
|
+
"update": "ncu -u"
|
27
|
+
},
|
28
|
+
"dependencies": {
|
29
|
+
"@dotenvx/dotenvx": "^1.10.3",
|
30
|
+
"@lindorm/case": "^0.1.5",
|
31
|
+
"@lindorm/is": "^0.1.6",
|
32
|
+
"config": "^3.3.12",
|
33
|
+
"dotenv": "^16.4.5"
|
34
|
+
},
|
35
|
+
"devDependencies": {
|
36
|
+
"@lindorm/types": "^0.2.0",
|
37
|
+
"@types/config": "^3.3.4"
|
38
|
+
},
|
39
|
+
"gitHead": "bad333c98cd6f093412f0a7116c2f79e486dc996"
|
40
|
+
}
|