MCPcopy Index your code
hub / github.com/hydro-dev/Hydro / encodeRFC5987ValueChars

Function encodeRFC5987ValueChars

framework/framework/server.ts:34–45  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

32
33// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
34export function encodeRFC5987ValueChars(str: string) {
35 return (
36 encodeURIComponent(str)
37 // Note that although RFC3986 reserves "!", RFC5987 does not,
38 // so we do not need to escape it
39 .replace(/['()]/g, escape) // i.e., %27 %28 %29
40 .replace(/\*/g, '%2A')
41 // The following are not required for percent-encoding per RFC5987,
42 // so we can allow for a little better readability over the wire: |`^
43 .replace(/%(?:7C|60|5E)/g, unescape)
44 );
45}
46
47async function forkContextWithScope(ctx: CordisContext) {
48 const scope = ctx.plugin(() => { });

Callers 1

binaryMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected