bajo 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/boot/lib/bora.js +7 -2
  2. package/package.json +1 -1
package/boot/lib/bora.js CHANGED
@@ -36,9 +36,14 @@ class Bora {
36
36
  if (isPlainObject(args[0])) text = i18n.t(text, args[0])
37
37
  else text = i18n.t(text, { ns: this.ns, postProcess: 'sprintf', sprintf: args })
38
38
  } else text = sprintf(text, ...args)
39
+ let opts = last(args)
40
+ if (!isPlainObject(opts)) opts = {}
39
41
  const elapsed = dayjs().diff(this.startTime, 'second')
40
- if (this.opts.showCounter) text = `[${secToHms(elapsed)}] ${text}`
41
- this.ora.text = text
42
+ const texts = []
43
+ if (this.opts.showDatetime || opts.showDatetime) texts.push('[' + dayjs().toISOString() + ']')
44
+ if (this.opts.showCounter || opts.showCounter) texts.push('[' + secToHms(elapsed) + ']')
45
+ texts.push(text)
46
+ this.ora.text = texts.join(' ')
42
47
  }
43
48
  return this
44
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "A framework to build a giant monstrous app rapidly",
5
5
  "main": "boot/index.js",
6
6
  "scripts": {