Skip to content

Commit

Permalink
Minor cosmetic tweaks (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Mar 19, 2022
1 parent c73119b commit 3d919d0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function precinct(content, options = {}) {
theDetective = detectiveTypeScript.tsx;
break;
default:
//nothing
// nothing
}

if (theDetective) {
Expand Down Expand Up @@ -132,10 +132,7 @@ function detectiveEs6Cjs(ast, detectiveOptions) {
* @return {String[]}
*/
precinct.paperwork = (filename, options = {}) => {
options = {
includeCore: true,
...options
};
options = { includeCore: true, ...options };

const fileSystem = options.fileSystem || fs;
const content = fileSystem.readFileSync(filename, 'utf8');
Expand All @@ -148,10 +145,9 @@ precinct.paperwork = (filename, options = {}) => {
} else if (ext === '.cjs') {
debug('paperwork: converting .cjs into the commonjs type');
type = 'commonjs';
}
// We need to sniff the JS module to find its type, not by extension
// Other possible types pass through normally
else if (ext !== '.js' && ext !== '.jsx') {
} else if (ext !== '.js' && ext !== '.jsx') {
debug('paperwork: stripping the dot from the extension to serve as the type');
type = ext.replace('.', '');
}
Expand Down

0 comments on commit 3d919d0

Please sign in to comment.