MCPcopy Create free account
hub / github.com/Effect-TS/effect / fileToModuleName

Function fileToModuleName

packages/tools/utils/src/Codegen.ts:176–179  ·  view source on GitHub ↗
(posix: string)

Source from the content-addressed store, hash-verified

174 const toPosix = path.sep === "/" ? (file: string) => file : (file: string) => file.split(path.sep).join("/")
175
176 const fileToModuleName = (posix: string): string => {
177 const withoutExt = posix.slice(0, -path.extname(posix).length)
178 return withoutExt.replace(/\//g, "_")
179 }
180
181 const processModule = Effect.fn("processModule")(function*(directory: string, file: string) {
182 const fullPath = path.join(directory, file)

Callers 1

Codegen.tsFile · 0.85

Calls 2

sliceMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected