function updateItemName(item) { var attributes = getSignatureAttributes(item); var itemName = item.name || ''; if (item.variable) { itemName = '…' + itemName; } if (attributes && attributes.length) { itemName = util.format( '%s<span class="signature-attributes">%s</span>', itemName, attributes.join(', ') ); } return itemName; }
function addAttribs(f) { var attribs = helper.getAttribs(f); var attribsString = buildAttribsString(attribs); f.attribs = util.format('<span class="type-signature">%s</span>', attribsString); }
function isRunning(pid, callback) { pid ? cp.exec(util.format(CHECK_RUNNING_CMD, pid), function (err, stdout, stderr) { callback(!err && !!stdout.toString().trim()); }) : callback(); }
LEVELS.forEach(function(level) { exports[level] = function(msg) { if (msg == null && arguments.length < 2) { return; } log(util.format.apply(null, arguments), level); }; });
function addSignatureParams(f) { var params = f.params ? addParamAttributes(f.params) : []; f.signature = util.format( '%s(%s)', (f.signature || ''), params.join(', ') ); }
function buildAttribsString(attribs) { var attribsString = ''; if (attribs && attribs.length) { attribsString = htmlsafe( util.format('(%s) ', attribs.join(', ')) ); } return attribsString; }
static formatColor(args, color) { return args.map(a => `\x1b[${color}m${util.format(a)}\x1b[0m`); }
returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') );
/* Normal response from the API indicating the request failed. */ function TelegramError(err, req) { var temp = Error.call(this, req.method + " failed: " + err.description); temp.name = this.name = "TelegramError"; this.stack = temp.stack; this.message = temp.message; this.err = err; this.req = req; var params = util.inspect(this.req.parameters, { depth: 1 }); this.req.message = util.format("When calling method %s: %s", this.req.method, params); this.stack += "\n" + this.req.stack.toString().substring(7); }
function getSqlite3InsertionCommand (destinationTCCFile, service, appName) { return util.format('sqlite3 %s "insert into access' + '(service, client, client_type, allowed, prompt_count, csreq) values(\'%s\', \'%s\', ' + '0,1,1,NULL)"', destinationTCCFile, service, appName); }
var fu = function (type, args) { var t = Math.ceil((rl.line.length + 3) / process.stdout.columns); var text = util.format.apply(console, args); rl.output.write("\n\x1B[" + t + "A\x1B[0J"); rl.output.write(text + "\n"); rl.output.write(Array(t).join("\n\x1B[E")); rl._refreshLine(); }
onCompleted(user, text, id, rem) { var self = this; self.bot.sendMessage(id, util.format("@%s asked to recall\n%s", user, text)).then(function () { debug(`reminder '${text}' completed for ${user}`); self.remove(rem); }).catch(function(e) { debug(`reminder '${text}' failed for ${user} with ${e}`); self.remove(rem); }); }
before(done => { edgeOrg.environments.get((e, result) => { assert.isNull(e, "error listing: " + util.format(e)); envlist = result; done(); }); });
function updateItemName(item) { var attributes = getSignatureAttributes(item); var itemName = item.name || ''; if (item.variable) { itemName = '…' + itemName; } if (attributes && attributes.length) { itemName = util.format( '%s<span class="signature-attributes">%s</span>', itemName, attributes.join(', ') ); } return itemName; }