MCPcopy Index your code
hub / github.com/simstudioai/sim / encodeQueryValue

Function encodeQueryValue

apps/sim/connectors/s3/s3.ts:326–331  ·  view source on GitHub ↗

* Percent-encodes a query parameter name or value per AWS SigV4 canonical rules * (every byte except the unreserved set `A-Za-z0-9-_.~` is encoded). * `encodeURIComponent` leaves `!'()*` unencoded, so those are encoded here.

(value: string)

Source from the content-addressed store, hash-verified

324 * `encodeURIComponent` leaves `!'()*` unencoded, so those are encoded here.
325 */
326function encodeQueryValue(value: string): string {
327 return encodeURIComponent(value).replace(
328 /[!'()*]/g,
329 (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
330 )
331}
332
333/**
334 * Builds the canonical (sorted, percent-encoded) query string for a

Callers 1

buildListQueryStringFunction · 0.85

Calls 2

replaceMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected