mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
chore: remove unnecessary eslint-disable directive (#7283)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -5,11 +5,11 @@ import fs from 'fs/promises';
|
|||||||
const argv = minimist(process.argv.slice(2));
|
const argv = minimist(process.argv.slice(2));
|
||||||
console.log(argv);
|
console.log(argv);
|
||||||
|
|
||||||
let {tag} = argv;
|
let { tag } = argv;
|
||||||
|
|
||||||
(async() => {
|
(async () => {
|
||||||
if (!tag || tag === true) {
|
if (!tag || tag === true) {
|
||||||
const {version} = JSON.parse((await fs.readFile('./package.json')).toString());
|
const { version } = JSON.parse((await fs.readFile('./package.json')).toString());
|
||||||
|
|
||||||
tag = 'v' + version;
|
tag = 'v' + version;
|
||||||
} else if (typeof tag !== 'string') {
|
} else if (typeof tag !== 'string') {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default function mergeConfig(config1, config2) {
|
|||||||
|
|
||||||
function getMergedValue(target, source, prop, caseless) {
|
function getMergedValue(target, source, prop, caseless) {
|
||||||
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
||||||
return utils.merge.call({caseless}, target, source);
|
return utils.merge.call({ caseless }, target, source);
|
||||||
} else if (utils.isPlainObject(source)) {
|
} else if (utils.isPlainObject(source)) {
|
||||||
return utils.merge({}, source);
|
return utils.merge({}, source);
|
||||||
} else if (utils.isArray(source)) {
|
} else if (utils.isArray(source)) {
|
||||||
@@ -30,7 +30,6 @@ export default function mergeConfig(config1, config2) {
|
|||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line consistent-return
|
|
||||||
function mergeDeepProperties(a, b, prop, caseless) {
|
function mergeDeepProperties(a, b, prop, caseless) {
|
||||||
if (!utils.isUndefined(b)) {
|
if (!utils.isUndefined(b)) {
|
||||||
return getMergedValue(a, b, prop, caseless);
|
return getMergedValue(a, b, prop, caseless);
|
||||||
@@ -96,7 +95,7 @@ export default function mergeConfig(config1, config2) {
|
|||||||
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
||||||
};
|
};
|
||||||
|
|
||||||
utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
||||||
const merge = mergeMap[prop] || mergeDeepProperties;
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
||||||
const configValue = merge(config1[prop], config2[prop], prop);
|
const configValue = merge(config1[prop], config2[prop], prop);
|
||||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user