nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: pinojs/pino
Pull request #707 (2019-09-11 12:27:25)

fix(serializers): properly transfer Symbol based serializers
When adding serializers through `.child`, the Symbol based serializers were not transferred. For example: https://github.com/pinojs/pino/blob/master/docs/api.md#serializerssymbolforpino-function

Thanks to @ZwaarContrast for helping with debugging!


Patch:
diff --git a/lib/proto.js b/lib/proto.js
index 1ec71cf..8dca09c 100644
--- a/lib/proto.js
+++ b/lib/proto.js
@@ -72,12 +72,24 @@ function child (bindings) {
   const instance = Object.create(this)
   if (bindings.hasOwnProperty('serializers') === true) {
     instance[serializersSym] = Object.create(null)
+
     for (var k in serializers) {
       instance[serializersSym][k] = serializers[k]
     }
+    const parentSymbols = Object.getOwnPropertySymbols(serializers)
+    for (var i = 0; i < parentSymbols.length; i++) {
+      const ks = parentSymbols[i]
+      instance[serializersSym][ks] = serializers[ks]
+    }
+
     for (var bk in bindings.serializers) {
       instance[serializersSym][bk] = bindings.serializers[bk]
     }
+    const bindingsSymbols = Object.getOwnPropertySymbols(bindings.serializers)
+    for (var bi = 0; bi < bindingsSymbols.length; bi++) {
+      const bks = bindingsSymbols[bi]
+      instance[serializersSym][bks] = bindings.serializers[bks]
+    }
   } else instance[serializersSym] = serializers
   if (bindings.hasOwnProperty('customLevels') === true) {
     assertNoLevelCollisions(this.levels, bindings.customLevels)


Test patch:
diff --git a/test/serializers.test.js b/test/serializers.test.js
index c6a7079..70e8a6a 100644
--- a/test/serializers.test.js
+++ b/test/serializers.test.js
@@ -124,6 +124,32 @@ test('children inherit parent serializers', async ({ is }) => {
   is(o.test, 'parent')
 })
 
+test('children inherit parent Symbol serializers', async ({ is, isNot }) => {
+  const stream = sink()
+  const symbolSerializers = {
+    [Symbol.for('pino.*')]: parentSerializers.test
+  }
+  const parent = pino({ serializers: symbolSerializers }, stream)
+
+  is(parent[Symbol.for('pino.serializers')], symbolSerializers)
+
+  const child = parent.child({
+    serializers: {
+      [Symbol.for('a')]: a,
+      a
+    }
+  })
+
+  function a () {
+    return 'hello'
+  }
+
+  isNot(child[Symbol.for('pino.serializers')], symbolSerializers)
+  is(child[Symbol.for('pino.serializers')].a, a)
+  is(child[Symbol.for('pino.serializers')][Symbol.for('a')], a)
+  is(child[Symbol.for('pino.serializers')][Symbol.for('pino.*')], parentSerializers.test)
+})
+
 test('children serializers get called', async ({ is }) => {
   const stream = sink()
   const parent = pino({
Repository: pinojs/pino
Pull request #730 (2019-10-12 16:40:28)

always sync flush fatal log messages
it occurred to me today that if you ever write a fatal log, it's because the server is crashing or because you need to crash the server.

e.g.

```js
if (thisIsAnImpossibleSituation) {
  pino.fatal(`there's no where to go, we have to crash`)
  process.exit(1)
}
```

In this scenario, we *always* want to sync flush, and there's no legit scenarios where fatal would be used other than in a death spiral.



Patch:
diff --git a/docs/api.md b/docs/api.md
index a6b389e..7e7afae 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -434,6 +434,13 @@ Write a `'error'` level log, if the configured `level` allows for it.
 
 Write a `'fatal'` level log, if the configured `level` allows for it.
 
+Since `'fatal'` level messages are intended to be logged just prior to the process exiting the `fatal`
+method will always sync flush the destination.
+Therefore it's important not to misuse `fatal` since
+it will cause performance overhead if used for any
+other purpose than writing final log messages before
+the process crashes or exits.
+
 * See [`mergingObject` log method parameter](#mergingobject)
 * See [`message` log method parameter](#message)
 * See [`...interpolationValues` log method parameter](#interpolationvalues)
diff --git a/lib/levels.js b/lib/levels.js
index ea8c33b..a9e0e55 100644
--- a/lib/levels.js
+++ b/lib/levels.js
@@ -1,6 +1,13 @@
 'use strict'
 const flatstr = require('flatstr')
-const { lsCacheSym, levelValSym, useLevelLabelsSym, changeLevelNameSym, useOnlyCustomLevelsSym } = require('./symbols')
+const {
+  lsCacheSym,
+  levelValSym,
+  useLevelLabelsSym,
+  changeLevelNameSym,
+  useOnlyCustomLevelsSym,
+  streamSym
+} = require('./symbols')
 const { noop, genLog } = require('./tools')
 
 const levels = {
@@ -11,9 +18,15 @@ const levels = {
   error: 50,
   fatal: 60
 }
-
+const logFatal = genLog(levels.fatal)
 const levelMethods = {
-  fatal: genLog(levels.fatal),
+  fatal (...args) {
+    const stream = this[streamSym]
+    logFatal.call(this, ...args)
+    if (typeof stream.flushSync === 'function') {
+      stream.flushSync()
+    }
+  },
   error: genLog(levels.error),
   warn: genLog(levels.warn),
   info: genLog(levels.info),


Test patch:
diff --git a/test/levels.test.js b/test/levels.test.js
index 8397e74..4643ad8 100644
--- a/test/levels.test.js
+++ b/test/levels.test.js
@@ -402,3 +402,18 @@ test('passes when creating a default value that exists in logger levels', async
     level: 30
   })
 })
+
+test('fatal method sync-flushes the destination if sync flushing is available', async ({ pass, doesNotThrow, plan }) => {
+  plan(2)
+  const stream = sink()
+  stream.flushSync = () => {
+    pass('destination flushed')
+  }
+  const instance = pino(stream)
+  instance.fatal('this is fatal')
+  await once(stream, 'data')
+  doesNotThrow(() => {
+    stream.flushSync = undefined
+    instance.fatal('this is fatal')
+  })
+})
Repository: pinojs/pino
Pull request #754 (2019-12-12 20:04:37)

feat(bindings): allow setting of bindings
I'm in the process of replacing a node-bunyan logger, and pino fits perfectly. Only issue is that we have a use case for dynamically setting bindings. Let me know if this or something like it (or something completely different that gets the job done) would be a good fit for pino. Thanks!

erikwlarsen: Great, thanks for reviewing. What's the process for merging/releasing?
jsumners: Patience. 

Patch:
diff --git a/lib/proto.js b/lib/proto.js
index a063b21..5099727 100644
--- a/lib/proto.js
+++ b/lib/proto.js
@@ -47,6 +47,7 @@ const prototype = {
   constructor,
   child,
   bindings,
+  setBindings,
   flush,
   isLevelEnabled,
   version,
@@ -113,6 +114,11 @@ function bindings () {
   return bindingsFromJson
 }
 
+function setBindings (newBindings) {
+  const chindings = asChindings(this, newBindings)
+  this[chindingsSym] = chindings
+}
+
 function write (_obj, msg, num) {
   const t = this[timeSym]()
   const messageKey = this[messageKeySym]


Test patch:
diff --git a/test/basic.test.js b/test/basic.test.js
index 0cb09aa..fbb1c96 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -51,6 +51,39 @@ test('bindings contain the name and the child bindings', async ({ same }) => {
   same(instance.bindings(), { name: 'basicTest', foo: 'bar', a: 2 })
 })
 
+test('set bindings on instance', async ({ same }) => {
+  const instance = pino({ name: 'basicTest', level: 'info' })
+  instance.setBindings({ foo: 'bar' })
+  same(instance.bindings(), { name: 'basicTest', foo: 'bar' })
+})
+
+test('newly set bindings overwrite old bindings', async ({ same }) => {
+  const instance = pino({ name: 'basicTest', level: 'info', base: { foo: 'bar' } })
+  instance.setBindings({ foo: 'baz' })
+  same(instance.bindings(), { name: 'basicTest', foo: 'baz' })
+})
+
+test('set bindings on child instance', async ({ same }) => {
+  const child = pino({ name: 'basicTest', level: 'info' }).child({})
+  child.setBindings({ foo: 'bar' })
+  same(child.bindings(), { name: 'basicTest', foo: 'bar' })
+})
+
+test('child should have bindings set by parent', async ({ same }) => {
+  const instance = pino({ name: 'basicTest', level: 'info' })
+  instance.setBindings({ foo: 'bar' })
+  const child = instance.child({})
+  same(child.bindings(), { name: 'basicTest', foo: 'bar' })
+})
+
+test('child should not share bindings of parent set after child creation', async ({ same }) => {
+  const instance = pino({ name: 'basicTest', level: 'info' })
+  const child = instance.child({})
+  instance.setBindings({ foo: 'bar' })
+  same(instance.bindings(), { name: 'basicTest', foo: 'bar' })
+  same(child.bindings(), { name: 'basicTest' })
+})
+
 function levelTest (name, level) {
   test(`${name} logs as ${level}`, async ({ is }) => {
     const stream = sink()
Repository: pinojs/pino
Pull request #757 (2020-01-06 22:04:30)

provide ISO8601 time format

matthewadams: @mcollina no problem -- couldn't really find where they were located for these time format functions, but I'll have a looky-poo.
matthewadams: ok tests added
matthewadams: docs added

Patch:
diff --git a/docs/api.md b/docs/api.md
index 6e15ba3..8525a7e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -807,6 +807,7 @@ The `pino.stdTimeFunctions` object provides a very small set of common functions
 * `pino.stdTimeFunctions.epochTime`: Milliseconds since Unix epoch (Default)
 * `pino.stdTimeFunctions.unixTime`: Seconds since Unix epoch
 * `pino.stdTimeFunctions.nullTime`: Clears timestamp property (Used when `timestamp: false`)
+* `pino.stdTimeFunctions.isoTime`: ISO 8601-formatted time in UTC
 
 * See [`timestamp` option](#opt-timestamp)
 
diff --git a/lib/time.js b/lib/time.js
index 104c440..420a028 100644
--- a/lib/time.js
+++ b/lib/time.js
@@ -6,4 +6,6 @@ const epochTime = () => `,"time":${Date.now()}`
 
 const unixTime = () => `,"time":${Math.round(Date.now() / 1000.0)}`
 
-module.exports = { nullTime, epochTime, unixTime }
+const isoTime = () => `,"time":"${new Date(Date.now()).toISOString()}"` // using Date.now() for testability
+
+module.exports = { nullTime, epochTime, unixTime, isoTime }


Test patch:
diff --git a/test/timestamp.test.js b/test/timestamp.test.js
index 89e7843..87bdc09 100644
--- a/test/timestamp.test.js
+++ b/test/timestamp.test.js
@@ -11,6 +11,7 @@ test('pino exposes standard time functions', async ({ ok }) => {
   ok(pino.stdTimeFunctions.epochTime)
   ok(pino.stdTimeFunctions.unixTime)
   ok(pino.stdTimeFunctions.nullTime)
+  ok(pino.stdTimeFunctions.isoTime)
 })
 
 test('pino accepts external time functions', async ({ is }) => {
@@ -101,3 +102,20 @@ test('pino.stdTimeFunctions.unixTime returns seconds based timestamps', async ({
   is(result.time, 1531069920)
   Date.now = now
 })
+
+test('pino.stdTimeFunctions.isoTime returns ISO 8601 timestamps', async ({ is }) => {
+  const opts = {
+    timestamp: pino.stdTimeFunctions.isoTime
+  }
+  const stream = sink()
+  const instance = pino(opts, stream)
+  const ms = 1531069919686
+  const now = Date.now
+  Date.now = () => ms
+  const iso = new Date(ms).toISOString()
+  instance.info('foobar')
+  const result = await once(stream, 'data')
+  is(result.hasOwnProperty('time'), true)
+  is(result.time, iso)
+  Date.now = now
+})
Repository: pinojs/pino
Pull request #777 (2020-02-24 23:18:36)

Makes #711 mergable
@NikxDa I don't know what GitHub is trying do in #711 with your rebase. So here's one that works.

jsumners: Merging this since everything was approved in #711.

Patch:
diff --git a/example.js b/example.js
index 5e39692..866338e 100644
--- a/example.js
+++ b/example.js
@@ -31,5 +31,6 @@ pino.trace('this is a trace statement')
 pino.debug('this is a "debug" statement with "')
 
 pino.info(new Error('kaboom'))
+pino.info(null)
 
 pino.info(new Error('kaboom'), 'with', 'a', 'message')
diff --git a/lib/tools.js b/lib/tools.js
index e446c43..16a209f 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -28,15 +28,20 @@ function noop () {}
 
 function genLog (z) {
   return function LOG (o, ...n) {
-    if (typeof o === 'object' && o !== null) {
-      if (o.method && o.headers && o.socket) {
-        o = mapHttpRequest(o)
-      } else if (typeof o.setHeader === 'function') {
-        o = mapHttpResponse(o)
+    if (typeof o === 'object') {
+      if (o !== null) {
+        if (o.method && o.headers && o.socket) {
+          o = mapHttpRequest(o)
+        } else if (typeof o.setHeader === 'function') {
+          o = mapHttpResponse(o)
+        }
       }
       if (this[nestedKeySym]) o = { [this[nestedKeySym]]: o }
-      this[writeSym](o, format(null, n, this[formatOptsSym]), z)
-    } else this[writeSym](null, format(o, n, this[formatOptsSym]), z)
+      const formatParams = (o === null && n.length === 0) ? [null] : n
+      this[writeSym](o, format(null, formatParams, this[formatOptsSym]), z)
+    } else {
+      this[writeSym](null, format(o, n, this[formatOptsSym]), z)
+    }
   }
 }
 


Test patch:
diff --git a/test/levels.test.js b/test/levels.test.js
index b7ac1cc..06fea3e 100644
--- a/test/levels.test.js
+++ b/test/levels.test.js
@@ -403,6 +403,36 @@ test('passes when creating a default value that exists in logger levels', async
   })
 })
 
+test('log null value when message is null', async ({ is }) => {
+  const expected = {
+    msg: null,
+    level: 30
+  }
+
+  const stream = sink()
+  const instance = pino(stream)
+  instance.level = 'info'
+  instance.info(null)
+
+  const result = await once(stream, 'data')
+  check(is, result, expected.level, expected.msg)
+})
+
+test('concatenate multiple params when base param is null', async ({ is }) => {
+  const expected = {
+    msg: 'a string',
+    level: 30
+  }
+
+  const stream = sink()
+  const instance = pino(stream)
+  instance.level = 'info'
+  instance.info(null, 'a', 'string')
+
+  const result = await once(stream, 'data')
+  check(is, result, expected.level, expected.msg)
+})
+
 test('fatal method sync-flushes the destination if sync flushing is available', async ({ pass, doesNotThrow, plan }) => {
   plan(2)
   const stream = sink()
Repository: pinojs/pino
Pull request #780 (2020-02-28 12:24:43)

Fixed stream metadata loss during prettification
For streams with Symbol('metadata') true flag, pino metadata was lost during prettification.

RE: https://github.com/pinojs/pino-multi-stream/issues/31


Patch:
diff --git a/lib/tools.js b/lib/tools.js
index 02127ff..fe89a0b 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -178,6 +178,7 @@ function prettifierMetaWrapper (pretty, dest) {
         return
       }
       warned = true
+      setMetadataProps(dest, this)
       dest.write(pretty(Object.assign({
         level: 40, // warn
         msg: 'pino.final with prettyPrint does not support flushing',
@@ -237,6 +238,8 @@ function prettifierMetaWrapper (pretty, dest) {
 
       const formatted = pretty(typeof redact === 'function' ? redact(obj) : obj)
       if (formatted === undefined) return
+
+      setMetadataProps(dest, this)
       dest.write(formatted)
     }
   }
@@ -351,6 +354,16 @@ function stringify (obj) {
   }
 }
 
+function setMetadataProps (dest, that) {
+  if (dest[needsMetadataGsym] === true) {
+    dest.lastLevel = that.lastLevel
+    dest.lastMsg = that.lastMsg
+    dest.lastObj = that.lastObj
+    dest.lastTime = that.lastTime
+    dest.lastLogger = that.lastLogger
+  }
+}
+
 module.exports = {
   noop,
   buildSafeSonicBoom,


Test patch:
diff --git a/test/pretty.test.js b/test/pretty.test.js
index caf9f62..4017d0c 100644
--- a/test/pretty.test.js
+++ b/test/pretty.test.js
@@ -272,3 +272,41 @@ test('works as expected with an object with the msg prop', async ({ isNot }) =>
   await once(child, 'close')
   isNot(actual.match(/\(123456 on abcdefghijklmnopqr\): hello/), null)
 })
+
+test('should not lose stream metadata for streams with `needsMetadataGsym` flag', async ({ isNot }) => {
+  const dest = new Writable({
+    objectMode: true,
+    write () {
+      isNot(typeof this.lastLevel === 'undefined', true)
+      isNot(typeof this.lastMsg === 'undefined', true)
+      isNot(typeof this.lastObj === 'undefined', true)
+      isNot(typeof this.lastTime === 'undefined', true)
+      isNot(typeof this.lastLogger === 'undefined', true)
+    }
+  })
+
+  dest[pino.symbols.needsMetadataGsym] = true
+
+  const log = pino({
+    prettyPrint: true
+  }, dest)
+  log.info('foo')
+})
+
+test('should not add stream metadata for streams without `needsMetadataGsym` flag', async ({ is }) => {
+  const dest = new Writable({
+    objectMode: true,
+    write () {
+      is(typeof this.lastLevel === 'undefined', true)
+      is(typeof this.lastMsg === 'undefined', true)
+      is(typeof this.lastObj === 'undefined', true)
+      is(typeof this.lastTime === 'undefined', true)
+      is(typeof this.lastLogger === 'undefined', true)
+    }
+  })
+
+  const log = pino({
+    prettyPrint: true
+  }, dest)
+  log.info('foo')
+})
Repository: pinojs/pino
Pull request #810 (2020-04-04 09:27:10)

Correctly forwards chindings to prettyPrint when using option
Fixes https://github.com/pinojs/pino-pretty/issues/104


Patch:
diff --git a/lib/tools.js b/lib/tools.js
index aa2e90d..7992c30 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -243,7 +243,7 @@ function prettifierMetaWrapper (pretty, dest) {
       const obj = Object.assign({
         level: this.lastLevel,
         time
-      }, chindings, lastObj, errorProps)
+      }, lastObj, errorProps)
 
       const serializers = lastLogger[serializersSym]
       const keys = Object.keys(serializers)
@@ -256,6 +256,12 @@ function prettifierMetaWrapper (pretty, dest) {
         }
       }
 
+      for (key in chindings) {
+        if (!obj.hasOwnProperty(key)) {
+          obj[key] = chindings[key]
+        }
+      }
+
       const stringifiers = lastLogger[stringifiersSym]
       const redact = stringifiers[redactFmtSym]
 


Test patch:
diff --git a/test/fixtures/pretty/child-with-serializer.js b/test/fixtures/pretty/child-with-serializer.js
new file mode 100644
index 0000000..4054da1
--- /dev/null
+++ b/test/fixtures/pretty/child-with-serializer.js
@@ -0,0 +1,17 @@
+global.process = { __proto__: process, pid: 123456 }
+Date.now = function () { return 1459875739796 }
+require('os').hostname = function () { return 'abcdefghijklmnopqr' }
+var pino = require(require.resolve('./../../../'))
+var log = pino({
+  prettyPrint: true,
+  serializers: {
+    a (num) {
+      return num * 2
+    }
+  }
+})
+log.info({ a: 1 }, 'h')
+const child = log.child({ a: 8 })
+child.info('h2')
+child.child({ b: 2 }).info('h3')
+child.info({ a: 21 }, 'h4')
diff --git a/test/pretty.test.js b/test/pretty.test.js
index b9f2223..fa86649 100644
--- a/test/pretty.test.js
+++ b/test/pretty.test.js
@@ -112,6 +112,25 @@ test('parses and outputs chindings', async ({ is, isNot }) => {
   is(strip(actual).match(/a: 1/g).length, 3)
 })
 
+test('parses and outputs chindings with serializer', async ({ is, isNot }) => {
+  var actual = ''
+  const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'child-with-serializer.js')])
+
+  child.stdout.pipe(writer((s, enc, cb) => {
+    actual += s
+    cb()
+  }))
+  await once(child, 'close')
+  isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h/), null)
+  isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h2/), null)
+  isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h3/), null)
+  isNot(strip(actual).match(/\(123456 on abcdefghijklmnopqr\): h4/), null)
+  isNot(strip(actual).match(/a: 2/), null)
+  isNot(strip(actual).match(/a: 16/), null)
+  isNot(strip(actual).match(/a: 42/), null)
+  is(strip(actual).match(/a: /g).length, 4)
+})
+
 test('applies serializers', async ({ is, isNot }) => {
   var actual = ''
   const child = execa(process.argv[0], [join(__dirname, 'fixtures', 'pretty', 'serializers.js')])
Repository: pinojs/pino
Pull request #856 (2020-06-02 09:06:01)

Issue 87 child binding redact bug
Hello, it's a fix for the issue https://github.com/pinojs/pino/issues/847

baterson: @mcollina Thanks! Btw what does `chindings` mean? Is it "child bindings"?
mcollina: > Btw what does chindings mean? Is it "child bindings"?

Exactly that. @davidmarkclements loves to create new words.

Patch:
diff --git a/lib/tools.js b/lib/tools.js
index 50decf1..f45f898 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -152,6 +152,7 @@ function asChindings (instance, bindings) {
   var data = instance[chindingsSym]
   const stringify = instance[stringifySym]
   const stringifiers = instance[stringifiersSym]
+  const wildcardStringifier = stringifiers[wildcardFirstSym]
   const serializers = instance[serializersSym]
   const formatter = instance[formattersSym].bindings
   bindings = formatter(bindings)
@@ -166,7 +167,7 @@ function asChindings (instance, bindings) {
       value !== undefined
     if (valid === true) {
       value = serializers[key] ? serializers[key](value) : value
-      value = (stringifiers[key] || stringify)(value)
+      value = (stringifiers[key] || wildcardStringifier || stringify)(value)
       if (value === undefined) continue
       data += ',"' + key + '":' + value
     }


Test patch:
diff --git a/test/redact.test.js b/test/redact.test.js
index 34a58de..cab6618 100644
--- a/test/redact.test.js
+++ b/test/redact.test.js
@@ -711,3 +711,36 @@ test('supports leading bracket notation (single-segment path, wilcard)', async (
   const o = await once(stream, 'data')
   is(o['a.a'], '[Redacted]')
 })
+
+test('child bindings are redacted using wildcard path', async ({ is }) => {
+  const stream = sink()
+  const instance = pino({ redact: ['*.headers.cookie'] }, stream)
+  instance.child({
+    req: {
+      method: 'GET',
+      url: '/',
+      headers: {
+        cookie: 'SESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;'
+      }
+    }
+  }).info('message completed')
+  const { req } = await once(stream, 'data')
+  is(req.headers.cookie, '[Redacted]')
+})
+
+test('child bindings are redacted using wildcard and plain path keys', async ({ is }) => {
+  const stream = sink()
+  const instance = pino({ redact: ['req.method', '*.headers.cookie'] }, stream)
+  instance.child({
+    req: {
+      method: 'GET',
+      url: '/',
+      headers: {
+        cookie: 'SESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1;'
+      }
+    }
+  }).info('message completed')
+  const { req } = await once(stream, 'data')
+  is(req.headers.cookie, '[Redacted]')
+  is(req.method, '[Redacted]')
+})
Repository: pinojs/pino
Pull request #907 (2020-09-09 21:28:37)

Eliminate quotes from ISO time
Hello people,

This pull request fixes the quotes issue mentioned in #905 

Please let me know if there is any room for improvement.

Thanks,
Jafer


Patch:
diff --git a/lib/tools.js b/lib/tools.js
index f45f898..e6b2abd 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -237,6 +237,8 @@ function prettifierMetaWrapper (pretty, dest, opts) {
 
       if (time.match(/^\d+/)) {
         time = parseInt(time)
+      } else {
+        time = time.slice(1, -1)
       }
 
       var lastObj = this.lastObj


Test patch:
diff --git a/test/pretty.test.js b/test/pretty.test.js
index 6fd895c..d88acf2 100644
--- a/test/pretty.test.js
+++ b/test/pretty.test.js
@@ -218,7 +218,7 @@ test('with custom timestamp', async ({ is }) => {
     cb()
   }))
   await once(child, 'close')
-  is(strip(actual).slice(0, 8), '["test"]')
+  is(strip(actual).slice(0, 6), '[test]')
 })
 
 test('with custom timestamp label', async ({ is }) => {
@@ -230,7 +230,7 @@ test('with custom timestamp label', async ({ is }) => {
     cb()
   }))
   await once(child, 'close')
-  is(strip(actual).slice(0, 8), '["test"]')
+  is(strip(actual).slice(0, 6), '[test]')
 })
 
 test('errors', async ({ isNot }) => {