MCPcopy Create free account
hub / github.com/sindresorhus/query-string / strictUriEncode

Function strictUriEncode

base.js:5–5  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4// eslint-disable-next-line unicorn/prefer-code-point
5const strictUriEncode = string => encodeURIComponent(string).replaceAll(/[!'\(\)*]/gv, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
6
7// A value that is left out of the query string. `undefined` is always left out, and `skipNull` and `skipEmptyString` leave out the two others.
8function isSkipped(value, options) {

Callers 1

encodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected