Skip to content

Commit

Permalink
refactor: use startsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Jan 17, 2020
1 parent 3e52df6 commit eef741c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/src/server/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function parsePackageName(input) {
throw new TypeError('Expected a string');
}

const matched = input.charAt(0) === '@' ? input.match(RE_SCOPED) : input.match(RE_NORMAL);
const matched = input.startsWith('@') ? input.match(RE_SCOPED) : input.match(RE_NORMAL);

if (!matched) {
throw new Error(`[parse-package-name] "${input}" is not a valid string`);
Expand Down

0 comments on commit eef741c

Please sign in to comment.