Switch _.assign usage to native versions

Change-type: patch
This commit is contained in:
Pagan Gazzard 2023-10-13 15:22:45 +01:00 committed by Felipe Lalanne
parent d0cb54537f
commit a4a9a17c1a
6 changed files with 8 additions and 8 deletions

View File

@ -714,7 +714,7 @@ export class Service {
// Typings are wrong here, the docker daemon accepts a string or string[],
Entrypoint: this.config.entrypoint as string,
Env: conversions.envObjectToArray(
_.assign(
Object.assign(
{
RESIN_DEVICE_NAME_AT_INIT: opts.deviceName,
BALENA_DEVICE_NAME_AT_INIT: opts.deviceName,
@ -996,7 +996,7 @@ export class Service {
): { [envVarName: string]: string } {
const defaultEnv: { [envVarName: string]: string } = {};
for (const namespace of ['BALENA', 'RESIN']) {
_.assign(
Object.assign(
defaultEnv,
_.mapKeys(
{

View File

@ -253,7 +253,7 @@ export function getHealthcheck(
composeHealthcheckToServiceHealthcheck(composeHealthcheck);
// Overlay any compose healthcheck fields on the image healthchecks
return _.assign(
return Object.assign(
{ test: ['NONE'] },
imageServiceHealthcheck,
composeServiceHealthcheck,
@ -556,7 +556,7 @@ export function normalizeLabels(labels: { [key: string]: string }): {
labels,
(_v, k) => !(_.startsWith(k, 'io.balena.') || _.startsWith(k, 'io.resin.')),
);
return _.assign({}, otherLabels, legacyLabels, balenaLabels);
return Object.assign({}, otherLabels, legacyLabels, balenaLabels);
}
function compareArrayField(

View File

@ -17,7 +17,7 @@ export default class ConfigJsonConfigBackend {
private cache: { [key: string]: unknown } = {};
private readonly init = _.once(async () =>
_.assign(this.cache, await this.read()),
Object.assign(this.cache, await this.read()),
);
public constructor(schema: Schema.Schema, configPath?: string) {

View File

@ -311,7 +311,7 @@ export async function getCurrent(): Promise<Dictionary<string>> {
const backends = await getConfigBackends();
// Add each backends configurable values
for (const backend of backends) {
_.assign(currentConf, await getBootConfig(backend));
Object.assign(currentConf, await getBootConfig(backend));
}
// Return compiled configuration
return currentConf;

View File

@ -87,7 +87,7 @@ export class BalenaLogBackend extends LogBackend {
return;
}
message = _.assign(
message = Object.assign(
{
timestamp: Date.now(),
message: '',

View File

@ -32,7 +32,7 @@ export class LocalLogBackend extends LogBackend {
// we would need a way of invalidating the cache
const serviceName = await this.serviceNameResolver(svcId);
_.assign({}, { serviceName }, message);
message = Object.assign({}, { serviceName }, message);
}
_.each(this.globalListeners, (listener) => {
listener.push(`${JSON.stringify(message)}\n`);