Files
NapCatQQ/.pnpm-store/v3/files/4d/01ac5afecb59ca99eee18add2f39921847865e2afac248a2befcf4f64cd3a3ccce442c967e55cc5694ad2578d320c69755b5958ad293d893f75514273ebb8f
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

27 lines
515 B
Plaintext

'use strict';
const { MESSAGE } = require('triple-beam');
class Printf {
constructor(templateFn) {
this.template = templateFn;
}
transform(info) {
info[MESSAGE] = this.template(info);
return info;
}
}
/*
* function printf (templateFn)
* Returns a new instance of the printf Format that creates an
* intermediate prototype to store the template string-based formatter
* function.
*/
module.exports = opts => new Printf(opts);
module.exports.Printf
= module.exports.Format
= Printf;