MCPcopy Create free account
hub / github.com/codesandbox/excalidraw-firebase / mapToBase

Method mapToBase

.pnp.cjs:7789–7801  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

7787 return path;
7788 }
7789 mapToBase(path) {
7790 if (typeof path === `string`)
7791 return path;
7792 if (path instanceof url.URL)
7793 return url.fileURLToPath(path);
7794 if (Buffer.isBuffer(path)) {
7795 const str = path.toString();
7796 if (!isUtf8(path, str))
7797 throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`);
7798 return str;
7799 }
7800 throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`);
7801 }
7802}
7803function isUtf8(buf, str) {
7804 if (typeof buffer__default.default.isUtf8 !== `undefined`)

Callers

nothing calls this directly

Calls 1

isUtf8Function · 0.85

Tested by

no test coverage detected