Skip to content

Commit a374aa9

Browse files
AndersDJohnsonXhmikosR
authored andcommitted
feat: pass filename to detective
1 parent 3b7c867 commit a374aa9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ function precinct(content, options = {}) {
6565
let dependencies = [];
6666

6767
if (detective) {
68-
dependencies = detective(ast, options[type]);
68+
dependencies = detective(ast, {
69+
...options[type],
70+
filename: options.filename,
71+
treePath: options.treePath
72+
});
6973
} else {
7074
debug('no detective found for: %s', type);
7175
}
@@ -88,7 +92,7 @@ function precinct(content, options = {}) {
8892
* @return {String[]}
8993
*/
9094
precinct.paperwork = (filename, options = {}) => {
91-
options = { includeCore: true, ...options };
95+
options = { includeCore: true, filename, ...options };
9296

9397
const fileSystem = options.fileSystem || fs;
9498
const content = fileSystem.readFileSync(filename, 'utf8');

0 commit comments

Comments
 (0)