remove usage of util.format

This commit is contained in:
Girish Ramakrishnan
2025-01-31 09:41:10 +01:00
parent dcae882009
commit 6cd97d2cb9
7 changed files with 13 additions and 19 deletions

View File

@@ -18,13 +18,12 @@ const assert = require('assert'),
dns = require('../dns.js'),
safe = require('safetydance'),
superagent = require('superagent'),
util = require('util'),
waitForDns = require('./waitfordns.js');
const LINODE_ENDPOINT = 'https://api.linode.com/v4';
function formatError(response) {
return util.format('Linode DNS error [%s] %j', response.statusCode, response.body);
return `Linode DNS error [${response.statusCode}] ${JSON.stringify(response.body)}`;
}
function removePrivateFields(domainObject) {
@@ -126,7 +125,8 @@ async function upsert(domainObject, location, type, values) {
debug('upsert: %s for zone %s of type %s with values %j', name, zoneName, type, values);
const { zoneId, records } = await getZoneRecords(domainConfig, zoneName, name, type);
let i = 0, recordIds = []; // used to track available records to update instead of create
let i = 0; // used to track available records to update instead of create
const recordIds = [];
for (const value of values) {
const data = {