Skip to content

Commit 7c9c644

Browse files
renovate[bot]travi
andauthored
chore(deps): update dependency trim-newlines to 3.0.1 [security] (#367)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Matt Travi <[email protected]>
1 parent 131637a commit 7c9c644

File tree

12 files changed

+979
-1665
lines changed

12 files changed

+979
-1665
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function verifyConditions(pluginConfig, context) {
99
// If the Git prepare plugin is used and has `assets` or `message` configured, validate them now in order to prevent any release if the configuration is wrong
1010
if (options.prepare) {
1111
const preparePlugin =
12-
castArray(options.prepare).find(config => config.path && config.path === '@semantic-release/git') || {};
12+
castArray(options.prepare).find((config) => config.path && config.path === '@semantic-release/git') || {};
1313

1414
pluginConfig.assets = defaultTo(pluginConfig.assets, preparePlugin.assets);
1515
pluginConfig.message = defaultTo(pluginConfig.message, preparePlugin.message);

lib/definitions/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const pkg = require('../../package.json');
22

33
const [homepage] = pkg.homepage.split('#');
4-
const linkify = file => `${homepage}/blob/master/${file}`;
4+
const linkify = (file) => `${homepage}/blob/master/${file}`;
55

66
module.exports = {
77
EINVALIDASSETS: ({assets}) => ({

lib/git.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const debug = require('debug')('semantic-release:git');
1111
async function getModifiedFiles(execaOptions) {
1212
return (await execa('git', ['ls-files', '-m', '-o'], execaOptions)).stdout
1313
.split('\n')
14-
.map(file => file.trim())
15-
.filter(file => Boolean(file));
14+
.map((file) => file.trim())
15+
.filter((file) => Boolean(file));
1616
}
1717

1818
/**

lib/prepare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = async (pluginConfig, context) => {
3434

3535
const filesToCommit = uniq(
3636
await pReduce(
37-
assets.map(asset => (!isArray(asset) && isPlainObject(asset) ? asset.path : asset)),
37+
assets.map((asset) => (!isArray(asset) && isPlainObject(asset) ? asset.path : asset)),
3838
async (result, asset) => {
3939
const glob = castArray(asset);
4040
let nonegate;

lib/verify.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ const AggregateError = require('aggregate-error');
33
const getError = require('./get-error');
44
const resolveConfig = require('./resolve-config');
55

6-
const isNonEmptyString = value => isString(value) && value.trim();
7-
const isStringOrStringArray = value => isNonEmptyString(value) || (isArray(value) && value.every(isNonEmptyString));
8-
const isArrayOf = validator => array => isArray(array) && array.every(value => validator(value));
9-
const canBeDisabled = validator => value => value === false || validator(value);
6+
const isNonEmptyString = (value) => isString(value) && value.trim();
7+
const isStringOrStringArray = (value) => {
8+
return isNonEmptyString(value) || (isArray(value) && value.every((element) => isNonEmptyString(element)));
9+
};
10+
11+
const isArrayOf = (validator) => (array) => isArray(array) && array.every((value) => validator(value));
12+
const canBeDisabled = (validator) => (value) => value === false || validator(value);
1013

1114
const VALIDATORS = {
1215
assets: canBeDisabled(
13-
isArrayOf(asset => isStringOrStringArray(asset) || (isPlainObject(asset) && isStringOrStringArray(asset.path)))
16+
isArrayOf((asset) => isStringOrStringArray(asset) || (isPlainObject(asset) && isStringOrStringArray(asset.path)))
1417
),
1518
message: isNonEmptyString,
1619
};
@@ -24,7 +27,7 @@ const VALIDATORS = {
2427
* @param {String|Array<String|Object>} [pluginConfig.assets] Files to include in the release commit. Can be files path or globs.
2528
* @param {String} [pluginConfig.message] The commit message for the release.
2629
*/
27-
module.exports = pluginConfig => {
30+
module.exports = (pluginConfig) => {
2831
const options = resolveConfig(pluginConfig);
2932

3033
const errors = Object.entries(options).reduce(

0 commit comments

Comments
 (0)