MCPcopy Create free account
hub / github.com/vercel/vercel / buildTransformCtx

Function buildTransformCtx

packages/cli/test/unit/util/dev/transforms.test.ts:12–21  ·  view source on GitHub ↗
(
  src: string,
  path: string,
  env?: Record<string, string | undefined>
)

Source from the content-addressed store, hash-verified

10
11// a simple version of what devRouter does
12function buildTransformCtx(
13 src: string,
14 path: string,
15 env?: Record<string, string | undefined>
16) {
17 const keys: string[] = [];
18 const matcher = PCRE(`%${src}%i`, keys);
19 const match = matcher.exec(path) || matcher.exec(path.substring(1));
20 return { match: match ?? [], keys, env };
21}
22
23describe('resolveTransforms', () => {
24 it('resolves request.path groups', () => {

Callers 1

transforms.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected