counterfact
Version:
a library for building a fake REST API for testing
11 lines (10 loc) • 333 B
JavaScript
export function isProxyEnabledForPath(path, config) {
if (config.proxyPaths.has(path)) {
return config.proxyPaths.get(path) ?? false;
}
if (path === "") {
return false;
}
const parentPath = path.slice(0, Math.max(0, path.lastIndexOf("/")));
return isProxyEnabledForPath(parentPath, config);
}