first commit
This commit is contained in:
18
node_modules/eslint-plugin-import-x/lib/utils/apply-default.js
generated
vendored
Normal file
18
node_modules/eslint-plugin-import-x/lib/utils/apply-default.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { deepMerge, isObjectNotArray } from './deep-merge.js';
|
||||
export function applyDefault(defaultOptions, userOptions) {
|
||||
const options = structuredClone(defaultOptions);
|
||||
if (userOptions == null) {
|
||||
return options;
|
||||
}
|
||||
for (const [i, opt] of options.entries()) {
|
||||
if (userOptions[i] !== undefined) {
|
||||
const userOpt = userOptions[i];
|
||||
options[i] =
|
||||
isObjectNotArray(userOpt) && isObjectNotArray(opt)
|
||||
? deepMerge(opt, userOpt)
|
||||
: userOpt;
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
//# sourceMappingURL=apply-default.js.map
|
||||
Reference in New Issue
Block a user