when %j exists in a formatted object, it pulls in the timestamp/delta

Abierto
#687 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript

Línea de trabajo

Start with the formatter path exercised by demo('%o', data) and reproduce the example using data containing '%j'. Trace how recursive formatting handles the timestamp or delta arguments, then verify the corrected output against the reported expectation that the timestamp/delta is not consumed or misplaced.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug change-patch help-wanted pr-welcome

I found this when debugging some mysql search strings, so for example looking for a name like "jordan" to appear somewhere in a string, but wrapped with % to match anywhere in the string: %jordan%...

repro:

const demo = require('debug')('demo');
const data = [ '%j' ];
demo('%o', data);

Prints:

demo "\u001b[38;5;166m+30m\u001b[0m"

Note that the timestamp/delta is not appended to the end of the output as usual.

I know that %j is for pulling in json, but this is in the data object I'm running through the formatter. Is recursive formatting supposed to be happening? And even if it is, why would it pull in the timestamp/delta as if that were one of the arguments I was passing into the debug function?

Lenguaje dominante
JavaScript
Estrellas
11.5k
Forks
992
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de debug-js/debug

Todos los issues de debug-js/debug

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.