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

Function getModuleNameFromImport

npm_modules/cli/src/preview/previewGenerator.ts:282–284  ·  view source on GitHub ↗
(importPath: string)

Source from the content-addressed store, hash-verified

280
281/** Extract the module name (first segment) from an import path like "widgets/src/..." */
282export function getModuleNameFromImport(importPath: string): string {
283 return importPath.split('/')[0]!;
284}
285
286/** Read the valdi_module name from a BUILD.bazel file in the given directory */
287export function readModuleName(moduleDir: string): string {

Callers 2

generateTsconfigFunction · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected