MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / toPackageName

Function toPackageName

packages/cli/src/commands/init.ts:204–214  ·  view source on GitHub ↗
(projectName: string)

Source from the content-addressed store, hash-verified

202}
203
204function toPackageName(projectName: string): string {
205 const normalized = basename(projectName)
206 .trim()
207 .toLowerCase()
208 .replace(/^[._]+/, "")
209 .replace(/[^a-z0-9._~-]+/g, "-")
210 .replace(/-+/g, "-")
211 .replace(/^[-.]+|[-.]+$/g, "");
212
213 return normalized || "hyperframes-project";
214}
215
216function getHyperframesPackageSpecifier(): string {
217 return VERSION === "0.0.0-dev" ? "hyperframes" : `hyperframes@${VERSION}`;

Callers 1

writeDefaultPackageJsonFunction · 0.85

Calls 1

basenameFunction · 0.85

Tested by

no test coverage detected