fs-realpath-native 1.0.1 → 1.0.3

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,36 @@
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
+ ## [1.0.3](https://github.com/bluelovers/ws-iconv/compare/fs-realpath-native@1.0.2...fs-realpath-native@1.0.3) (2024-08-29)
7
+
8
+
9
+
10
+ ### 🛠 Build System
11
+
12
+ * update build ([263e72e](https://github.com/bluelovers/ws-iconv/commit/263e72e423867a305d52992f40543e2efd19a349))
13
+
14
+
15
+
16
+ ## 1.0.2 (2022-10-18)
17
+
18
+
19
+
20
+ ### 📦 Code Refactoring
21
+
22
+ * { realpathSync => realpathSync.native } ([252c33e](https://github.com/bluelovers/ws-iconv/commit/252c33eff4a210e243ce6d8c4a968ad12bb1fbaf))
23
+
24
+
25
+ ### ♻️ Chores
26
+
27
+ * **release:** publish ([e6dea90](https://github.com/bluelovers/ws-iconv/commit/e6dea90eaa22e331d180711d3ec4c4d430fce071))
28
+
29
+
30
+ ### 🔖 Miscellaneous
31
+
32
+ * . ([4f93586](https://github.com/bluelovers/ws-iconv/commit/4f935869e8c34060553109cc23e9f0e4d6003878))
33
+
34
+
35
+
6
36
  ## 1.0.1 (2022-10-18)
7
37
 
8
38
 
package/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { BufferEncodingOption, EncodingOption, PathLike, realpathSync } from 'fs';
4
2
  export declare const fsRealpathNativeSync: typeof realpathSync.native;
5
3
  export declare function fsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string>;
package/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryFsRealpathNativeAsync = exports.tryFsRealpathNativeSync = exports.fsRealpathNativeAsync = exports.fsRealpathNativeSync = void 0;
3
+ exports.fsRealpathNativeSync = void 0;
4
+ exports.fsRealpathNativeAsync = fsRealpathNativeAsync;
5
+ exports.tryFsRealpathNativeSync = tryFsRealpathNativeSync;
6
+ exports.tryFsRealpathNativeAsync = tryFsRealpathNativeAsync;
4
7
  const fs_1 = require("fs");
5
8
  exports.fsRealpathNativeSync = fs_1.realpathSync.native;
6
9
  async function fsRealpathNativeAsync(path, options) {
7
10
  return (0, exports.fsRealpathNativeSync)(path, options);
8
11
  }
9
- exports.fsRealpathNativeAsync = fsRealpathNativeAsync;
10
12
  function tryFsRealpathNativeSync(path, options) {
11
13
  try {
12
14
  path = fs_1.realpathSync.native(path, options);
@@ -18,10 +20,8 @@ function tryFsRealpathNativeSync(path, options) {
18
20
  }
19
21
  return path;
20
22
  }
21
- exports.tryFsRealpathNativeSync = tryFsRealpathNativeSync;
22
23
  async function tryFsRealpathNativeAsync(path, options) {
23
24
  return tryFsRealpathNativeSync(path, options);
24
25
  }
25
- exports.tryFsRealpathNativeAsync = tryFsRealpathNativeAsync;
26
26
  exports.default = tryFsRealpathNativeSync;
27
27
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2BAAkF;AAErE,QAAA,oBAAoB,GAAG,iBAAY,CAAC,MAAM,CAAC;AAKjD,KAAK,UAAU,qBAAqB,CAAC,IAAc,EACzD,OAA+C;IAG/C,OAAO,IAAA,4BAAoB,EAAC,IAAI,EAAE,OAAc,CAAC,CAAA;AAClD,CAAC;AALD,sDAKC;AAQD,SAAgB,uBAAuB,CAAC,IAAc,EAAE,OAA+C;IAEtG,IACA;QACC,IAAI,GAAG,iBAAY,CAAC,MAAM,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;KACjD;IACD,OAAO,KAAU,EACjB;QACC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAC3B;YACC,MAAM,KAAK,CAAC;SACZ;KACD;IAED,OAAO,IAAW,CAAC;AACpB,CAAC;AAfD,0DAeC;AAKM,KAAK,UAAU,wBAAwB,CAAC,IAAc,EAAE,OAA+C;IAE7G,OAAO,uBAAuB,CAAC,IAAI,EAAE,OAAc,CAAC,CAAA;AACrD,CAAC;AAHD,4DAGC;AAED,kBAAe,uBAAuB,CAAA","sourcesContent":["import { BufferEncodingOption, EncodingOption, PathLike, realpathSync } from 'fs';\n\nexport const fsRealpathNativeSync = realpathSync.native;\n\nexport async function fsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string>;\nexport async function fsRealpathNativeAsync(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;\nexport async function fsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;\nexport async function fsRealpathNativeAsync(path: PathLike,\n\toptions?: BufferEncodingOption | EncodingOption\n): Promise<string | Buffer>\n{\n\treturn fsRealpathNativeSync(path, options as any)\n}\n\n/**\n * @see https://github.com/facebook/jest/blob/main/packages/jest-util/src/tryRealpath.ts\n */\nexport function tryFsRealpathNativeSync(path: PathLike, options?: EncodingOption): string;\nexport function tryFsRealpathNativeSync(path: PathLike, options: BufferEncodingOption): Buffer;\nexport function tryFsRealpathNativeSync(path: PathLike, options?: EncodingOption): string | Buffer;\nexport function tryFsRealpathNativeSync(path: PathLike, options?: BufferEncodingOption | EncodingOption): string | Buffer\n{\n\ttry\n\t{\n\t\tpath = realpathSync.native(path, options as any);\n\t}\n\tcatch (error: any)\n\t{\n\t\tif (error.code !== 'ENOENT')\n\t\t{\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\treturn path as any;\n}\n\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: BufferEncodingOption | EncodingOption): Promise<string | Buffer>\n{\n\treturn tryFsRealpathNativeSync(path, options as any)\n}\n\nexport default tryFsRealpathNativeSync\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAOA,sDAKC;AAQD,0DAeC;AAKD,4DAGC;AA3CD,2BAAkF;AAErE,QAAA,oBAAoB,GAAG,iBAAY,CAAC,MAAM,CAAC;AAKjD,KAAK,UAAU,qBAAqB,CAAC,IAAc,EACzD,OAA+C;IAG/C,OAAO,IAAA,4BAAoB,EAAC,IAAI,EAAE,OAAc,CAAC,CAAA;AAClD,CAAC;AAQD,SAAgB,uBAAuB,CAAC,IAAc,EAAE,OAA+C;IAEtG,IACA,CAAC;QACA,IAAI,GAAG,iBAAY,CAAC,MAAM,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAU,EACjB,CAAC;QACA,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAC3B,CAAC;YACA,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,IAAW,CAAC;AACpB,CAAC;AAKM,KAAK,UAAU,wBAAwB,CAAC,IAAc,EAAE,OAA+C;IAE7G,OAAO,uBAAuB,CAAC,IAAI,EAAE,OAAc,CAAC,CAAA;AACrD,CAAC;AAED,kBAAe,uBAAuB,CAAA","sourcesContent":["import { BufferEncodingOption, EncodingOption, PathLike, realpathSync } from 'fs';\n\nexport const fsRealpathNativeSync = realpathSync.native;\n\nexport async function fsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string>;\nexport async function fsRealpathNativeAsync(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;\nexport async function fsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;\nexport async function fsRealpathNativeAsync(path: PathLike,\n\toptions?: BufferEncodingOption | EncodingOption\n): Promise<string | Buffer>\n{\n\treturn fsRealpathNativeSync(path, options as any)\n}\n\n/**\n * @see https://github.com/facebook/jest/blob/main/packages/jest-util/src/tryRealpath.ts\n */\nexport function tryFsRealpathNativeSync(path: PathLike, options?: EncodingOption): string;\nexport function tryFsRealpathNativeSync(path: PathLike, options: BufferEncodingOption): Buffer;\nexport function tryFsRealpathNativeSync(path: PathLike, options?: EncodingOption): string | Buffer;\nexport function tryFsRealpathNativeSync(path: PathLike, options?: BufferEncodingOption | EncodingOption): string | Buffer\n{\n\ttry\n\t{\n\t\tpath = realpathSync.native(path, options as any);\n\t}\n\tcatch (error: any)\n\t{\n\t\tif (error.code !== 'ENOENT')\n\t\t{\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\treturn path as any;\n}\n\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: EncodingOption): Promise<string | Buffer>;\nexport async function tryFsRealpathNativeAsync(path: PathLike, options?: BufferEncodingOption | EncodingOption): Promise<string | Buffer>\n{\n\treturn tryFsRealpathNativeSync(path, options as any)\n}\n\nexport default tryFsRealpathNativeSync\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fs-realpath-native",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "create-by-yarn-tool"
@@ -17,7 +17,7 @@
17
17
  "license": "ISC",
18
18
  "author": "bluelovers",
19
19
  "sideEffects": false,
20
- "main": "jest.config.js",
20
+ "main": "index.js",
21
21
  "directories": {
22
22
  "test": "test"
23
23
  },
@@ -62,5 +62,5 @@
62
62
  "tsc:showConfig": "ynpx get-current-tsconfig -p"
63
63
  },
64
64
  "packageManager": "yarn@1.22.19",
65
- "gitHead": "e6dea90eaa22e331d180711d3ec4c4d430fce071"
65
+ "gitHead": "43bcf89adcf481e321b509f7510de10206e8030a"
66
66
  }
package/jest.config.js DELETED
@@ -1,116 +0,0 @@
1
- // @ts-check
2
-
3
- const { basename, extname, dirname } = require('path');
4
-
5
- /**
6
- * // @type { import('@jest/types').Config.InitialOptions }
7
- * @type { import('ts-jest').InitialOptionsTsJest }
8
- */
9
- let jestConfig = {
10
-
11
- }
12
-
13
- /**
14
- * @param {string} name
15
- * @returns {string}
16
- * @private
17
- */
18
- function _requireResolve(name)
19
- {
20
- let result;
21
-
22
- try
23
- {
24
- // @ts-ignore
25
- const { requireResolveExtra, requireResolveCore } = require('@yarn-tool/require-resolve');
26
-
27
- const paths = [
28
- requireResolveExtra('@bluelovers/tsdx').result,
29
- requireResolveExtra('tsdx').result,
30
- ].filter(Boolean);
31
-
32
- result = requireResolveCore(name, {
33
- includeGlobal: true,
34
- includeCurrentDirectory: true,
35
- paths,
36
- })
37
- }
38
- catch (e)
39
- {
40
-
41
- }
42
-
43
- result = result || require.resolve(name);
44
-
45
- console.info('[require.resolve]', name, '=>', result)
46
-
47
- return result
48
- }
49
-
50
- let _ok = true;
51
-
52
- try
53
- {
54
- if (!jestConfig.preset)
55
- {
56
-
57
- let result = require('@yarn-tool/ws-find-up-paths').findUpPathsWorkspaces([
58
- 'jest-preset.js',
59
- 'jest.config.js',
60
- ], {
61
- ignoreCurrentPackage: true,
62
- onlyFiles: true,
63
- }).result;
64
-
65
- if (result)
66
- {
67
- let name = basename(result, extname(result))
68
-
69
- switch (name)
70
- {
71
- case 'jest-preset':
72
- jestConfig.preset = dirname(result);
73
- break;
74
- default:
75
- jestConfig = {
76
- ...require(result),
77
- jestConfig,
78
- };
79
- break;
80
- }
81
-
82
- _ok = false;
83
- }
84
- }
85
- }
86
- catch (e)
87
- {
88
-
89
- }
90
-
91
- try
92
- {
93
- if (_ok && !jestConfig.preset)
94
- {
95
- let result = _requireResolve('@bluelovers/jest-config/package.json');
96
- if (result)
97
- {
98
- jestConfig.preset = dirname(result);
99
- _ok = false;
100
- }
101
- }
102
- }
103
- catch (e)
104
- {
105
-
106
- }
107
-
108
- if (_ok && !jestConfig.preset)
109
- {
110
- jestConfig.preset = '@bluelovers/jest-config';
111
- _ok = false;
112
- }
113
-
114
- console.info(`jest.config.preset: ${jestConfig.preset}`);
115
-
116
- module.exports = jestConfig