MCPcopy Create free account
hub / github.com/TanStack/query / replaceDist

Function replaceDist

packages/angular-query-experimental/scripts/prepack.js:40–44  ·  view source on GitHub ↗

* Replaces 'dist/' or './dist/' prefix from a file path with './' * Only matches at the start of the path to avoid false matches * @param {string} filePath - The file path to process * @returns {string} The path without dist prefix

(filePath)

Source from the content-addressed store, hash-verified

38 * @returns {string} The path without dist prefix
39 */
40function replaceDist(filePath) {
41 // Only match dist/ at the beginning of the path, followed by a filename
42 // This prevents matching strings like "distributed/file.js" or "some/dist/path"
43 return filePath.replace(/^(?:\.\/)?dist\/(?=.+)/, './')
44}
45
46/**
47 * Recursively processes package.json `exports` to remove dist prefixes

Callers 2

processExportsFunction · 0.85
prepack.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected