MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / filenameSafe

Function filenameSafe

src/shared/utils.ts:20–22  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

18
19
20export function filenameSafe(input: string) {
21 return input.replace(/[^a-z0-9]+/gi, "_").replace(/_{2,}/g, "_").replace(/_$/g, "").toLowerCase();
22}
23
24export function escapeRegExp(input: string): string {
25 return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string

Callers 3

helpers.tsFile · 0.90
insertSessionNameFunction · 0.90
insertWorkspaceNameFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected