Skip to content

Commit

Permalink
feat: pass filename to detective
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersDJohnson authored and XhmikosR committed Apr 14, 2024
1 parent 3b7c867 commit a374aa9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ function precinct(content, options = {}) {
let dependencies = [];

if (detective) {
dependencies = detective(ast, options[type]);
dependencies = detective(ast, {
...options[type],
filename: options.filename,
treePath: options.treePath
});
} else {
debug('no detective found for: %s', type);
}
Expand All @@ -88,7 +92,7 @@ function precinct(content, options = {}) {
* @return {String[]}
*/
precinct.paperwork = (filename, options = {}) => {
options = { includeCore: true, ...options };
options = { includeCore: true, filename, ...options };

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

0 comments on commit a374aa9

Please sign in to comment.