MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isBareModuleSpecifier

Function isBareModuleSpecifier

src/resolution/import-resolver.ts:3536–3538  ·  view source on GitHub ↗

Whether `source`, imported in a file of `language`, is an ES module specifier written as a name, not a path.

(source: string, language: Language)

Source from the content-addressed store, hash-verified

3534
3535/** Whether `source`, imported in a file of `language`, is an ES module specifier written as a name, not a path. */
3536function isBareModuleSpecifier(source: string, language: Language): boolean {
3537 return ESM_IMPORT_LANGUAGES.has(language) && !source.startsWith('.') && !source.startsWith('/');
3538}
3539
3540/**
3541 * Whether `specifier`, resolving to `file` from `ref`'s file, names a module of

Callers 3

resolveViaImportFunction · 0.85
findImportedExportFunction · 0.85
declaredModuleFileFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected