mirror of
https://github.com/github/codeql-action.git
synced 2025-12-20 06:10:20 +08:00
Bump eslint-plugin-import to avoid vulnerability in dependency
This commit is contained in:
15
node_modules/eslint-module-utils/resolve.js
generated
vendored
15
node_modules/eslint-module-utils/resolve.js
generated
vendored
@@ -1,14 +1,13 @@
|
||||
'use strict';
|
||||
exports.__esModule = true;
|
||||
|
||||
const pkgDir = require('pkg-dir');
|
||||
|
||||
const fs = require('fs');
|
||||
const Module = require('module');
|
||||
const path = require('path');
|
||||
|
||||
const hashObject = require('./hash').hashObject;
|
||||
const ModuleCache = require('./ModuleCache').default;
|
||||
const pkgDir = require('./pkgDir').default;
|
||||
|
||||
const CASE_SENSITIVE_FS = !fs.existsSync(path.join(__dirname.toUpperCase(), 'reSOLVE.js'));
|
||||
exports.CASE_SENSITIVE_FS = CASE_SENSITIVE_FS;
|
||||
@@ -42,7 +41,7 @@ function tryRequire(target, sourceFile) {
|
||||
} else {
|
||||
resolved = require.resolve(target);
|
||||
}
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
// If the target does not exist then just return undefined
|
||||
return undefined;
|
||||
}
|
||||
@@ -51,14 +50,14 @@ function tryRequire(target, sourceFile) {
|
||||
return require(resolved);
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/a/27382838
|
||||
exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings) {
|
||||
// https://stackoverflow.com/a/27382838
|
||||
exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings, strict) {
|
||||
// don't care if the FS is case-sensitive
|
||||
if (CASE_SENSITIVE_FS) return true;
|
||||
|
||||
// null means it resolved to a builtin
|
||||
if (filepath === null) return true;
|
||||
if (filepath.toLowerCase() === process.cwd().toLowerCase()) return true;
|
||||
if (filepath.toLowerCase() === process.cwd().toLowerCase() && !strict) return true;
|
||||
const parsedPath = path.parse(filepath);
|
||||
const dir = parsedPath.dir;
|
||||
|
||||
@@ -73,7 +72,7 @@ exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cache
|
||||
if (filenames.indexOf(parsedPath.base) === -1) {
|
||||
result = false;
|
||||
} else {
|
||||
result = fileExistsWithCaseSync(dir, cacheSettings);
|
||||
result = fileExistsWithCaseSync(dir, cacheSettings, strict);
|
||||
}
|
||||
}
|
||||
fileExistsCache.set(filepath, result);
|
||||
@@ -175,7 +174,7 @@ function resolverReducer(resolvers, map) {
|
||||
}
|
||||
|
||||
function getBaseDir(sourceFile) {
|
||||
return pkgDir.sync(sourceFile) || process.cwd();
|
||||
return pkgDir(sourceFile) || process.cwd();
|
||||
}
|
||||
function requireResolver(name, sourceFile) {
|
||||
// Try to resolve package with conventional name
|
||||
|
||||
Reference in New Issue
Block a user