Skip to content

Commit

Permalink
Factor out bitwise operator in indexOf test
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Dillon committed Oct 3, 2016
1 parent 774ac90 commit 33f9731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function getInstallPackage(version) {

// Extract package name from tarball url or path.
function getPackageName(installPackage) {
if (~installPackage.indexOf('.tgz')) {
if (installPackage.indexOf('.tgz') > 0) {
return installPackage.match(/^.+\/(.+)-.+\.tgz$/)[1];
} else if (installPackage.indexOf('@') > 0) {
return installPackage.charAt(0) + installPackage.substr(1).split('@')[0];
Expand Down

0 comments on commit 33f9731

Please sign in to comment.