Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 29, 2019
1 parent c8745ec commit be8353a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ function normalize(packageJson) {
return result;
}

module.exports = (filePath, data, options) => {
module.exports = async (filePath, data, options) => {
if (typeof filePath !== 'string') {
options = data;
data = filePath;
filePath = '.';
}

options = {normalize: true, ...options, detectIndent: true};
options = {
normalize: true,
...options,
detectIndent: true
};

filePath = path.basename(filePath) === 'package.json' ? filePath : path.join(filePath, 'package.json');

Expand All @@ -47,7 +51,11 @@ module.exports.sync = (filePath, data, options) => {
filePath = '.';
}

options = {normalize: true, ...options, detectIndent: true};
options = {
normalize: true,
...options,
detectIndent: true
};

filePath = path.basename(filePath) === 'package.json' ? filePath : path.join(filePath, 'package.json');

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"file",
"fs",
"graceful",
"pkg",
"package"
],
"dependencies": {
Expand Down

0 comments on commit be8353a

Please sign in to comment.