@yarn-tool/env-path 2.0.3 → 2.0.5

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 CHANGED
@@ -3,6 +3,37 @@
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.5](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/env-path@2.0.4...@yarn-tool/env-path@2.0.5) (2022-09-27)
7
+
8
+
9
+
10
+ ### 🔖 Miscellaneous
11
+
12
+ * . ([5a4bc19](https://github.com/bluelovers/ws-yarn-workspaces/commit/5a4bc19a0a279a49e752d776279165e14c402427))
13
+
14
+
15
+
16
+ ## [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)
17
+
18
+
19
+
20
+ ### 📚 Documentation
21
+
22
+ * update deps ([94577dd](https://github.com/bluelovers/ws-yarn-workspaces/commit/94577dd1dcf59585177b59ecf1e7e289a3b87758))
23
+ * add directory ([442a552](https://github.com/bluelovers/ws-yarn-workspaces/commit/442a55232619f7fe2b9bad6f8eccfffc4f8f47d2))
24
+
25
+
26
+ ### 📌 Dependencies
27
+
28
+ * { path-env => path-env2 } ([ce47980](https://github.com/bluelovers/ws-yarn-workspaces/commit/ce47980f531d443f97fb00dc35aa4739eb8be968))
29
+
30
+
31
+ ### 🔖 Miscellaneous
32
+
33
+ * . ([3a7fdc9](https://github.com/bluelovers/ws-yarn-workspaces/commit/3a7fdc924ada93b1d0ac0160f8d77e46ff060588))
34
+
35
+
36
+
6
37
  ## [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)
7
38
 
8
39
 
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { IRecordLike } from 'value-from-record';
3
- export type IPathDelimiter = ':' | ';';
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: () => import("path-env").PathFactory;
13
- string: () => string;
14
- array: () => import("path-env").PathArray;
15
- delim: () => import("path-env").PathDelimiter;
16
- name: () => string;
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: (x: import("path-env").PathFactory) => import("path-env").EnvFactory;
20
- string: (x: string) => import("path-env").EnvFactory;
21
- array: (x: import("path-env").PathArray) => import("path-env").EnvFactory;
22
- delim: (x: import("path-env").PathDelimiter) => import("path-env").EnvFactory;
23
- name: (x: string) => import("path-env").EnvFactory;
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: (addend: import("path-env").PathArray) => import("path-env").EnvFactory;
26
- prepend: (addend: import("path-env").PathArray) => import("path-env").EnvFactory;
27
- surround: (addend: import("path-env").PathArray) => import("path-env").EnvFactory;
28
- deduplicate: () => import("path-env").EnvFactory;
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-env").EnvFactory;
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 path_env_1 = require("path-env");
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, path_env_1.pathEnv)(env, key, delim);
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,uCAAmC;AACnC,+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;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G,IAAH,GAAG,GAAK,UAAU,CAAC,GAAG,CAAC,EAAC;IACxB,KAAK,aAAL,KAAK,cAAL,KAAK,IAAL,KAAK,GAAK,SAAS,EAAC;IAEpB,IAAI,OAAQ,GAAqB,CAAC,OAAO,KAAK,UAAU,EACxD;QACC,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,IAAA,mCAAe,EAAC,GAAG,CAAC,CAAC,CAAA;KAC9C;IAED,OAAO,IAAA,kBAAO,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 } from 'path-env';\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"]}
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,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,CAAC,GAAG,CAAC,EAAC;IAExB,OAAO,IAAA,mCAAe,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AACjC,CAAC;AARD,0CAQC;AAED,SAAgB,eAAe,CAAC,KAAwB,EAAE,GAAiC,EAC1F,GAAY,EACZ,KAAsB;IAGtB,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,EAAE,EAAC;IACrB,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,CAAC,GAAG,CAAC,EAAC;IAExB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAC7B;QACC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,SAAS,CAAC,CAAC;KAC5C;IAED,OAAO,IAAA,kCAAc,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACvC,CAAC;AAdD,0CAcC;AAED,SAAgB,aAAa,CAAC,GAA8B,EAC3D,GAAY,EACZ,KAAsB;IAGtB,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI,CAAA;AACvC,CAAC;AAND,sCAMC;AAED,SAAgB,SAAS,CAAC,GAA8B,EACvD,GAAY,EACZ,KAAsB;IAGtB,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,EAAE,EAAC;IACrB,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,UAAU,CAAC,GAAG,CAAC,EAAC;IACxB,KAAK,aAAL,KAAK,cAAL,KAAK,IAAL,KAAK,GAAK,SAAS,EAAC;IAEpB,IAAI,OAAQ,GAAqB,CAAC,OAAO,KAAK,UAAU,EACxD;QACC,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,IAAA,mCAAe,EAAC,GAAG,CAAC,CAAC,CAAA;KAC9C;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",
3
+ "version": "2.0.5",
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",
@@ -35,6 +36,7 @@
35
36
  "test:jest:snapshot": "yarn run test:jest -- -u",
36
37
  "test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
37
38
  "test:snapshot": "yarn run test -- -u",
39
+ "test:tsd": "ynpx tsd",
38
40
  "preversion": "echo preversion && yarn run test",
39
41
  "prepublishOnly:update": "yarn run ncu && yarn run sort-package-json",
40
42
  "ncu": "yarn-tool ncu -u",
@@ -42,13 +44,13 @@
42
44
  "tsc:showConfig": "ynpx get-current-tsconfig -p"
43
45
  },
44
46
  "dependencies": {
45
- "path-env": "^0.0.12",
46
- "tslib": "^2",
47
- "value-from-record": "^3.0.1"
47
+ "path-env2": "^1.0.0",
48
+ "tslib": ">=2",
49
+ "value-from-record": "^3.0.3"
48
50
  },
49
51
  "packageManager": "yarn@1.22.19",
50
52
  "publishConfig": {
51
53
  "access": "public"
52
54
  },
53
- "gitHead": "150365d3846067505842c6503564abe98ebe508d"
55
+ "gitHead": "863a1f489a32c38c98313e4edd11f59d0c035d96"
54
56
  }