@ledgerhq/live-env 0.0.1
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/.eslintrc.js +57 -0
- package/.turbo/turbo-build.log +4 -0
- package/lib/env.d.ts +30 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +793 -0
- package/lib/env.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib-es/env.d.ts +30 -0
- package/lib-es/env.d.ts.map +1 -0
- package/lib-es/env.js +778 -0
- package/lib-es/env.js.map +1 -0
- package/lib-es/index.d.ts +2 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +2 -0
- package/lib-es/index.js.map +1 -0
- package/package.json +51 -0
- package/src/env.ts +800 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +20 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: "@typescript-eslint/parser",
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es6: true,
|
|
6
|
+
node: true,
|
|
7
|
+
jest: true,
|
|
8
|
+
},
|
|
9
|
+
extends: [
|
|
10
|
+
"eslint:recommended",
|
|
11
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
12
|
+
"plugin:@typescript-eslint/recommended",
|
|
13
|
+
"prettier",
|
|
14
|
+
],
|
|
15
|
+
globals: {
|
|
16
|
+
Atomics: "readonly",
|
|
17
|
+
SharedArrayBuffer: "readonly",
|
|
18
|
+
},
|
|
19
|
+
plugins: ["@typescript-eslint", "prettier"],
|
|
20
|
+
rules: {
|
|
21
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
22
|
+
"linebreak-style": ["error", "unix"],
|
|
23
|
+
semi: ["error", "always"],
|
|
24
|
+
"no-unused-vars": "off",
|
|
25
|
+
"import/prefer-default-export": 0,
|
|
26
|
+
"no-plusplus": 0,
|
|
27
|
+
"no-underscore-dangle": 0,
|
|
28
|
+
"prefer-template": 0,
|
|
29
|
+
"no-await-in-loop": 0,
|
|
30
|
+
"no-restricted-syntax": 0,
|
|
31
|
+
"consistent-return": 0,
|
|
32
|
+
"no-lonely-if": 0,
|
|
33
|
+
"no-use-before-define": 0,
|
|
34
|
+
"no-nested-ternary": 0,
|
|
35
|
+
"import/no-cycle": 0,
|
|
36
|
+
"no-multi-assign": 0,
|
|
37
|
+
"guard-for-in": 0,
|
|
38
|
+
"no-continue": 0,
|
|
39
|
+
"lines-between-class-members": 0,
|
|
40
|
+
"prefer-destructuring": 0,
|
|
41
|
+
"prettier/prettier": "error",
|
|
42
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
43
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
44
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
45
|
+
"@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
|
|
46
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
47
|
+
"@typescript-eslint/ban-types": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
extendDefaults: true,
|
|
51
|
+
types: {
|
|
52
|
+
"{}": false,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
package/lib/env.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Subject } from "rxjs";
|
|
2
|
+
import { $ElementType } from "utility-types";
|
|
3
|
+
type EnvDef<V> = {
|
|
4
|
+
desc: string;
|
|
5
|
+
def: V;
|
|
6
|
+
parser: (arg0: unknown) => V | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
type EnvDefs = typeof envDefinitions;
|
|
9
|
+
type Env = typeof env;
|
|
10
|
+
export type EnvName = keyof EnvDefs;
|
|
11
|
+
export type EnvValue<Name extends EnvName> = $ElementType<Env, Name>;
|
|
12
|
+
declare const envDefinitions: Record<string, EnvDef<boolean | string | number | string[] | unknown>>;
|
|
13
|
+
export declare const getDefinition: (name: string) => EnvDef<any> | null | undefined;
|
|
14
|
+
declare const env: Record<EnvName, any>;
|
|
15
|
+
export declare const getAllEnvNames: () => EnvName[];
|
|
16
|
+
export declare const getAllEnvs: () => Env;
|
|
17
|
+
export declare const getEnv: <Name extends string>(name: Name) => any;
|
|
18
|
+
export declare const getEnvDefault: <Name extends string>(name: Name) => any;
|
|
19
|
+
export declare const isEnvDefault: <Name extends string>(name: Name) => boolean;
|
|
20
|
+
export declare const getEnvDesc: <Name extends string>(name: Name) => string;
|
|
21
|
+
type ChangeValue<T extends EnvName> = {
|
|
22
|
+
name: EnvName;
|
|
23
|
+
value: EnvValue<T>;
|
|
24
|
+
oldValue: EnvValue<T>;
|
|
25
|
+
};
|
|
26
|
+
export declare const changes: Subject<ChangeValue<any>>;
|
|
27
|
+
export declare const setEnv: <Name extends string>(name: Name, value: any) => void;
|
|
28
|
+
export declare const setEnvUnsafe: (name: EnvName, unsafeValue: unknown) => boolean;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=env.d.ts.map
|
package/lib/env.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,KAAK,MAAM,CAAC,CAAC,IAAI;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD,CAAC;AAEF,KAAK,OAAO,GAAG,OAAO,cAAc,CAAC;AACrC,KAAK,GAAG,GAAG,OAAO,GAAG,CAAC;AACtB,M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