profile
viewpoint

Ask questionsconsole log not aligning

wonder if console.log on objects, and any non-string types has any standard?

> var data = {"totalTax":7.45,"summary":[{"jurisName":"Utah","taxCalculated":4.85,"jurisType":"State","taxType":"Sales"},{"jurisName":"Salt Lake","taxCalculated":1.35,"jurisType":"County","taxType":"Sales"},{"jurisName":"Murray","taxCalculated":0.2,"jurisType":"City","taxType":"Sales"},{"jurisName":"Salt Lake Co Tr","taxCalculated":1.05,"jurisType":"Special","taxType":"Sales"}]};

> console.log(data);
{
 totalTax: 7.45,
 summary: [
  { jurisName: "Utah", taxCalculated: 4.85, jurisType: "State", taxType: "Sales" },
  {
    jurisName: "Salt Lake",
    taxCalculated: 1.35,
    jurisType: "County",
    taxType: "Sales"
   },
  { jurisName: "Murray", taxCalculated: 0.2, jurisType: "City", taxType: "Sales" },
  {
    jurisName: "Salt Lake Co Tr",
    taxCalculated: 1.05,
    jurisType: "Special",
    taxType: "Sales"
   }
]        // I believe this line not aligning is a bug, it has no leading space, better align with above `summary`
}
undefined

compare with in node:

> console.log(data)
{ totalTax: 7.45,
  summary:
   [ { jurisName: 'Utah',
       taxCalculated: 4.85,
       jurisType: 'State',
       taxType: 'Sales' },
     { jurisName: 'Salt Lake',
       taxCalculated: 1.35,
       jurisType: 'County',
       taxType: 'Sales' },
     { jurisName: 'Murray',
       taxCalculated: 0.2,
       jurisType: 'City',
       taxType: 'Sales' },
     { jurisName: 'Salt Lake Co Tr',
       taxCalculated: 1.05,
       jurisType: 'Special',
       taxType: 'Sales' } ] }
undefined

also, node's REPL console.log has ansi coloring output for different types on terminals, will this come into Deno anytime soon?

denoland/deno

Answer questions kitsonk

That is why the issue is open @amarkantku.

useful!

Related questions

{WSL 2} Permission denied (os error 13) hot 1
gRPC in Deno? hot 1
deno remove/uninstall subcommand hot 1
Insight required: Resource (TCP) errors hot 1
TCP accept loop doesn't use for-await hot 1
Support d.ts files hot 1
Restore runtime lib generation capability hot 1
disable flaky tests _048_media_types_jsx and _019_media_types hot 1
Typescript Custom Transformers Support hot 1
reorg directory structure hot 1
Centos 7 GLIBC_2.18 not found hot 1
"deno ast script.ts" hot 1
Text decoding performance abysmally slow. hot 1
"deno ast script.ts" hot 1
Can't build master hot 1
Github User Rank List