From 4fd1a3db6268bb47ad72b9d80d494d9fd5354be8 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 19 Apr 2017 19:13:11 +0300 Subject: [PATCH] remove fixBoolean() --- storage.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/storage.js b/storage.js index f2f2d8e4..e7b7babd 100644 --- a/storage.js +++ b/storage.js @@ -79,14 +79,15 @@ function getStyles(options, callback) { function filterStyles({ - enabled, + enabled = null, url = null, id = null, matchUrl = null, asHash = null, strictRegexp = true, // used by the popup to detect bad regexps } = {}) { - enabled = fixBoolean(enabled); + enabled = enabled === null || typeof enabled == 'boolean' ? enabled : + typeof enabled == 'string' ? enabled == 'true' : null; id = id === null ? null : Number(id); if (enabled === null @@ -504,14 +505,6 @@ function reportError(...args) { } -function fixBoolean(b) { - if (typeof b != 'undefined') { - return b != 'false'; - } - return null; -} - - function getDomains(url) { if (url.indexOf('file:') == 0) { return [];