@vercel/build-utils 6.3.1 → 6.3.2
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/fs/read-config-file.js +12 -7
- package/dist/index.js +12 -7
- package/package.json +2 -2
@@ -25,14 +25,19 @@ async function readConfigFile(files) {
|
|
25
25
|
const data = await readFileOrNull(name);
|
26
26
|
if (data) {
|
27
27
|
const str = data.toString('utf8');
|
28
|
-
|
29
|
-
|
28
|
+
try {
|
29
|
+
if (name.endsWith('.json')) {
|
30
|
+
return JSON.parse(str);
|
31
|
+
}
|
32
|
+
else if (name.endsWith('.toml')) {
|
33
|
+
return toml_1.default.parse(str);
|
34
|
+
}
|
35
|
+
else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
36
|
+
return js_yaml_1.default.safeLoad(str, { filename: name });
|
37
|
+
}
|
30
38
|
}
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
35
|
-
return js_yaml_1.default.safeLoad(str, { filename: name });
|
39
|
+
catch (error) {
|
40
|
+
console.log(`Error while parsing config file: "${name}"`);
|
36
41
|
}
|
37
42
|
}
|
38
43
|
}
|
package/dist/index.js
CHANGED
@@ -30943,14 +30943,19 @@ async function readConfigFile(files) {
|
|
30943
30943
|
const data = await readFileOrNull(name);
|
30944
30944
|
if (data) {
|
30945
30945
|
const str = data.toString('utf8');
|
30946
|
-
|
30947
|
-
|
30948
|
-
|
30949
|
-
|
30950
|
-
|
30946
|
+
try {
|
30947
|
+
if (name.endsWith('.json')) {
|
30948
|
+
return JSON.parse(str);
|
30949
|
+
}
|
30950
|
+
else if (name.endsWith('.toml')) {
|
30951
|
+
return toml_1.default.parse(str);
|
30952
|
+
}
|
30953
|
+
else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
30954
|
+
return js_yaml_1.default.safeLoad(str, { filename: name });
|
30955
|
+
}
|
30951
30956
|
}
|
30952
|
-
|
30953
|
-
|
30957
|
+
catch (error) {
|
30958
|
+
console.log(`Error while parsing config file: "${name}"`);
|
30954
30959
|
}
|
30955
30960
|
}
|
30956
30961
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "6.3.
|
3
|
+
"version": "6.3.2",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -51,5 +51,5 @@
|
|
51
51
|
"typescript": "4.3.4",
|
52
52
|
"yazl": "2.5.1"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "e0f8bc98202146eda0f2b85efac74b803654e786"
|
55
55
|
}
|