utilIsObject => isObject, move to core.js

This commit is contained in:
toasted-nutbread 2019-11-26 17:33:09 -05:00
parent 7e94fca7c7
commit 099847729c
3 changed files with 6 additions and 6 deletions

View File

@ -389,7 +389,7 @@ function optionsUpdateVersion(options, defaultProfileOptions) {
// Remove invalid
const profiles = options.profiles;
for (let i = profiles.length - 1; i >= 0; --i) {
if (!utilIsObject(profiles[i])) {
if (!isObject(profiles[i])) {
profiles.splice(i, 1);
}
}
@ -440,7 +440,7 @@ function optionsLoad() {
}).then(optionsStr => {
if (typeof optionsStr === 'string') {
const options = JSON.parse(optionsStr);
if (utilIsObject(options)) {
if (isObject(options)) {
return options;
}
}

View File

@ -111,7 +111,3 @@ function utilReadFile(file) {
reader.readAsBinaryString(file);
});
}
function utilIsObject(value) {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}

View File

@ -148,3 +148,7 @@ function stringReplaceAsync(str, regex, replacer) {
parts.push(str.substring(index));
return Promise.all(parts).then(v => v.join(''));
}
function isObject(value) {
return typeof value === 'object' && value !== null && !Array.isArray(value);
}