Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/formatter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const _stringWidth = require('string-width');
const _defaultFormatValue = require('./format-value');
const _defaultFormatBar = require('./format-bar');
const _defaultFormatTime = require('./format-time');
let _stringWidth;

if (typeof Bun !== 'undefined') {
_stringWidth = Bun.stringWidth;
} else {
_stringWidth = require('string-width');
}

// generic formatter
module.exports = function defaultFormatter(options, params, payload){
Expand Down