added unit testing, and started implementing unit tests...phew
This commit is contained in:
26
node_modules/logform/printf.js
generated
vendored
Normal file
26
node_modules/logform/printf.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
'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;
|
Reference in New Issue
Block a user