Skip to content

Commit

Permalink
Replace util._extend with Object.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
egoroof authored and Unitech committed Jul 4, 2024
1 parent 809dfd7 commit b5e65bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ServiceManager } from './serviceManager'
import Autocast from './utils/autocast'
import * as path from 'path'
import * as fs from 'fs'
import * as util from 'util'

export default class Configuration {

Expand Down Expand Up @@ -83,7 +82,7 @@ export default class Configuration {
conf.description = packageJson.description

if (packageJson.config) {
conf = util['_extend'](conf, packageJson.config)
conf = Object.assign(conf, packageJson.config)
conf.module_conf = packageJson.config
}
} catch (e) {
Expand All @@ -97,7 +96,7 @@ export default class Configuration {
conf.module_version = packageJson.version

if (packageJson.config) {
conf = util['_extend'](conf, packageJson.config)
conf = Object.assign(conf, packageJson.config)
conf.module_conf = packageJson.config
}
} catch (e) {
Expand All @@ -111,11 +110,11 @@ export default class Configuration {
try {
if (process.env[conf.module_name]) {
const castedConf = new Autocast().autocast(JSON.parse(process.env[conf.module_name] || ''))
conf = util['_extend'](conf, castedConf)
conf = Object.assign(conf, castedConf)
// Do not display probe configuration in Keymetrics
delete castedConf.probes
// This is the configuration variable modifiable from keymetrics
conf.module_conf = JSON.parse(JSON.stringify(util['_extend'](conf.module_conf, castedConf)))
conf.module_conf = JSON.parse(JSON.stringify(Object.assign(conf.module_conf, castedConf)))

// Obfuscate passwords
Object.keys(conf.module_conf).forEach(function (key) {
Expand Down

0 comments on commit b5e65bc

Please sign in to comment.