Skip to content

Commit

Permalink
index.js: move variable
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 26, 2023
1 parent 2fd1417 commit bad8d02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ const natives = process.binding('natives');
function precinct(content, options = {}) {
debug('options given: %o', options);

let { type } = options;
let dependencies = [];
let ast;

// We assume we're dealing with a JS file
if (!type && typeof content !== 'object') {
if (!options.type && typeof content !== 'object') {
debug('we assume this is JS');
const walker = new Walker();

Expand All @@ -62,7 +61,7 @@ function precinct(content, options = {}) {
}
}

type = type || getModuleType.fromSource(ast);
const type = options.type || getModuleType.fromSource(ast);
debug('module type: %s', type);

let detective;
Expand Down

0 comments on commit bad8d02

Please # to comment.