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

Function applyQueryTransforms

packages/cli/src/util/dev/transforms.ts:176–193  ·  view source on GitHub ↗
(
  query: Record<string, string[]>,
  transforms: Transform[]
)

Source from the content-addressed store, hash-verified

174}
175
176function applyQueryTransforms(
177 query: Record<string, string[]>,
178 transforms: Transform[]
179): void {
180 for (const transform of transforms) {
181 if (transform.type === 'request.query' && 'target' in transform) {
182 applyTransform(query, transform, false);
183 }
184 }
185 for (const key of Object.keys(query)) {
186 const value = query[key];
187 if (value === undefined) {
188 delete query[key];
189 } else if (typeof value === 'string') {
190 query[key] = [value];
191 }
192 }
193}
194
195const HEADER_NAME_RE = /^[-\w]+$/;
196const HEADER_VALUE_RE = /^[-\w:;.,/\\"'?!(){}[\]@<>=+*#$&`|~%^ ]+$/;

Callers 1

applyRequestTransformsFunction · 0.85

Calls 2

applyTransformFunction · 0.85
keysMethod · 0.45

Tested by

no test coverage detected