MCPcopy Create free account
hub / github.com/axe-api/axe-api / getVersionByRequest

Function getVersionByRequest

packages/axe-api/src/Helpers.ts:4–13  ·  view source on GitHub ↗
(urlObject: URL)

Source from the content-addressed store, hash-verified

2import { IVersion } from "./Interfaces";
3
4export const getVersionByRequest = (urlObject: URL): IVersion | undefined => {
5 // Application configuration is need for the default setting.
6 const api = APIService.getInstance();
7 const matchedVersion = api.versions.find((version) => {
8 const path = `/${api.config.prefix}/${version.name}`;
9 return urlObject.pathname.startsWith(path);
10 });
11
12 return matchedVersion;
13};

Callers 1

constructorMethod · 0.90

Calls 2

findMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected