MCPcopy Index your code
hub / github.com/nodejs/node / readableURIEncode

Function readableURIEncode

lib/internal/modules/esm/loader.js:876–883  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

874 if (userLoaderPaths.length > 0) {
875 if (!emittedLoaderFlagWarning) {
876 const readableURIEncode = (string) => ArrayPrototypeReduce(
877 [
878 [/'/g, '%27'], // We need to URL-encode the single quote as it's the delimiter for the --import flag.
879 [/%22/g, '"'], // We can decode the double quotes to improve readability.
880 [/%2F/ig, '/'], // We can decode the slashes to improve readability.
881 ],
882 (str, { 0: regex, 1: replacement }) => RegExpPrototypeSymbolReplace(hardenRegExp(regex), str, replacement),
883 encodeURIComponent(string));
884 process.emitWarning(
885 '`--experimental-loader` may be removed in the future; instead use `register()`:\n' +
886 `--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; ${ArrayPrototypeJoin(

Callers 1

createModuleLoaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…