mirror of
https://github.com/actions/labeler.git
synced 2025-12-19 08:38:15 +00:00
build
This commit is contained in:
29
node_modules/jest-config/build/utils.js
generated
vendored
29
node_modules/jest-config/build/utils.js
generated
vendored
@@ -86,7 +86,7 @@ const resolve = (resolver, {key, filePath, rootDir, optional}) => {
|
||||
filePath
|
||||
)} in the ${_chalk().default.bold(key)} option was not found.
|
||||
${_chalk().default.bold('<rootDir>')} is: ${rootDir}`);
|
||||
}
|
||||
} /// can cast as string since nulls will be thrown
|
||||
|
||||
return module;
|
||||
};
|
||||
@@ -106,31 +106,32 @@ const replaceRootDirInPath = (rootDir, filePath) => {
|
||||
rootDir,
|
||||
_path().default.normalize('./' + filePath.substr('<rootDir>'.length))
|
||||
);
|
||||
}; // TODO: Type as returning same type as input
|
||||
};
|
||||
|
||||
exports.replaceRootDirInPath = replaceRootDirInPath;
|
||||
|
||||
const _replaceRootDirInObject = (rootDir, config) => {
|
||||
if (config !== null) {
|
||||
const newConfig = {};
|
||||
const newConfig = {};
|
||||
|
||||
for (const configKey in config) {
|
||||
newConfig[configKey] =
|
||||
configKey === 'rootDir'
|
||||
? config[configKey]
|
||||
: _replaceRootDirTags(rootDir, config[configKey]);
|
||||
}
|
||||
|
||||
return newConfig;
|
||||
for (const configKey in config) {
|
||||
newConfig[configKey] =
|
||||
configKey === 'rootDir'
|
||||
? config[configKey]
|
||||
: _replaceRootDirTags(rootDir, config[configKey]);
|
||||
}
|
||||
|
||||
return config;
|
||||
}; // TODO: Type as returning same type as input
|
||||
return newConfig;
|
||||
};
|
||||
|
||||
const _replaceRootDirTags = (rootDir, config) => {
|
||||
if (config == null) {
|
||||
return config;
|
||||
}
|
||||
|
||||
switch (typeof config) {
|
||||
case 'object':
|
||||
if (Array.isArray(config)) {
|
||||
/// can be string[] or {}[]
|
||||
return config.map(item => _replaceRootDirTags(rootDir, item));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user