aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-08 20:02:58 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-08 20:02:58 -0700
commitdcce58fc2eab1f3b23abb90f5ce30536d7dbf1c1 (patch)
tree0a72a840c357e5cab3f16b1427dd627258c63fbd /ext/bg/js/options.js
parentb080e30b14c70ab450ea77e93bce45f93662b7ed (diff)
Cleanup
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js32
1 files changed, 15 insertions, 17 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 44236e68..3f31aff8 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -19,30 +19,28 @@
function sanitizeOptions(options) {
const defaults = {
- scanLength: 20,
- activateOnStartup: false,
- selectMatchedText: true,
- loadEnamDict: false,
+ scanLength: 20,
+ activateOnStartup: false,
+ selectMatchedText: true,
+ loadEnamDict: false,
enableAudioPlayback: true,
- enableAnkiConnect: false,
- ankiCardTags: ['yomichan'],
- sentenceExtent: 200,
- ankiVocabDeck: '',
- ankiVocabModel: '',
- ankiVocabFields: {},
- ankiKanjiDeck: '',
- ankiKanjiModel: '',
- ankiKanjiFields: {}
+ enableAnkiConnect: false,
+ ankiCardTags: ['yomichan'],
+ sentenceExtent: 200,
+ ankiVocabDeck: '',
+ ankiVocabModel: '',
+ ankiVocabFields: {},
+ ankiKanjiDeck: '',
+ ankiKanjiModel: '',
+ ankiKanjiFields: {}
};
- for (let key in defaults) {
- if (!options.hasOwnProperty(key)) {
+ for (const key in defaults) {
+ if (!(key in options)) {
options[key] = defaults[key];
}
}
- options.scanLength = parseInt(options.scanLength);
-
return options;
}