pear-terminal 1.1.2 → 1.1.3

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/index.js +4 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -292,12 +292,12 @@ const outputter =
292
292
  stdio.out.write(ansi.showCursor())
293
293
  })
294
294
  : null
295
- if (typeof opts === 'boolean') opts = { json: opts }
296
- const { json = false, log, mod = () => {} } = opts
295
+ if (typeof opts === 'boolean' || typeof opts === 'function') opts = { json: opts }
296
+ const { json = false, log } = opts
297
297
  const promise = opwait(stream, ({ tag, data }) => {
298
- mod(tag, data)
299
298
  if (json) {
300
- const str = JSON.stringify({ cmd, tag, data })
299
+ const replacer = typeof json === 'function' ? json : null
300
+ const str = JSON.stringify({ cmd, tag, data }, replacer)
301
301
  if (log) log(str)
302
302
  else print(str)
303
303
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pear-terminal",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "main": "index.js",
5
5
  "type": "commonjs",
6
6
  "description": "Pear Terminal User Interface library",