path.d.ts 831 B

123456789101112131415
  1. /**
  2. * Percent-encode everything that isn't safe to have in a path without encoding safe chars.
  3. *
  4. * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
  5. * > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
  6. * > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
  7. * > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
  8. */
  9. export declare function encodeURIPath(str: string): string;
  10. export declare const createPathTagFunction: (pathEncoder?: typeof encodeURIPath) => (statics: readonly string[], ...params: readonly unknown[]) => string;
  11. /**
  12. * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
  13. */
  14. export declare const path: (statics: readonly string[], ...params: readonly unknown[]) => string;
  15. //# sourceMappingURL=path.d.ts.map