MCPcopy
hub / github.com/facebook/docusaurus / escapePath

Function escapePath

packages/docusaurus-utils/src/pathUtils.ts:124–129  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

122 * quotes when generating code.
123 */
124export function escapePath(str: string): string {
125 const escaped = JSON.stringify(str);
126
127 // Remove the " around the json string;
128 return escaped.substring(1, escaped.length - 1);
129}
130
131export function addTrailingPathSeparator(str: string): string {
132 return str.endsWith(path.sep)

Callers 9

createFileLoaderUtilsFunction · 0.90
pathUtils.test.tsFile · 0.90
createTestSiteConfigFunction · 0.90
genChunkNamesFunction · 0.90
genClientModulesFunction · 0.90
createAssetValueCodeFunction · 0.90
toAssetRequireNodeFunction · 0.90
toImageRequireNodeFunction · 0.90
normalizePathsFunction · 0.90

Calls

no outgoing calls

Tested by 1

createTestSiteConfigFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…