MCPcopy Create free account
hub / github.com/Snapchat/Valdi / makeValidModuleName

Function makeValidModuleName

compiler/companion/src/native/NativeCompiler.ts:55–60  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

53}
54
55function makeValidModuleName(name: string) {
56 if (name.match(/^[^a-z_]/gi) !== null) {
57 name += '_' + name;
58 }
59 return name.replace(/[^a-z0-9_]/gi, '_');
60}
61
62const CONSTRUCTOR_NAME = '__ctor__';
63

Callers 1

constructorMethod · 0.85

Calls 2

replaceMethod · 0.65
matchMethod · 0.45

Tested by

no test coverage detected