Skip to content

Commit

Permalink
fix: Resolved Flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketkudale committed Dec 22, 2016
1 parent 483c5a6 commit 7e8b20f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/firefox/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,20 @@ export function coerceCLICustomPreference(
cliPrefs = [cliPrefs];
}


for (const pref of cliPrefs) {
const [key, value] = pref.split('=');
const prefsAry = pref.split('=');
const key = prefsAry[0];
let value = prefsAry[1];

if (/[^\w{@}.-]/.test(key)) {
throw new UsageError(`Invalid custom preference name: ${key}`);
}

if (value === `${parseInt(value)}`) {
const value = parseInt(value, 10);
value = parseInt(value, 10);
} else if (value === 'true' || value === 'false') {
const value = (value === 'true');
value = (value === 'true');
}

if (nonOverridablePreferences.includes(key)) {
Expand Down

0 comments on commit 7e8b20f

Please sign in to comment.