Skip to content

Commit af746a1

Browse files
renovate[bot]renovate-botgr2m
authored
chore(deps): update dependency xo to v0.34.2 (#301)
Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Gregor Martynus <[email protected]>
1 parent 13c3b26 commit af746a1

File tree

5 files changed

+399
-665
lines changed

5 files changed

+399
-665
lines changed

lib/glob-assets.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const path = require('path');
2-
const {basename} = require('path');
32
const {isPlainObject, castArray, uniqWith, uniq} = require('lodash');
43
const dirGlob = require('dir-glob');
54
const globby = require('globby');
@@ -40,7 +39,7 @@ module.exports = async ({cwd}, assets) =>
4039
// - `path` of the matched file
4140
// - `name` based on the actual file name (to avoid assets with duplicate `name`)
4241
// - other properties of the original asset definition
43-
return globbed.map((file) => ({...asset, path: file, name: basename(file)}));
42+
return globbed.map((file) => ({...asset, path: file, name: path.basename(file)}));
4443
}
4544

4645
// If asset is an Object, output an Object definition with:

lib/parse-github-url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = (repositoryUrl) => {
55
new URL(match ? `ssh://${auth ? `${auth}@` : ''}${host}/${path}` : repositoryUrl).pathname
66
);
77
return {owner, repo};
8-
} catch (_) {
8+
} catch {
99
return {};
1010
}
1111
};

lib/publish.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {basename, extname, resolve} = require('path');
1+
const path = require('path');
22
const {stat, readFile} = require('fs-extra');
33
const {isPlainObject, template} = require('lodash');
44
const mime = require('mime');
@@ -53,8 +53,8 @@ module.exports = async (pluginConfig, context) => {
5353
let file;
5454

5555
try {
56-
file = await stat(resolve(cwd, filePath));
57-
} catch (_) {
56+
file = await stat(path.resolve(cwd, filePath));
57+
} catch {
5858
logger.error('The asset %s cannot be read, and will be ignored.', filePath);
5959
return;
6060
}
@@ -64,13 +64,13 @@ module.exports = async (pluginConfig, context) => {
6464
return;
6565
}
6666

67-
const fileName = template(asset.name || basename(filePath))(context);
67+
const fileName = template(asset.name || path.basename(filePath))(context);
6868
const upload = {
6969
url: uploadUrl,
70-
data: await readFile(resolve(cwd, filePath)),
70+
data: await readFile(path.resolve(cwd, filePath)),
7171
name: fileName,
7272
headers: {
73-
'content-type': mime.getType(extname(fileName)) || 'text/plain',
73+
'content-type': mime.getType(path.extname(fileName)) || 'text/plain',
7474
'content-length': file.size,
7575
},
7676
};

0 commit comments

Comments
 (0)