diff --git a/src/compose/service.ts b/src/compose/service.ts index dd610251..f9325209 100644 --- a/src/compose/service.ts +++ b/src/compose/service.ts @@ -170,7 +170,7 @@ export class Service { // First process the networks correctly let networks: ServiceConfig['networks'] = {}; - if (_.isArray(config.networks)) { + if (Array.isArray(config.networks)) { _.each(config.networks, (name) => { networks[name] = {}; }); @@ -368,7 +368,7 @@ export class Service { config.tty = Boolean(config.tty); } - if (_.isArray(config.sysctls)) { + if (Array.isArray(config.sysctls)) { config.sysctls = _.fromPairs( _.map(config.sysctls, (v) => _.split(v, '=')), ); diff --git a/src/compose/utils.ts b/src/compose/utils.ts index d27f1569..dd50a948 100644 --- a/src/compose/utils.ts +++ b/src/compose/utils.ts @@ -29,7 +29,7 @@ export function camelCaseConfig( // Networks can either be an object or array, but given _.isObject // returns true for an array, we check the other way - if (!_.isArray(config.networks)) { + if (!Array.isArray(config.networks)) { const networksTmp = structuredClone(config.networks); _.each(networksTmp, (v, k) => { config.networks[k] = _.mapKeys(v, (_v, key) => _.camelCase(key)); diff --git a/src/config/utils.ts b/src/config/utils.ts index 94f8021b..36b19cec 100644 --- a/src/config/utils.ts +++ b/src/config/utils.ts @@ -43,7 +43,7 @@ export function bootConfigToEnv( return _(configOptions) .mapKeys((_val, key) => configBackend.createConfigVarName(key)) .mapValues((val) => { - if (_.isArray(val)) { + if (Array.isArray(val)) { return JSON.stringify(val).replace(/^\[(.*)\]$/, '$1'); } return val; diff --git a/src/device-state/preload.ts b/src/device-state/preload.ts index 088f8e0d..654b9aec 100644 --- a/src/device-state/preload.ts +++ b/src/device-state/preload.ts @@ -61,7 +61,7 @@ export async function loadTargetFromFile(appsPath: string): Promise { throw new AppsJsonParseError(e); } - if (_.isArray(stateFromFile)) { + if (Array.isArray(stateFromFile)) { log.debug('Detected a legacy apps.json, converting...'); stateFromFile = fromLegacyAppsJson(stateFromFile as any[]); } diff --git a/src/host-config.ts b/src/host-config.ts index ea43175a..31c56eb7 100644 --- a/src/host-config.ts +++ b/src/host-config.ts @@ -133,7 +133,7 @@ async function setProxy(maybeConf: ProxyConfig | null): Promise { // but the compiler doesn't const conf = maybeConf as ProxyConfig; await mkdirp(proxyBasePath); - if (_.isArray(conf.noProxy)) { + if (Array.isArray(conf.noProxy)) { await writeToBoot(noProxyPath, conf.noProxy.join('\n')); } diff --git a/test/lib/mocked-iptables.ts b/test/lib/mocked-iptables.ts index b864fdd0..666687cd 100644 --- a/test/lib/mocked-iptables.ts +++ b/test/lib/mocked-iptables.ts @@ -38,7 +38,7 @@ class FakeRuleAdaptor { return ''; }; - if (_.isArray(rules)) { + if (Array.isArray(rules)) { for (const rule of rules) { await handleRule(rule); }