UNPKG

@jsdocs-io/extractor

Version:

Analyze and extract the API from npm packages

11 lines (9 loc) 241 B
import * as tsm from 'ts-morph'; export function getFilename({ declaration, }: { declaration: tsm.Node; }): string { // Remove leading `/` from filepath return declaration.getSourceFile().getFilePath().replace(/^\//, ''); }