profile
viewpoint

pull request commentdenoland/deno

Console log indeed aligning (cleaner pull request)

is it possible to match exactly same as in node?

> data
{ totalTax: 7.45,
  summary:
   [ { jurisName: 'Utah',         // please notice current deno-1.0.2 show this object in a single line, but others in multiple lines, but node is always showing all objects under same array in same style
       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' } ] }
Speykious

comment created time in a month

issue commentdenoland/deno

console log not aligning

the not aligning problem is not a dup, and not fixed in deno 1.0.2

I can still reproduce:


{
  totalTax: 7.75,
  summary: [
    { jurisName: "California", taxCalculated: 6, jurisType: "State", taxType: "Sales" },
    {
        jurisName: "Riverside",
        taxCalculated: 0.25,
        jurisType: "County",
        taxType: "Sales"
      },
    {
        jurisName: "Riverside Co Local Tax Sl",
        taxCalculated: 1,
        jurisType: "Special",
        taxType: "Sales"
      },
    {
        jurisName: "Riverside County District Tax Sp",
        taxCalculated: 0.5,
        jurisType: "Special",
        taxType: "Sales"
      }
]           // what I meant is this line, supposed to be aligned with `summary`, should have leading spaces
}

t829702

comment created time in a month

pull request commentdenoland/deno

feat: Deno.args now does not include script

Now, we need another API to get the script name.

so, is this implemented in current Deno 1.0? how can I get the script name?

ry

comment created time in 2 months

issue openeddenoland/deno

console 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 am generally ok with this console log printing, but not this line, no leading space, better align with above `summary`
}

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

created time in 2 months

issue openeddenoland/deno

file_server not handling BrokenPipe

is this worth to fix? and is there another full featured file_server in the community out of std?

easy to reproduce this when serving a large file to browser, and click stop loading

[2020-05-19 12:00:25] "GET /output.json HTTP/1.1" 200
error: Uncaught BrokenPipe: Broken pipe (os error 32)
    at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
    at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
    at async Object.write ($deno$/ops/io.ts:65:18)
    at async BufWriter.flush (https://deno.land/std/io/bufio.ts:475:25)
    at async BufWriter.write (https://deno.land/std/io/bufio.ts:514:9)
    at async Object.copy ($deno$/io.ts:70:21)
    at async writeResponse (https://deno.land/std/http/_io.ts:265:15)
    at async ServerRequest.respond (https://deno.land/std/http/server.ts:97:7)

created time in 2 months

issue openedform-data/form-data

can form-data append a fetch Promise which will resolve to a stream?

I see form-data append has already supported multiple streams, including http, request, axios, so

     var f = new FormData();
    f.append("name", request("http://some-site/path/to/file.jpeg"));

this works, while for some reason, my client code has already depended on node-fetch, when I change to this fetch API, this does not work

    const fetch = require("node-fetch");

     var f = new FormData();
    f.append("name", fetch("http://some-site/path/to/file.jpeg"));

this fetch API returns a Promises which will resolve to a Response, I can chain it to resolve to a stream, but still does not work

    f.append("name", fetch("http://some-site/path/to/file.jpeg")  .then(res => res.body));

got console errors

'ERROR:' TypeError: source.on is not a function
    at Function.DelayedStream.create (/Users/.../tmp/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/Users/.../tmp/node_modules/combined-stream/lib/combined_stream.js:45:37)
    at FormData.append (/Users/.../tmp/node_modules/form-data/lib/form_data.js:74:3)

created time in 3 months

more