mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Fix type check issues
This commit is contained in:
parent
3d98bb5084
commit
a2fb94d0f0
8 changed files with 60 additions and 4 deletions
|
|
@ -7,7 +7,13 @@ import {
|
|||
pipWheelCommand,
|
||||
} from "./utils/pipCommands.js";
|
||||
|
||||
/**
|
||||
* @param {string} [command]
|
||||
*/
|
||||
export function createPipPackageManager(command = "pip") {
|
||||
/**
|
||||
* @param {string[]} args
|
||||
*/
|
||||
function isSupportedCommand(args) {
|
||||
const scanner = findDependencyScannerForCommand(
|
||||
commandScannerMapping,
|
||||
|
|
@ -16,6 +22,9 @@ export function createPipPackageManager(command = "pip") {
|
|||
return scanner.shouldScan(args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string[]} args
|
||||
*/
|
||||
function getDependencyUpdatesForCommand(args) {
|
||||
const scanner = findDependencyScannerForCommand(
|
||||
commandScannerMapping,
|
||||
|
|
@ -25,7 +34,7 @@ export function createPipPackageManager(command = "pip") {
|
|||
}
|
||||
|
||||
return {
|
||||
runCommand: (args) => runPip(command, args),
|
||||
runCommand: /** @param {string[]} args */ (args) => runPip(command, args),
|
||||
isSupportedCommand,
|
||||
getDependencyUpdatesForCommand,
|
||||
};
|
||||
|
|
@ -43,6 +52,10 @@ const NULL_SCANNER = {
|
|||
scan: () => [],
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Record<string, any>} scanners
|
||||
* @param {string[]} args
|
||||
*/
|
||||
function findDependencyScannerForCommand(scanners, args) {
|
||||
const command = getPipCommandForArgs(args);
|
||||
if (!command) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue