MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / replaceBaseFilename

Function replaceBaseFilename

src/packFileSerializer.ts:3241–3245  ·  view source on GitHub ↗
(filePath: string, newBasename: string)

Source from the content-addressed store, hash-verified

3239};
3240// Helper function to replace the base filename in a packed file path
3241const replaceBaseFilename = (filePath: string, newBasename: string): string => {
3242 const parts = filePath.split("\\");
3243 parts[parts.length - 1] = newBasename;
3244 return parts.join("\\");
3245};
3246// Helper function to escape special regex characters for literal string matching
3247const escapeRegExp = (string: string): string => {
3248 return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected