UNPKG

241 BPlain TextView Raw
1import * as tsm from 'ts-morph';
2
3export function getFilename({
4 declaration,
5}: {
6 declaration: tsm.Node;
7}): string {
8 // Remove leading `/` from filepath
9 return declaration.getSourceFile().getFilePath().replace(/^\//, '');
10}