@yarn-tool/env-path 2.0.1 → 2.0.4
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/CHANGELOG.md +47 -0
- package/index.d.ts +17 -16
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,53 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.4](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/env-path@2.0.3...@yarn-tool/env-path@2.0.4) (2022-09-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 📚 Documentation
|
|
11
|
+
|
|
12
|
+
* update deps ([94577dd](https://github.com/bluelovers/ws-yarn-workspaces/commit/94577dd1dcf59585177b59ecf1e7e289a3b87758))
|
|
13
|
+
* add directory ([442a552](https://github.com/bluelovers/ws-yarn-workspaces/commit/442a55232619f7fe2b9bad6f8eccfffc4f8f47d2))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 📌 Dependencies
|
|
17
|
+
|
|
18
|
+
* { path-env => path-env2 } ([ce47980](https://github.com/bluelovers/ws-yarn-workspaces/commit/ce47980f531d443f97fb00dc35aa4739eb8be968))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### 🔖 Miscellaneous
|
|
22
|
+
|
|
23
|
+
* . ([3a7fdc9](https://github.com/bluelovers/ws-yarn-workspaces/commit/3a7fdc924ada93b1d0ac0160f8d77e46ff060588))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [2.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/env-path@2.0.2...@yarn-tool/env-path@2.0.3) (2022-08-26)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### 🔖 Miscellaneous
|
|
32
|
+
|
|
33
|
+
* . ([157d5dc](https://github.com/bluelovers/ws-yarn-workspaces/commit/157d5dc8959261d9326f6e633987182898ae9670))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [2.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/env-path@2.0.1...@yarn-tool/env-path@2.0.2) (2022-08-13)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### 🚨 Tests
|
|
41
|
+
|
|
42
|
+
* update jest.config.js and deps ([d1d501b](https://github.com/bluelovers/ws-yarn-workspaces/commit/d1d501ba059130bd8f90e6eaa266084110698011))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### 🛠 Build System
|
|
46
|
+
|
|
47
|
+
* update typescript ([b69b593](https://github.com/bluelovers/ws-yarn-workspaces/commit/b69b593d511d9d4e246513dc1d69721150b9cfe8))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
6
53
|
## [2.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/env-path@2.0.0...@yarn-tool/env-path@2.0.1) (2022-07-31)
|
|
7
54
|
|
|
8
55
|
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IRecordLike } from 'value-from-record';
|
|
3
|
-
|
|
3
|
+
import { IPathDelimiter } from 'path-env2';
|
|
4
|
+
export type { IPathDelimiter };
|
|
4
5
|
declare const delimiter: IPathDelimiter;
|
|
5
6
|
export { delimiter };
|
|
6
7
|
export declare function processEnv(ignoreErrors?: boolean): NodeJS.ProcessEnv;
|
|
@@ -9,23 +10,23 @@ export declare function getEnvPathValue(env?: IRecordLike<string, any>, key?: st
|
|
|
9
10
|
export declare function setEnvPathValue(value: string | string[], env?: IRecordLike<string, string>, key?: string, delim?: IPathDelimiter): IRecordLike<string, string>;
|
|
10
11
|
export declare function envPathObject(env?: IRecordLike<string, any>, key?: string, delim?: IPathDelimiter): {
|
|
11
12
|
get: {
|
|
12
|
-
factory
|
|
13
|
-
string
|
|
14
|
-
array
|
|
15
|
-
delim
|
|
16
|
-
name
|
|
13
|
+
factory(): import("path-env2").IPathFactory;
|
|
14
|
+
string(): string;
|
|
15
|
+
array(): import("path-env2").IPathArray;
|
|
16
|
+
delim(): IPathDelimiter;
|
|
17
|
+
name(): string;
|
|
17
18
|
};
|
|
18
19
|
set: {
|
|
19
|
-
factory
|
|
20
|
-
string
|
|
21
|
-
array
|
|
22
|
-
delim
|
|
23
|
-
name
|
|
20
|
+
factory(x: import("path-env2").IPathFactory): import("path-env2").IEnvFactory;
|
|
21
|
+
string(x: string): import("path-env2").IEnvFactory;
|
|
22
|
+
array(x: import("path-env2").IPathArray): import("path-env2").IEnvFactory;
|
|
23
|
+
delim(x: IPathDelimiter): import("path-env2").IEnvFactory;
|
|
24
|
+
name(x: string): import("path-env2").IEnvFactory;
|
|
24
25
|
};
|
|
25
|
-
append
|
|
26
|
-
prepend
|
|
27
|
-
surround
|
|
28
|
-
deduplicate
|
|
26
|
+
append(addend: import("path-env2").IPathArray): import("path-env2").IEnvFactory;
|
|
27
|
+
prepend(addend: import("path-env2").IPathArray): import("path-env2").IEnvFactory;
|
|
28
|
+
surround(addend: import("path-env2").IPathArray): import("path-env2").IEnvFactory;
|
|
29
|
+
deduplicate(): import("path-env2").IEnvFactory;
|
|
29
30
|
};
|
|
30
|
-
export declare function envObject(env?: IRecordLike<string, any>, key?: string, delim?: IPathDelimiter): import("path-
|
|
31
|
+
export declare function envObject(env?: IRecordLike<string, any>, key?: string, delim?: IPathDelimiter): import("path-env2").IEnvFactory;
|
|
31
32
|
export default envPathObject;
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.envObject = exports.envPathObject = exports.setEnvPathValue = exports.getEnvPathValue = exports.envPathKey = exports.processEnv = exports.delimiter = void 0;
|
|
4
4
|
const value_from_record_1 = require("value-from-record");
|
|
5
|
-
const
|
|
5
|
+
const path_env2_1 = require("path-env2");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const delimiter = path_1.delimiter;
|
|
8
8
|
exports.delimiter = delimiter;
|
|
@@ -47,7 +47,7 @@ function envObject(env, key, delim) {
|
|
|
47
47
|
if (typeof env.entries === 'function') {
|
|
48
48
|
env = Object.fromEntries((0, value_from_record_1.entriesOfRecord)(env));
|
|
49
49
|
}
|
|
50
|
-
return (0,
|
|
50
|
+
return (0, path_env2_1.pathEnv)(env, key, delim);
|
|
51
51
|
}
|
|
52
52
|
exports.envObject = envObject;
|
|
53
53
|
exports.default = envPathObject;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yDAM2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yDAM2B;AAC3B,yCAAoD;AACpD,+BAA+C;AAI/C,MAAM,SAAS,GAAmB,gBAAiB,CAAC;AAE3C,8BAAS;AAElB,SAAgB,UAAU,CAAC,YAAsB;IAEhD,IACA;QACC,OAAO,OAAO,CAAC,GAAG,CAAA;KAClB;IACD,OAAO,CAAC,EACR;QACC,IAAI,CAAC,YAAY,EACjB;YACC,MAAM,CAAC,CAAA;SACP;KACD;AACF,CAAC;AAbD,gCAaC;AAED,SAAgB,UAAU,CAAC,GAA8B;IAExD,OAAO,IAAA,iCAAa,EAAC,MAAM,EAAE,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,UAAU,EAAE,CAAC,CAAA;AAClD,CAAC;AAHD,gCAGC;AAED,SAAgB,eAAe,CAAC,GAA8B,EAC7D,GAAY;IAGZ,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,EAAE,EAAC;IACrB,GAAG,aAAH,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;IAED,OAAO,IAAA,mBAAO,EAAC,GAAuB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AACpD,CAAC;AAfD,8BAeC;AAED,kBAAe,aAAa,CAAA","sourcesContent":["import {\n\tvalueFromRecord,\n\tIRecordLike,\n\tkeyFromRecord,\n\tentriesOfRecord,\n\tsetRecordValue,\n} from 'value-from-record';\nimport { pathEnv, IPathDelimiter } from 'path-env2';\nimport { delimiter as _delimiter } from 'path';\n\nexport type { IPathDelimiter }\n\nconst delimiter: IPathDelimiter = _delimiter as any;\n\nexport { delimiter }\n\nexport function processEnv(ignoreErrors?: boolean)\n{\n\ttry\n\t{\n\t\treturn process.env\n\t}\n\tcatch (e)\n\t{\n\t\tif (!ignoreErrors)\n\t\t{\n\t\t\tthrow e\n\t\t}\n\t}\n}\n\nexport function envPathKey(env?: IRecordLike<string, any>): string\n{\n\treturn keyFromRecord('PATH', env ?? processEnv())\n}\n\nexport function getEnvPathValue(env?: IRecordLike<string, any>,\n\tkey?: string,\n): string\n{\n\tenv ??= processEnv();\n\tkey ??= envPathKey(env);\n\n\treturn valueFromRecord(key, env)\n}\n\nexport function setEnvPathValue(value: string | string[], env?: IRecordLike<string, string>,\n\tkey?: string,\n\tdelim?: IPathDelimiter,\n)\n{\n\tenv ??= processEnv();\n\tkey ??= envPathKey(env);\n\n\tif (typeof value !== 'string')\n\t{\n\t\tvalue = [...value].join(delim ?? delimiter);\n\t}\n\n\treturn setRecordValue(value, key, env)\n}\n\nexport function envPathObject(env?: IRecordLike<string, any>,\n\tkey?: string,\n\tdelim?: IPathDelimiter,\n)\n{\n\treturn envObject(env, key, delim).path\n}\n\nexport function envObject(env?: IRecordLike<string, any>,\n\tkey?: string,\n\tdelim?: IPathDelimiter,\n)\n{\n\tenv ??= processEnv();\n\tkey ??= envPathKey(env);\n\tdelim ??= delimiter;\n\n\tif (typeof (env as Map<any, any>).entries === 'function')\n\t{\n\t\tenv = Object.fromEntries(entriesOfRecord(env))\n\t}\n\n\treturn pathEnv(env as Record<any, any>, key, delim)\n}\n\nexport default envPathObject\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarn-tool/env-path",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yarn",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git"
|
|
25
|
+
"url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git",
|
|
26
|
+
"directory": "packages/@yarn-tool/env-path"
|
|
26
27
|
},
|
|
27
28
|
"license": "ISC",
|
|
28
29
|
"author": "bluelovers",
|
|
@@ -32,7 +33,9 @@
|
|
|
32
33
|
"lint": "ynpx --quiet eslint -- **/*.ts",
|
|
33
34
|
"test": "jest --passWithNoTests",
|
|
34
35
|
"test:jest": "jest --passWithNoTests",
|
|
36
|
+
"test:jest:snapshot": "yarn run test:jest -- -u",
|
|
35
37
|
"test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
|
|
38
|
+
"test:snapshot": "yarn run test -- -u",
|
|
36
39
|
"preversion": "echo preversion && yarn run test",
|
|
37
40
|
"prepublishOnly:update": "yarn run ncu && yarn run sort-package-json",
|
|
38
41
|
"ncu": "yarn-tool ncu -u",
|
|
@@ -40,13 +43,13 @@
|
|
|
40
43
|
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
|
-
"path-
|
|
44
|
-
"tslib": "
|
|
45
|
-
"value-from-record": "^3.0.
|
|
46
|
+
"path-env2": "^1.0.0",
|
|
47
|
+
"tslib": ">=2",
|
|
48
|
+
"value-from-record": "^3.0.3"
|
|
46
49
|
},
|
|
47
50
|
"packageManager": "yarn@1.22.19",
|
|
48
51
|
"publishConfig": {
|
|
49
52
|
"access": "public"
|
|
50
53
|
},
|
|
51
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "fccc2913440df31b04f2971e479fbe1d4c3a7a0c"
|
|
52
55
|
}
|