quicktype-core 23.3.6 → 23.3.7
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/dist/input/io/NodeIO.js +13 -4
- package/package.json +3 -2
package/dist/input/io/NodeIO.js
CHANGED
|
@@ -47,7 +47,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.readableFromFileOrURL = readableFromFileOrURL;
|
|
49
49
|
exports.readFromFileOrURL = readFromFileOrURL;
|
|
50
|
-
const fs = __importStar(require("
|
|
50
|
+
const fs = __importStar(require("fs"));
|
|
51
|
+
const path = __importStar(require("path"));
|
|
51
52
|
const ts_necessities_1 = require("@glideapps/ts-necessities");
|
|
52
53
|
const browser_or_node_1 = require("browser-or-node");
|
|
53
54
|
const is_url_1 = __importDefault(require("is-url"));
|
|
@@ -72,6 +73,16 @@ function parseHeaders(httpHeaders) {
|
|
|
72
73
|
return result;
|
|
73
74
|
}, {});
|
|
74
75
|
}
|
|
76
|
+
function resolveSymbolicLink(filePath) {
|
|
77
|
+
if (!fs.lstatSync(filePath).isSymbolicLink()) {
|
|
78
|
+
return filePath;
|
|
79
|
+
}
|
|
80
|
+
const linkPath = fs.readlinkSync(filePath);
|
|
81
|
+
if (path.isAbsolute(linkPath)) {
|
|
82
|
+
return linkPath;
|
|
83
|
+
}
|
|
84
|
+
return path.join(path.dirname(filePath), linkPath);
|
|
85
|
+
}
|
|
75
86
|
function readableFromFileOrURL(fileOrURL, httpHeaders) {
|
|
76
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
88
|
try {
|
|
@@ -86,9 +97,7 @@ function readableFromFileOrURL(fileOrURL, httpHeaders) {
|
|
|
86
97
|
// Cast node readable to isomorphic readable from readable-stream
|
|
87
98
|
return process.stdin;
|
|
88
99
|
}
|
|
89
|
-
const filePath =
|
|
90
|
-
? fs.readlinkSync(fileOrURL)
|
|
91
|
-
: fileOrURL;
|
|
100
|
+
const filePath = resolveSymbolicLink(fileOrURL);
|
|
92
101
|
if (fs.existsSync(filePath)) {
|
|
93
102
|
// Cast node readable to isomorphic readable from readable-stream
|
|
94
103
|
return fs.createReadStream(filePath, "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quicktype-core",
|
|
3
|
-
"version": "23.3.
|
|
3
|
+
"version": "23.3.7",
|
|
4
4
|
"description": "The quicktype engine as a library",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"dist"
|
|
51
51
|
],
|
|
52
52
|
"browser": {
|
|
53
|
-
"fs": false
|
|
53
|
+
"fs": false,
|
|
54
|
+
"path": false
|
|
54
55
|
}
|
|
55
56
|
}
|