aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/options-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-27 07:23:42 -0500
committerGitHub <noreply@github.com>2024-02-27 12:23:42 +0000
commite47a0f488f3d9bbcb76ebcf4f5afe203c1ee06c0 (patch)
tree35a4a7411dd3154b19316b330c4976f291f021d2 /ext/js/data/options-util.js
parente74fadc5a411e907da088729ea13e23e6f5aa58d (diff)
Object utilities (#729)
* Create utilities * Rename old isObject * Use new isObject * Remove old function * Add additional function * Simplify for now * Rename function for clarity * Rename function * Expand type * Update eslint
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r--ext/js/data/options-util.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index de30f52a..f2d085fe 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -18,7 +18,8 @@
import {fetchJson, fetchText} from '../core/fetch-utilities.js';
import {parseJson} from '../core/json.js';
-import {escapeRegExp, isObject} from '../core/utilities.js';
+import {isObjectNotArray} from '../core/object-utilities.js';
+import {escapeRegExp} from '../core/utilities.js';
import {TemplatePatcher} from '../templates/template-patcher.js';
import {JsonSchema} from './json-schema.js';
@@ -70,7 +71,7 @@ export class OptionsUtil {
// Remove invalid profiles
const profiles = /** @type {unknown[]} */ (options.profiles);
for (let i = profiles.length - 1; i >= 0; --i) {
- if (!isObject(profiles[i])) {
+ if (!isObjectNotArray(profiles[i])) {
profiles.splice(i, 1);
}
}
@@ -1102,7 +1103,7 @@ export class OptionsUtil {
}
}
- if (customTemplates && isObject(chrome.storage)) {
+ if (customTemplates && isObjectNotArray(chrome.storage)) {
void chrome.storage.session.set({needsCustomTemplatesWarning: true});
await this._createTab(chrome.runtime.getURL('/welcome.html'));
void chrome.storage.session.set({openedWelcomePage: true});