MCPcopy
hub / github.com/prisma/prisma / stripFirstComponent

Function stripFirstComponent

packages/cli/src/bootstrap/template-scaffold.ts:144–148  ·  view source on GitHub ↗

* GitHub tarballs add a `<owner>-<repo>-<sha>/` prefix to all paths.

(filePath: string)

Source from the content-addressed store, hash-verified

142 * GitHub tarballs add a `<owner>-<repo>-<sha>/` prefix to all paths.
143 */
144function stripFirstComponent(filePath: string): string | null {
145 const idx = filePath.indexOf('/')
146 if (idx === -1) return null
147 return filePath.slice(idx + 1)
148}
149
150export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'deno'
151

Callers 1

Calls 2

indexOfMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected