mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
25 lines
580 B
JavaScript
25 lines
580 B
JavaScript
import {
|
|
ECOSYSTEM_JS,
|
|
ECOSYSTEM_PY,
|
|
getEcoSystem,
|
|
} from "../../config/settings.js";
|
|
import { npmInterceptorForUrl } from "./npmInterceptor.js";
|
|
import { pipInterceptorForUrl } from "./pipInterceptor.js";
|
|
|
|
/**
|
|
* @param {string} url
|
|
* @returns {import("./interceptorBuilder.js").Interceptor | undefined}
|
|
*/
|
|
export function createInterceptorForUrl(url) {
|
|
const ecosystem = getEcoSystem();
|
|
|
|
if (ecosystem === ECOSYSTEM_JS) {
|
|
return npmInterceptorForUrl(url);
|
|
}
|
|
|
|
if (ecosystem === ECOSYSTEM_PY) {
|
|
return pipInterceptorForUrl(url);
|
|
}
|
|
|
|
return undefined;
|
|
}
|