Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Fix] reject invalid only values
  • Loading branch information
ljharb committed Mar 2, 2022
1 parent 38f99c3 commit bfdb848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Expand Up @@ -7,6 +7,7 @@
"consistent-return": 1,
"func-name-matching": 0,
"max-nested-callbacks": 0,
"max-lines-per-function": 0,
"sort-keys": 0,
},
}
3 changes: 3 additions & 0 deletions getLockfile.js
Expand Up @@ -23,6 +23,9 @@ module.exports = function getLockfile(packageFile, date, {
if (typeof date !== 'undefined' && !new Date(date).getTime()) {
return Promise.reject(colors.red(`\`date\` must be a valid Date format if provided; got ${inspect(date)}`));
}
if (only && only !== 'prod' && only !== 'production') {
return Promise.reject(colors.red('`only`, when provided, must be "prod" or "production"'));
}
const tmpDirP = getProjectTempDir({ npmNeeded, logger });
const npmRC = path.join(path.dirname(packageFile), '.npmrc');
const copyPkg = tmpDirP.then((tmpDir) => {
Expand Down

0 comments on commit bfdb848

Please sign in to comment.