profile
viewpoint
Kitson Kelly kitsonk @ThoughtWorksInc Melbourne, Australia http://www.kitsonkelly.com/ Principal Technologist @ThoughtWorksInc, contributing to @denoland and author of @oakserver

issue commentdenoland/deno_std

assertStrContains and assertArrayContains

Is it possible for someone to think they were testing an array, but actually a string gets passed and the test still passes?

No. Both the left and right would have to be strings. Or the left would have to be an array containing strings and the right would be a string which is actually contained in wholly as a value in the left. You would have to a) not be using TypeScript and b) make some really really big logic errors. So why encumber everyone for what is a really odd and unlikely edge case?

kitsonk

comment created time in an hour

issue commentmicrosoft/TypeScript

TypeScript Object Initializer Syntax

Because you don't understand what I mean is why you are asking for something that doesn't make sense in TypeScript.

You example again:

const data = { x: 1, y: 1};

interface Point {
    x: number;
    y: number;
}

const point: Point = { ...data };

TypeScript is a structural typing system. If you wanted a new way to create instances of a class though, you would be best to advocate for this in ECMAScript/JavaScript (https://esdiscuss.org/) and if it got adopted there, TypeScript would follow along. TypeScript is a (mostly) an erasable type system, not the languages syntax.

series0ne

comment created time in 4 hours

issue commentdenoland/deno

consider a `deno new` command to encourage best practices

This in general feels like a higher order concern of people doing derivative things. At the Deno level, I don't think we can hold that much of an opinion because the type of workloads that people would author are so diverse. It might be a single file script, it might be a web server and to "enforce" or even advocate would mean we would get it wrong 90% of the time for the 10% of time we got it right.

Angular and things like React Create App are higher order frameworks that can have opinions about how you structure a web application.

Because as you point out there is no package.json there really isn't anything to scaffold, and even if there is, I would think it is really premature to force that opinion on people when there isn't even a consensus of what a good Deno project looks like at this stage. It is something that needs to bake for a while longer, if it is tackled even at all.

thefliik

comment created time in 4 hours

issue commentmicrosoft/TypeScript

TypeScript Object Initializer Syntax

@Elfayer TypeScript is a structural typing system, because JavaScript is largely structural. You don't need to apply a nominal constructor to some arbitrary data to have it be that type. If it is structurally the same, it is that type in TypeScript, irrespective of how it was created. Don't try to fit a square peg in a round hole. It will lead to 😭 .

series0ne

comment created time in 18 hours

pull request commentdenoland/deno

Apply source maps to non thrown errors.

I am working on an addition to this though which moves the parsed source maps into the module meta data struct, as there is currently a bit of silliness in the op that creates a hash which is discarded on every op to be compatible with the existing API.

kitsonk

comment created time in a day

created tagkitsonk/oak

tagv2.1.0

A middleware framework for Deno's net server

created time in 2 days

created tagkitsonk/oak

tagv2.0.0

A middleware framework for Deno's net server

created time in 2 days

push eventkitsonk/oak

Kitson Kelly

commit sha 407bd1bbca4557f63e8069fe7147af7165906ec4

Update to Deno 0.9.0, including std.

view details

push time in 2 days

created tagoakserver/oak

tagv2.1.0

A middleware framework for Deno's net server

created time in 2 days

push eventoakserver/oak

Kitson Kelly

commit sha 407bd1bbca4557f63e8069fe7147af7165906ec4

Update to Deno 0.9.0, including std.

view details

push time in 2 days

push eventkitsonk/deno

Kitson Kelly

commit sha 3bd6b39afd024e82c77b68a9dec271ae2bc90c24

Apply source maps to non thrown errors.

view details

push time in 3 days

PR opened denoland/deno

Apply source maps to non thrown errors.

Fixes #1717

This PR fixes the issue where errors are caught or created but not thrown and then logged to the console. Currently, the stack trace would show emitted code locations and not the source location in the stack trace. This PR ops into Rust to remap the locations based on the source maps that are part of the module meta data.

This also exposes Deno.applySourceMap() which takes a location and returns the original location, so custom processing of errors and error stacks can be done.

I have an integration test, but wasn't going to finalise the unit tests until I got feedback about the exposure of the Deno.applySourceMap().

+399 -3

0 comment

11 changed files

pr created time in 3 days

push eventkitsonk/deno

Kitson Kelly

commit sha 5d81103be5f6f33707bf401602f5d35213f8eef9

Apply source maps to non thrown errors.

view details

push time in 3 days

push eventkitsonk/deno

迷渡

commit sha 6a5177dc11936687e6da95c3c45e3e41a7856d79

event `isTrusted` is enumerable (#2543)

view details

Ryan Dahl

commit sha f2c50fae844b34cf6d8488ab1fbc599eb935a919

Fix silent failure of WebAssembly.instantiate() (#2548) By making WASM compilation synchronous. We'll have to do more work to make it properly async.

view details

Bartek Iwańczuk

commit sha 77a00aef4cef31e1e76549b3fcef25f389c0ab84

feat: upgrade installer and add docs (#2551)

view details

Matt Harrison

commit sha 20f41e719d2cb5add8e9168d00f239843fd56d31

Fix comment (#2555)

view details

andy finch

commit sha eb93dc58a11d9e9a295eff31f9c2c6a3a4c5170b

add encodeInto to TextEncoder (#2558)

view details

Bartek Iwańczuk

commit sha 642eaf97c67c6070935a2977014c743ba59deff8

feat: redirect process stdio to file (#2554)

view details

Yoshiya Hinosawa

commit sha 201ddd29a7908d457ed43b030476707d32848868

fmt_test: resolve old absolute path issue (#2562)

view details

Yoshiya Hinosawa

commit sha 988bcbb8842d12202f278808698a6b546718e764

fetch: make body async iterable (#2563)

view details

Bartek Iwańczuk

commit sha b9fbd552149c1fe61b662c9b1a1ed1b42e5487ae

feat: log permission access (#2518) Replaces -D/--log-debug flag with --log-level=debug --log-level=info displays permission access

view details

Gurwinder Singh

commit sha 6fa6828e5f0f7abac20ec342ee5ec57654a425d0

Minor tweaks (#2569) 1. Separate Snapshot and Script StartupData functions based on cfg "no-snapshot-init" 2. Replace deprecated Once::ONCE_INIT with Once::new (https://github.com/rust-lang/rust/pull/61757) 3. Elide lifetime 4. Fix typos

view details

JaePil Jung

commit sha d82089ca358b7fa4d5e2b7a357f651364643de7a

Update manual.md (#2571)

view details

Kitson Kelly

commit sha c3ff28e5011315cedc74f9923ae15ed92033739a

Apply source maps to non thrown errors.

view details

push time in 3 days

create barnchkitsonk/deno

branch : remap-unthrown

created branch time in 3 days

issue commentdenoland/deno_std

discuss: disable all "import * as xxx"

Yes, in Deno code. Because of the way we have to build the type library and arrive at a single global type definition, when dealing with importing modules, we have to do so via the namepsaces to avoid some collisions and naming problems in the global namespace.

Aside from the technical challenges internal to Deno, there are some use cases where using a module as a namspace makes more sense, like for common words which might be used as methods. Like:

import * as foo from "foo.ts";
import * as bar from "bar.ts";

console.log(foo.get());
console.log(bar.get());

Is a lot more logical than:

import { get as fooGet } from "foo.ts";
import { get as barGet } from "bar.ts";

console.log(fooGet());
console.log(barGet());
axetroy

comment created time in 3 days

issue commentdenoland/deno

[TypeScript] Add Console Interface

I guess that would be better than someone messing with the global console, as just like messing with built-in global prototypes are a bad idea. Would rather people extend Console and create localised instances of something special.

zekth

comment created time in 5 days

CommitCommentEvent

issue commentdenoland/deno

Support importing wasm modules

For reference, here is the README about the integration. It is a Stage 1 proposal (and the WebAssembly committee follows the TC39 stage process), which means it is still quite early. I think this could be important to Deno, so maybe getting involved early would be a good thing, but is likely to be a bit of a rough road.

This will present interesting challenges for TypeScript and trying to understand the exports of a WASM module, but I suspect this would be an iterative process, where it would be just an untyped import, but eventually could try to figure out a way to evaluate/type on the fly the imports and exports of a WASM Module. It is going to be fairly complex I suspect, with some mediation between V8 and the compiler.

ry

comment created time in 6 days

issue commentdenoland/deno

deno bundle doesn't work with import.meta

Yeah, I am not sure of an easy way around that, because any bundle is not going to be an ESM module. We could "ignore" the TypeScript error when doing the bundle, but then would a bundled version have the right behaviours. Hmmm... 🤔

ry

comment created time in 6 days

PR opened denoland/deno_std

bundle/run handles Deno.args better.

Fixes #513

+4 -4

0 comment

2 changed files

pr created time in 6 days

push eventkitsonk/deno_std

Kitson Kelly

commit sha 25fff7044b2e5860cb8674d1d50ddf830b412a82

bundle/run handles Deno.args better.

view details

push time in 6 days

create barnchkitsonk/deno_std

branch : bundle_args

created branch time in 6 days

issue commentdenoland/deno_std

Bundle runner doesn't handle args well

Because the args are frozen, there is no modifying them, but at least we can at least accept >= 2 arguments.

kitsonk

comment created time in 6 days

issue openeddenoland/deno_std

Bundle runner doesn't handle args well

The bundle loader does not handle Deno.args well, in that it expects exactly two args (the path to the runner and the path to the bundle) and doesn't leave the args in a state where the bundle doesn't realise it was bundled. It should remove the runner from the args.

created time in 6 days

push eventkitsonk/deno_std

Ryan Dahl

commit sha 86b7499e658a70d734e1e02fef50e1d9e26f6f56

upgrade: deno to v0.8.0 (#487)

view details

Kitson Kelly

commit sha fe7f6e117fee724bf8f9b44526de1add7da7dfdd

Add bundle loader (#480)

view details

Sam Reghenzi

commit sha 3ec3a8b4f1eee8b5c6d90db6a30a6ab38afa05c8

fix wrong field name in example code (#490)

view details

Bartek Iwańczuk

commit sha a3015be14195df46486a49e5c791afba4dfe084a

feat: installer (#489)

view details

Ryan Dahl

commit sha 1679ba0b57e27624b3d3fdc303dccbe69a9d798d

installer: Print name of installed file (#492)

view details

Ryan Dahl

commit sha 33bc3db00105e2572a7e3abd6da8591cbc5abae1

ci: bump version to v0.9.0 (#493)

view details

Axetroy

commit sha aa628cb926078375c3164711e49af1bd71825983

fix installer readme (#495)

view details

Axetroy

commit sha 418cdff25d022e8abfd4423f1535173c2e7c2210

add encoding/hex module (#434)

view details

Axetroy

commit sha a68527f3fe0a006a64a2df9c5f380f5a2274a531

Installer: support windows (#499)

view details

Axetroy

commit sha b04fda30c8949b6347094b898bfa427c0b9a6162

lint: add max line length rules (#507)

view details

Vincent LE GOFF

commit sha d44a47a08d53a5a5d94de8aabde6c1682b8e54c6

Testing: Pretty output + Silent mode (#314)

view details

Axetroy

commit sha 4317af11d18e67dbc79b0df9839180f8e4e55613

installer: quote commands correctly (#510)

view details

Bartek Iwańczuk

commit sha b13441fe8af151f60cdc2336c53a7196f56fd5b0

improve installer (#512) - remove uninstall command - add --reload to deno fetch - to ensure subsequent installation upgrades script and deps - fix executable shebang - fix prompt for subsequent installation - support custom installation dir via -d/--dir flag

view details

push time in 6 days

issue commentdenoland/deno

Bundling V2

Ok, I thought it might be that. We should open an issue on the loader in std about dealing with shifting off the first the arg somehow. I don't think it would be an issue for the built in loader because any args would be consumed before they hit the runtime.

kitsonk

comment created time in 6 days

issue commentdenoland/deno

Bundling V2

@hayd I am not sure I understand that issue, can you be more specific.

kitsonk

comment created time in 7 days

issue commentdenoland/deno

Line number printed in the tracing stack is not correct

Ah, I had forgot about this, but I do think #2487 did fix this. What was happening was that we weren't previously remapping the "outer" part of the error, only the stack trace, so the source line, start column and end column were the emitted file, not the original file. Now they are all the original file.

🎉

yuqingc

comment created time in 7 days

issue commentdenoland/deno

Bundling V2

  • Consider tree shaking/dead code elimination while bundling. This is rather a large thing though, so maybe v3? It requires some complex analysis of the code and most of the bundlers that do tree shaking or dead code elimination utilise some form of an ES tree AST instead of a TypeScript AST. That would mean embedding another parser into Deno just to do the analysis, which just seems not very logical. Even then, tree-shaking is complex and error prone (like thinking something doesn't have side effects but does).
kitsonk

comment created time in 7 days

issue commentdenoland/deno_std

discuss: disable all "import * as xxx"

deno bundle does not do tree shaking... an import is an import is an import as far as that is concerned. We can put tree shaking on the roadmap for deno bundle, but it is quite complex logic and most. I have put some thinking into it and one of the biggest challenges is that all the tree-shakers I am aware of utilise an ESTree type AST format to identify the dependencies. That would be a reparse of all the code before the emit, where what we would really want to do is analysis on a TypeScript style AST tree and shake that out. Anyways, is it a big subject that isn't really related to namespace imports.

There is some code in main Deno where we have to use namespace imports to be able to generate the type definitions for Deno properly. There are certainly legitimate use cases for namespace imports. So I am with Ry on taking it on a case by case basis.

axetroy

comment created time in 7 days

issue commentdenoland/deno

Formatting issues when tsconfig file has unsupported compiler options

There are a few issues when we exit compiling and start outputting something else we need to clean up. Not only this.

KluVerKamp

comment created time in 7 days

issue commentdenoland/deno

deno crashes when --config value isn't a correct tsconfig file path

Yeah, we can handle that "crash" better and surface something more meaningful, but exiting after displaying an error is the right behaviour IMO.

KluVerKamp

comment created time in 7 days

push eventkitsonk/deno

Kitson Kelly

commit sha 425df50484f315dcd63b4d93ab6911702779899e

Combine CLI Errors (#2487)

view details

push time in 7 days

push eventkitsonk/deno

Kitson Kelly

commit sha 830776c5ab1320c7e878b8b20343445736d79613

Fix issue with renaming.

view details

push time in 7 days

push eventkitsonk/deno

Jed Fox

commit sha 43f48386d7921612c5cbe7d39a4dfb82a3f3367e

website: use css variables and prefers-color-scheme (#2547) This uses `prefers-color-scheme: dark` to automatically switch to dark mode if the user specifies it in their system settings. Dark mode is supported in Firefox 67, Chrome 76, Safari 12.1, and iOS 13 as of this commit, but the current status can be checked here: https://caniuse.com/#feat=prefers-color-scheme Additionally, this uses CSS Variables to implement the color-switching mechanism. This isn’t supported in IE, but the site degrades reasonably well with them disabled. Support table: https://caniuse.com/#feat=css-variables

view details

push time in 7 days

push eventkitsonk/deno

Kitson Kelly

commit sha 010d71ce98322197d3da1645887d47a1c90a893c

Forgot to save before commit.

view details

push time in 7 days

pull request commentdenoland/deno

Combine CLI Errors.

@ry feedback addressed (and I forgot to test the source line remapping in source map, though it was being covered by the integrations tests).

kitsonk

comment created time in 7 days

push eventkitsonk/deno

Kitson Kelly

commit sha 92a10c9ae79d332a50675d38804e9a0a2989e3ae

Fix comments and run format.

view details

push time in 7 days

push eventkitsonk/deno

Kitson Kelly

commit sha f326cc0b9b5c5638eb657b395cac09b6ae408fe0

Address feedback.

view details

Kitson Kelly

commit sha 9c66615dd33a157b79cd440da00a6a4fff632494

Add test for source line on apply source map.

view details

push time in 7 days

Pull request review commentdenoland/deno

event `isTrusted` is enumerable

 export class EventTarget implements domTypes.EventTarget {       );     } -    event.isTrusted = false;

Well isn't it undefined though? Where does it get set to false?

justjavac

comment created time in 7 days

Pull request review commentdenoland/deno

Combine CLI Errors.

 impl DenoError {         }       }       Repr::ImportMapErr(ref _err) => ErrorKind::ImportMapError,+      Repr::Diagnostic(ref _err) => ErrorKind::Diagnostic,+      Repr::JSError(ref _err) => ErrorKind::JSError,     }   }++  pub fn apply_source_map<G: SourceMapGetter>(self, getter: &G) -> Self {+    if let Repr::JSError(js_error) = self.repr {+      return DenoError {+        repr: Repr::JSError(apply_source_map(&js_error, getter)),+      };+    }

👍 makes sense, is someone is doing it to a non JS error, they shouldn't.

kitsonk

comment created time in 7 days

Pull request review commentdenoland/deno

Combine CLI Errors.

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+//! This mod provides DenoError to unify errors across Deno.+use crate::ansi;+use deno::JSError;+use deno::StackFrame;+use std::fmt;++// A trait which specifies parts of a diagnostic like item needs to be able to+// generate to conform its display to other diagnostic like items

👍

kitsonk

comment created time in 7 days

Pull request review commentdenoland/deno

Combine CLI Errors.

 // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.

:+1: yeah, I think it was getting unwieldy to have everything in a single module.

kitsonk

comment created time in 7 days

Pull request review commentdenoland/deno

event `isTrusted` is enumerable

 export class EventInit implements domTypes.EventInit { }  export class Event implements domTypes.Event {+  isTrusted!: boolean;

I would suggest a comment, because unless someone introspects the constructor, they likely won't understand this.

justjavac

comment created time in 8 days

Pull request review commentdenoland/deno

event `isTrusted` is enumerable

 export class EventTarget implements domTypes.EventTarget {       );     } -    event.isTrusted = false;

Hmmm... how does the value get initialised then? Is it supposed to be undefined initially, or false?

justjavac

comment created time in 8 days

push eventkitsonk/deno

迷渡

commit sha 5871d22d9b1f99a4735ff7b4e2dcca977795aa74

check `URLSearchParams.constructor`'s params (#2488)

view details

Neil Richter

commit sha 163d60bf16b2c62192b5bf1763ebe6ee2b8c4406

typo (#2489)

view details

Yoshiya Hinosawa

commit sha 88b0c8756eef96c8adaff1005d00aae52bd2272c

website: use pre-wrap (#2486)

view details

Ryan Dahl

commit sha e0436975211202afadb1a8ccd7d5154694162f38

Expose dynamic import in core (#2472)

view details

Ryan Dahl

commit sha 523ab6a929dacf4cdd692c1319173a1a49c642de

Upgrade V8 to 7.7.37 (#2492)

view details

迷渡

commit sha 0efb7c2ab7b9705a9f5f177b4dc170c1abbd97ed

fix bug in URL (#2495)

view details

justjavac

commit sha cb581620522febe618cbf084b0dc3428479e84a9

set setTimeout callback's this to window object

view details

Matt Harrison

commit sha d82c1991cf0919c312b87501bc588cf17781b32f

Add --seed for setting RNG seed (#2483)

view details

Ryan Dahl

commit sha 508e9849ffd1491b8f3ac9aaaad507e84f57fed3

Move TestFmt to end of tests (#2491)

view details

Ryan Dahl

commit sha de8c85f8f2f4631cc4e7cba2616df94fd2c37160

Move Modules to ThreadSafeState (#2498)

view details

Ryan Dahl

commit sha 912e4f717785e2f5266d749c54a289227523db12

feat: default output filename for deno bundle (#2484) And improve bundle docs

view details

Gurwinder S

commit sha 7fc3d5ed8bef7373b96e4436dee8c68bec383184

Removed unused method and update docs (#2499)

view details

Bert Belder

commit sha 878d092df9cc89ad92e571e2422ffb1ed488dd0e

Revert "Work around Windows-only V8 concurrent initialization crash" This fix is no longer necessary as the underlying V8 bug has been fixed upstream. This reverts commit 48bcfce09e11901244447617be2eb7789427eab0.

view details

Kurt Mackey

commit sha 7bdeee8997bde0efe40bcec41c0706bdab58893b

makes global request type an interface (#2503)

view details

Ryan Dahl

commit sha 8693d0e0a7d7ce1e4533aef30c1a735276e3009b

Split up tools/sync_third_party This is just encoding my actual workflow; not suggesting that this workflow is ideal. Previously I would edit sync_third_party.py each time I ran it.

view details

Ryan Dahl

commit sha 2a5138a5166f0945d5fda68c89fa8e23c66fb681

Remove Config struct from core (#2502) It's unnecessary indirection and is preventing the ability to easily pass isolate references into the dispatch and dyn_import closures. Note: this changes how StartupData::Script is executed. It's no longer done during Isolate::new() but rather lazily on first poll or execution.

view details

Bartek Iwańczuk

commit sha b3c4307d02d627287cd28486b208b53c3bd378f0

Refactor module resolving (#2493) Adds ModuleSpecifier, which wraps a URL. This is now passed around instead of specifier and resolver strings.

view details

Bartek Iwańczuk

commit sha bca5cc5041172e22ad1851c8510d6521bf70ec22

Move ModuleSpecifier to //core (#2509)

view details

迷渡

commit sha 42d1024cd98811a4ce9eaaa73c84970d271628a6

forbidden to set `this` for setTimeout (#2511)

view details

Bartek Iwańczuk

commit sha fdd2eb538327ee3f50fe2869320411191830c985

expose window.Response (#2515)

view details

push time in 8 days

push eventkitsonk/deno

迷渡

commit sha d5e80ad67744bbd2646af0a0abe27cc38205f990

fix clearTimeout.name / clearInterval.name (#2540)

view details

Kitson Kelly

commit sha ed390a51cac08ec238b45c793a5ddd65fcae1b78

Add dyn to be rust nightly compatible (#2538)

view details

Bartek Iwańczuk

commit sha 01858f115ae4c051a0beb5c1719c59431562f43e

fix: use Loader::resolve in op_fetch_module_meta_data (#2519)

view details

Kitson Kelly

commit sha 885b2886e1f9c7ff17e16d0129cc5132388f0472

Combine CLI Errors.

view details

Kitson Kelly

commit sha a280ef0269870069abaa48aa375efe7e32b36a2a

Mergify cli/js_errors into DenoError.

view details

Kitson Kelly

commit sha 663218d1b5264417856c3240672f3ca437824453

Align formatting of errors.

view details

Kitson Kelly

commit sha fb90faeeb522a2eab493d8598df7d0eecf972c7b

Add tests and general cleanup.

view details

Kitson Kelly

commit sha dea666c4126fe3d960e74e298ff31fc47e1a81b2

Fix new tests from rebase.

view details

push time in 8 days

push eventkitsonk/deno

Kitson Kelly

commit sha 7500a50ce28caaa33d0450f5cb64615b67840af4

Add tests and general cleanup.

view details

push time in 8 days

push eventkitsonk/deno

Kitson Kelly

commit sha e2bea3fa4842494deeb555fe94b6fbcd1ead0fef

Add tests and general cleanup.

view details

push time in 9 days

pull request commentdenoland/deno

Combine CLI Errors.

Ok, I think this is ready for a final review @ry.

I didn't tackle the other error kinds display, as these are intrinsically Rust errors and are generally handled differently (usually via a panic!()) which gives more Rust context by default.

Also, I didn't handle bubbling up the worker JavaScript errors. I suspect it would be more straightforward to do that in a seperate PR now that there is a unified error infrastructure.

kitsonk

comment created time in 9 days

push eventkitsonk/deno

迷渡

commit sha a95319074240a869dce088fa580e46a067a8e7d1

fix urlSearchParams custom symbol iterator (#2537)

view details

迷渡

commit sha 9ad5b0653e3821915d7ab7438d5ed4fe373c569a

clearTimeout should convert to number (#2539)

view details

andy finch

commit sha 76d51b0f9a4bd0ff86150d0dfa78df7c8410b7ea

refactor dispatch take 2 (#2533)

view details

Kitson Kelly

commit sha 2506e00fd15f214413027ebce6a72e500eadd4c7

Add dyn to areas of core.

view details

Kitson Kelly

commit sha 2510d8f3b696c8f8dd68544abc3143e8f14c2dd7

Combine CLI Errors.

view details

Kitson Kelly

commit sha db89ed66f0be502de474773f93a6154c89fb76f9

Mergify cli/js_errors into DenoError.

view details

Kitson Kelly

commit sha 4c623bfd36347dbc3598acf43c6d7cb410969470

Align formatting of errors.

view details

Kitson Kelly

commit sha 4afaef9540cf2504d1200600c8634b062be27d5e

Add tests and general cleanup.

view details

push time in 9 days

pull request commentdenoland/deno

[WIP] Combine CLI Errors.

For reference, Rust also uses cyan when underlining "help":

errors_rs_—_deno

kitsonk

comment created time in 9 days

pull request commentdenoland/deno

Add dyn to areas of core.

@95th What is wrong with clone? It works in both. Probably best not to leak the reference anyways. The lifetime of line is suspect IMO.

kitsonk

comment created time in 9 days

Pull request review commentdenoland/deno

Add dyn to areas of core.

 impl Repl {       .editor       .readline(&prompt)       .map(|line| {-        self.editor.add_history_entry(line.as_ref());+        self.editor.add_history_entry(line.clone());

I changed it to &line in the other branch and you pushed a commit to line.clone().

kitsonk

comment created time in 9 days

pull request commentdenoland/deno

Add dyn to areas of core.

In my other branch @ry suggested:

self.editor.add_history_entry(line.clone());

which is now reflected in this PR and rebased on master.

kitsonk

comment created time in 9 days

push eventkitsonk/deno

迷渡

commit sha a95319074240a869dce088fa580e46a067a8e7d1

fix urlSearchParams custom symbol iterator (#2537)

view details

迷渡

commit sha 9ad5b0653e3821915d7ab7438d5ed4fe373c569a

clearTimeout should convert to number (#2539)

view details

andy finch

commit sha 76d51b0f9a4bd0ff86150d0dfa78df7c8410b7ea

refactor dispatch take 2 (#2533)

view details

Kitson Kelly

commit sha de54024f56e1075ada5fc9fa62acb863c959d087

Add dyn to areas of core.

view details

Kitson Kelly

commit sha c49f9131044467e3a6d246ac20b5234bc79ab140

Fix issues with rustc nightly.

view details

push time in 9 days

pull request commentdenoland/deno

fix function name

LGTM

justjavac

comment created time in 9 days

issue commentdenoland/deno

support chome devtools

I still don't think it is a better design.

ry

comment created time in 9 days

issue commentdenoland/deno

console.log not show private members of javascript

Rust debug display log them but with no indication of their visibility:

#[derive(Debug)]
pub struct Foo {
    foo: i64,
    pub bar: i64,
}

pub fn main() {
  let foo = Foo { foo: 8, bar: 8 };

  println!("{:?}", foo);
}

Outputs:

Foo { foo: 8, bar: 8 }
Fenzland

comment created time in 9 days

pull request commentdenoland/deno

[WIP] Combine CLI Errors.

That follow the TypeScript model, squiggly red for an error, and squiggly teal/cyan for non-errors, where it is indicating a reference of where something is defined.

I should be able to finish off the tests today and get it into a green state.

kitsonk

comment created time in 9 days

issue commentdenoland/deno

support chome devtools

There is a lot of code that expects console.log() to write to stdout. Changing that behaviour would surprise a lot of people. I would be 👎 for changing that.

ry

comment created time in 10 days

pull request commentdenoland/deno

[WIP] Combine CLI Errors.

Ok, I have taken some artistic license with the errors to try to unify them, as neither TypeScript nor a coloured version of JSError work very well universally.

The biggest change is I took a hint from Rust errors which look something like this:

error[E0053]: method `format_related_info` has an incompatible type for trait
   --> ../../cli/fmt_errors.rs:122:26

Where TypeScript pretty errors led with the file location of the error, that really breaks up being to read them because on average, we output very long file identifiers that identify local and remote resources.

A TypeScript error looks like this (but in colour):

error TS2322: Type '(o: T) => { v: any; f: (x: B) => string; }[]' is not assignable to type '(r: B) => Value<B>[]'.
  Types of parameters 'o' and 'r' are incompatible.
    Type 'B' is not assignable to type 'T'.
      'B' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.

► file:///Users/kkelly/github/deno/tests/error_003_typescript.ts:20:3

20   values: o => [
     ~~~~~~

  The expected type comes from property 'values' which is declared here on type 'C<B>'

    ► file:///Users/kkelly/github/deno/tests/error_003_typescript.ts:8:3

    8   values?: (r: T) => Array<Value<T>>;
        ~~~~~~


error TS2339: Property 't' does not exist on type 'T'.

► file:///Users/kkelly/github/deno/tests/error_003_typescript.ts:22:12

22       v: o.t,
              ^


Found 2 errors.

And a JavaScript error looks like this:

error: Uncaught Error: exception from mod1
► file:///Users/kkelly/github/deno/tests/subdir/mod1.ts:16:9

16   throw Error("exception from mod1");
           ^

    at throwsError (file:///Users/kkelly/github/deno/tests/subdir/mod1.ts:16:9)
    at foo (file:///Users/kkelly/github/deno/tests/error_002.ts:4:3)
    at file:///Users/kkelly/github/deno/tests/error_002.ts:7:1

Also, I have remapped the top line, start_column, end_column and line contents from JSErrors, so you get authored code instead of transpiled code.

kitsonk

comment created time in 10 days

push eventkitsonk/deno

Ryan Dahl

commit sha 8693d0e0a7d7ce1e4533aef30c1a735276e3009b

Split up tools/sync_third_party This is just encoding my actual workflow; not suggesting that this workflow is ideal. Previously I would edit sync_third_party.py each time I ran it.

view details

Ryan Dahl

commit sha 2a5138a5166f0945d5fda68c89fa8e23c66fb681

Remove Config struct from core (#2502) It's unnecessary indirection and is preventing the ability to easily pass isolate references into the dispatch and dyn_import closures. Note: this changes how StartupData::Script is executed. It's no longer done during Isolate::new() but rather lazily on first poll or execution.

view details

Bartek Iwańczuk

commit sha b3c4307d02d627287cd28486b208b53c3bd378f0

Refactor module resolving (#2493) Adds ModuleSpecifier, which wraps a URL. This is now passed around instead of specifier and resolver strings.

view details

Bartek Iwańczuk

commit sha bca5cc5041172e22ad1851c8510d6521bf70ec22

Move ModuleSpecifier to //core (#2509)

view details

迷渡

commit sha 42d1024cd98811a4ce9eaaa73c84970d271628a6

forbidden to set `this` for setTimeout (#2511)

view details

Bartek Iwańczuk

commit sha fdd2eb538327ee3f50fe2869320411191830c985

expose window.Response (#2515)

view details

andy finch

commit sha dc60fe9f300043f191286ef804a365e16e455f87

Refactor dispatch handling (#2452) Promise id is now created in core and passed back to JS.

view details

迷渡

commit sha 52448f351d7b0882ac67e2974b93c1e730f5dbb3

feat: URLSearchParams should work with custom iterator (#2512)

view details

Bartek Iwańczuk

commit sha 3dff147d0ca1a2cd8d264d20a178d71cb38b1c4e

feat: add deno install command (#2522)

view details

Ryan Dahl

commit sha 1361e302234b17ab8079107b134dfd0ddf288439

Revert "Refactor dispatch handling (#2452)" Due to performance regression: https://github.com/denoland/deno/commit/dc60fe9f300043f191286ef804a365e16e455f87#commitcomment-33943711 This reverts commit dc60fe9f300043f191286ef804a365e16e455f87.

view details

Bert Belder

commit sha 77737707e4e07d7421d9a4f813d6dcd27ecf54fe

third_party: upgrade rust crates

view details

Bartek Iwańczuk

commit sha 061f6dd4832320ff654ee2a7a07901852b702639

fix deno install (#2529)

view details

Ryan Dahl

commit sha 9142a7df46fd1335c9ee007edcc4e83eb589a794

Upgrade INSTALLER_URL to include fixes (#2532) denoland/deno_std#492

view details

Ryan Dahl

commit sha 7b06aa37342c021f9f1fac99125847d134e67001

v0.9.0

view details

David Stone

commit sha 76329cf610af1612d4e9c562a1ee3a4dd6082a37

Fixes benchmark page spinner on Edge #2508 (#2525)

view details

Kitson Kelly

commit sha bb5ff86baed5171bb7f2c5f1a657c917d2c8574a

Add dyn to areas of core.

view details

Kitson Kelly

commit sha 21e5aa8a87e7bde9e086b9b86701615219091ed1

Combine CLI Errors.

view details

Kitson Kelly

commit sha dd1f89c693e28165a8d7dc8837ff60add66f91c8

Mergify cli/js_errors into DenoError.

view details

Kitson Kelly

commit sha c7ee43d868035b9ff0bbf0e4e7991647135854a7

Align formatting of errors.

view details

push time in 10 days

PR opened denoland/deno

Add dyn to areas of core.

Nightly Rust complains with the following:

error: trait objects without an explicit `dyn` are deprecated
  --> ../../core/isolate.rs:71:19
   |
71 | type DispatchFn = Fn(&[u8], Option<PinnedBuf>) -> Op;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn(&[u8], Option<PinnedBuf>) -> Op`
   |
   = note: `-D bare-trait-objects` implied by `-D warnings`

error: trait objects without an explicit `dyn` are deprecated
  --> ../../core/isolate.rs:74:20
   |
74 | type DynImportFn = Fn(&str, &str) -> DynImportFuture;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn(&str, &str) -> DynImportFuture`

error: trait objects without an explicit `dyn` are deprecated
   --> ../../core/modules.rs:598:32
    |
598 |     fn cause(&self) -> Option<&Error> {
    |                                ^^^^^ help: use `dyn`: `dyn Error`

error: aborting due to 3 previous errors

This patch fixes it and should be supported by earlier versions of Rust. (I had to update to a recent version of nightly because master has something that is triggering a bug in RLS, updating to a more recent version of nightly fixed that).

+3 -3

0 comment

2 changed files

pr created time in 10 days

create barnchkitsonk/deno

branch : dyn_fix

created branch time in 10 days

issue commentdenoland/deno

Support dynamic import

This has not been delivered yet. That is why the issue is still open. It is still being worked on.

hayd

comment created time in 10 days

issue commentdenoland/deno

deno fmt is slow

Actually I already did in #1533. Doh! I think we should still do that.

ry

comment created time in 11 days

issue commentdenoland/deno

deno fmt is slow

No, actually that is an interesting point, something we should consider when fetching remote modules, supporting both gzip and brotli for module transfer. Most of the servers support it and it would speed up fetching remote modules. I will open another issue for it.

ry

comment created time in 11 days

pull request commentdenoland/deno

feat: log permission access

Previous art:

  • Rust is an environment variable RUST_LOG so you get RUST_LOG=info
  • Python is --log so --log=INFO
  • npm uses --loglevel so you get --loglevel verbose but also has individual flags to control things as well.

There were a few other examples, but the best thing is that they are totally inconsistent. Some have just simple flags, some only have environment variables. 🤷‍♂ It does seem like DENO_LOG could/should be respected though.

bartlomieju

comment created time in 11 days

issue commentdenoland/deno

hope: XMLHttpRequest in deno

I really think XMLHttpRequest is a big ole can of worms. It is a really old API with a load of crap to try to make it compatible with the browsers. IMO we really have to draw the line of "browser compatibility" somewhere.

The best thing is that is someone desired, to use the built in Deno bindings to create a polyfill in std and bring it into core if it actually worked well.

runnerSnail

comment created time in 12 days

issue commentdenoland/deno

console.log not show private members of javascript

The output with the TypeScript private is irrelevant because it isn't a runtime thing, private is a TypeScript only construct at that point.

There appears to be inconstancy between Chrome and Node.js on this.

Chrome 74:

class Foo
{
	#foo= 8;
}

console.log( new Foo, );
VM39:6 Foo {#foo: 8}
undefined

Node.js 12.4:

> class Foo
... {
... 	#foo= 8;
... }
undefined
> 
> console.log( new Foo, );
Foo {}
undefined

I would have expected private members to not be logged actually, since they would be like non-enumerable properties too. But clearly there is inconsistency.

Fenzland

comment created time in 12 days

pull request commentdenoland/deno

feat: log permission access

Or how about we introduce --log-level=debug or something that means we are not proliferating a load of flags.

bartlomieju

comment created time in 12 days

issue commentdenoland/deno

Default to always printing log message when permissions are accessed

Personal opinion, I would rather see something other than ⚠️ for permission access. It is far more informational. It is something that you have said is ok to do, but you want to keep an eye on it. Maybe or 🦕 is better for this class of information.

Also, instead of dealing with --no-prompt, I wonder if it would be better to introduce an internal logging level, and put things like logging of permission access as information. Things like privilege escalation as warnings, etc...

ry

comment created time in 13 days

issue commentdenoland/deno

expose Request, Response globally

My advice, don't comment it out. 😄

JamesKyburz

comment created time in 13 days

Pull request review commentdenoland/deno

forbidden to set `this` for setTimeout

 export function setTimeout(   delay: number,   ...args: Args ): number {+  // @ts-ignore

Defining this in the arguments would remove this error. Under strict mode, where this cannot be inferred, you have to be explicit. It isn't an error to ignore.

function setTimer(
	this: unknown,
    cb: (...args: Args) => void,
	delay: number,
	...args: unknown[]
): number {
	checkThis(this);
	// ...
}
justjavac

comment created time in 13 days

Pull request review commentdenoland/deno

forbidden to set `this` for setTimeout

 function fireTimers(): void {  export type Args = unknown[]; +// @internal

If you don't export it, or it isn't part of any surface of anything else exported it shouldn't leak into the .d.ts file.

justjavac

comment created time in 14 days

Pull request review commentdenoland/deno

forbidden to set `this` for setTimeout

 function fireTimers(): void {  export type Args = unknown[]; +// @internal+function checkThis<T>(thisArg: T): void {

This is a useless generic... unknown would be a better type here.

justjavac

comment created time in 14 days

Pull request review commentdenoland/deno

forbidden to set `this` for setTimeout

 export function setTimeout(   delay: number,   ...args: Args ): number {+  // @ts-ignore

What error are you ignoring and why?

justjavac

comment created time in 14 days

issue commentmicrosoft/TypeScript

Separate directories for map files

Why did you ignore the issue template?

TypeScript design non-goal:

  1. Provide an end-to-end build pipeline. Instead, make the system extensible so that external tools can use the compiler for more complex build workflows.
basickarl

comment created time in 14 days

issue commentmicrosoft/TypeScript

Feature: Analyze @throws tags

A potential compromise is for JS, that @throws is evaluated as a function that returns never of which, there is a level of checking built in to ensure that such a function doesn't return a value.

luisfarzati

comment created time in 14 days

issue commentdenoland/deno

Cannot resolve module without extension defined

So is there is there are any plans to harmonize Deno and "common import" to avoid workarounds?

What do you mean by "common import". Most browsers require ES modules to include their extension. Node.js has also gone down that path for their support for ES modules.

Also see #2329. We tried it, it made things a lot more complicated, and so we removed it. It is very intentional at the moment to keep it out.

Drag13

comment created time in 15 days

issue commentdenoland/deno

Is there any JavaScript engine written in rust?

I am not sure what a Rust just in time compiler has anything to do with a JavaScript engine.

catastrop

comment created time in 15 days

push eventkitsonk/deno

Kitson Kelly

commit sha 9a7e2199eb2fe26b471eaab48a1820587e030b72

Mergify cli/js_errors into DenoError.

view details

push time in 15 days

issue commentdenoland/deno

Is there any JavaScript engine written in rust?

@catastrop is that a question or a statement?

It was somewhat discussed in #237. Deno is tied to V8 and that is not going to change. V8 is highly optimised and proven in real world workloads. Something that would be really difficult to replicate in another engine. The language the engine is written in is largely immaterial in reality. Servo is interesting, but someone making a secure TypeScript runtime with Servo isn't this project, it is some other project.

catastrop

comment created time in 15 days

push eventkitsonk/deno

迷渡

commit sha 5871d22d9b1f99a4735ff7b4e2dcca977795aa74

check `URLSearchParams.constructor`'s params (#2488)

view details

Neil Richter

commit sha 163d60bf16b2c62192b5bf1763ebe6ee2b8c4406

typo (#2489)

view details

Yoshiya Hinosawa

commit sha 88b0c8756eef96c8adaff1005d00aae52bd2272c

website: use pre-wrap (#2486)

view details

Ryan Dahl

commit sha e0436975211202afadb1a8ccd7d5154694162f38

Expose dynamic import in core (#2472)

view details

Ryan Dahl

commit sha 523ab6a929dacf4cdd692c1319173a1a49c642de

Upgrade V8 to 7.7.37 (#2492)

view details

迷渡

commit sha 0efb7c2ab7b9705a9f5f177b4dc170c1abbd97ed

fix bug in URL (#2495)

view details

justjavac

commit sha cb581620522febe618cbf084b0dc3428479e84a9

set setTimeout callback's this to window object

view details

Matt Harrison

commit sha d82c1991cf0919c312b87501bc588cf17781b32f

Add --seed for setting RNG seed (#2483)

view details

Ryan Dahl

commit sha 508e9849ffd1491b8f3ac9aaaad507e84f57fed3

Move TestFmt to end of tests (#2491)

view details

Ryan Dahl

commit sha de8c85f8f2f4631cc4e7cba2616df94fd2c37160

Move Modules to ThreadSafeState (#2498)

view details

Ryan Dahl

commit sha 912e4f717785e2f5266d749c54a289227523db12

feat: default output filename for deno bundle (#2484) And improve bundle docs

view details

Gurwinder S

commit sha 7fc3d5ed8bef7373b96e4436dee8c68bec383184

Removed unused method and update docs (#2499)

view details

Bert Belder

commit sha 878d092df9cc89ad92e571e2422ffb1ed488dd0e

Revert "Work around Windows-only V8 concurrent initialization crash" This fix is no longer necessary as the underlying V8 bug has been fixed upstream. This reverts commit 48bcfce09e11901244447617be2eb7789427eab0.

view details

Kurt Mackey

commit sha 7bdeee8997bde0efe40bcec41c0706bdab58893b

makes global request type an interface (#2503)

view details

Kitson Kelly

commit sha 09569f65cafc37982ad87c9a1aa555c2dcf63f6b

Combine CLI Errors.

view details

Kitson Kelly

commit sha aeb5d2a81c4ad5e14da15b1c4310c20ce0ab2f2e

Mergify cli/js_errors into DenoError.

view details

push time in 15 days

issue commentdenoland/deno

Is there any JavaScript engine written in rust?

Why ask that question here? That has nothing to do with Deno. Please keep conversation on topic and related to issues with Deno.

catastrop

comment created time in 15 days

issue commentdenoland/deno

deno fmt is slow

@catastrop not very constructive feedback to be honest. Building a JavaScript/TypeScript formatter from scratch in Rust is a lot of work (with little value?). Unless you are aware of one that exists, than the suggestion isn't very practical.

ry

comment created time in 15 days

issue commentdenoland/deno

support --allow-net=:4500

We should be cautious about expanding something that is explicit already, it erodes the security module. --allow-net=0.0.0.0 binding also to 127.0.0.1 is sort of magical and surprising. I think something that is ambiguous like --allow-net=:4500 or --allow-net=:8000 allowing binding to all the suggested address is fine, but something explicit should stay explicit.

ry

comment created time in 15 days

issue closedrollup/rollup

Support excluding sourceContent from source maps

<!-- ⚡️ katchow! We 💛 issues.

Please - do not - remove this template. Please - do not - skip or remove parts of this template. Or your issue may be closed.

👉🏽 Need help or tech support? Please don't open an issue! Head to https://gitter.im/rollup/rollup or https://stackoverflow.com/questions/tagged/rollupjs

❤️ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate -->

Feature Use Case

When using bundle source maps where the main use case is just to remap error stacks, the sourcesContent can be unnecessary data which increases the source map size and can decrease the performance of the consuming application for significantly large bundles.

Both magic-string and the source-map specification treat sourcesContent as optional, but Rollup currently always includes sources.

See: denoland/deno#1087 for a specific real world use case.

Feature Proposal

Provide a flag to exclude sources from the source map.

closed time in 15 days

kitsonk

issue commentrollup/rollup

Support excluding sourceContent from source maps

This was closed in 84c2fa084ee4d138aa541c3dc7657bf8f5eb98f9

kitsonk

comment created time in 15 days

issue openeddenoland/deno

Use `deno bundle` to generate main bundle

In #2490 it was discussed that depending on code in deno_std as part of Deno is "problematic" because we can't easily get rollup to support extensioned TypeScript. With the deno bundle feature landing, we could in theory for most/all of our internal code bundles use Deno itself to generate its own bundles.

There are a couple considerations:

  • [ ] currently bundle source maps aren't parsed out and made available inside Deno. This is talked about in #2475, but we don't have this yet. We would want that to see where in the bundle internal code "broke" or participated in a stack trace.
  • [ ] we would have to embed a bundle loader into the bundle/snapshot.

created time in 16 days

issue commentdenoland/deno

deno fmt is slow

I wonder if we can use "deno bundle" for the main bundle now?

Not sure. We would need to embed the loader in there, and we don't have source map support yet, so errors thrown in the bundle would be obscure. The main bundle would be easier than the compiler, with having to include TypeScript. It is worth trying to get to a point where we would be happy. Having even part of our bundles be build with Deno itself would be a good thing.

ry

comment created time in 16 days

Pull request review commentdenoland/deno

[WIP] Combine CLI Errors.

 pub fn no_buffer_specified() -> DenoError {   new(ErrorKind::InvalidInput, String::from("no buffer specified")) } -#[derive(Debug)]-pub enum RustOrJsError {-  Rust(DenoError),-  Js(JSError),-}--impl From<DenoError> for RustOrJsError {-  fn from(e: DenoError) -> Self {-    RustOrJsError::Rust(e)-  }-}--impl From<JSError> for RustOrJsError {-  fn from(e: JSError) -> Self {-    RustOrJsError::Js(e)-  }-}--impl fmt::Display for RustOrJsError {-  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {-    match self {-      RustOrJsError::Rust(e) => e.fmt(f),-      RustOrJsError::Js(e) => JSErrorColor(e).fmt(f),-    }-  }-}--// TODO(ry) This is ugly. They are essentially the same type.-impl From<deno::JSErrorOr<DenoError>> for RustOrJsError {-  fn from(e: deno::JSErrorOr<DenoError>) -> Self {-    match e {-      deno::JSErrorOr::JSError(err) => RustOrJsError::Js(err),-      deno::JSErrorOr::Other(err) => RustOrJsError::Rust(err),-    }+pub fn err_check(r: Result<(), DenoError>) {

Good point. 👍

kitsonk

comment created time in 16 days

issue commentdenoland/deno

deno fmt is slow

I looked into adding wrapping before, in addition to the TypeScript formatter, and it gets a bit ugly, and essentially you need to do an AST parse to make sure you are wrapping properly. It is non-trivial. I am not aware of something that effectively does that without a full AST parse.

ry

comment created time in 16 days

push eventkitsonk/deno

Kitson Kelly

commit sha 3b3deb8db7ea027a5c8437c370a0a42cee081541

Combine CLI Errors.

view details

push time in 17 days

PR opened denoland/deno

[WIP] Combine CLI Errors.

Resolves #2474

Outside of core::JSError, all other Deno errors are now combined to be just DenoError.

I need to do further work on this PR, but wanted to get it visible to get any early feedback. Things I still need to do:

  • [ ] cli/errors.rs has no tests at all, add tests
  • [ ] Align the display of JSError (JSErrorColor) to be more like TypeScript diagnostics
  • [ ] Align the display of the other Deno errors to be more like TypeScript diagnostics
  • [ ] Bubble up non-diagnostic errors in the compiler worker
+91 -91

0 comment

7 changed files

pr created time in 17 days

create barnchkitsonk/deno

branch : deno_error

created branch time in 17 days

Pull request review commentdenoland/deno_std

upgrade: deno to v0.8.0

 export class Untar {       (key): void => {         const arr = trim(header[key]);         if (arr.byteLength > 0) {-          meta[key as keyof UntarOptions] = parseInt(decoder.decode(arr), 8);

It is bit verbose, but it works... Once TypeScript "knows" you are only using certain keys, it allows the assignment. Currently, IIRC, there is no way for TypeScript to interpret it as a literal array for type checking, so therefore the explicit cast:

diff --git a/archive/tar.ts b/archive/tar.ts
index c72abc6..5698ae6 100644
--- a/archive/tar.ts
+++ b/archive/tar.ts
@@ -453,19 +453,24 @@ export class Untar {
     if (fileNamePrefix.byteLength > 0) {
       meta.fileName = decoder.decode(fileNamePrefix) + "/" + meta.fileName;
     }
-    ["fileMode", "mtime", "uid", "gid"].forEach(
+    (["fileMode", "mtime", "uid", "gid"] as [
+      "fileMode",
+      "mtime",
+      "uid",
+      "gid"
+    ]).forEach(
       (key): void => {
         const arr = trim(header[key]);
         if (arr.byteLength > 0) {
-          meta[key as keyof UntarOptions] = parseInt(decoder.decode(arr), 8);
+          meta[key] = parseInt(decoder.decode(arr), 8);
         }
       }
     );
-    ["owner", "group"].forEach(
+    (["owner", "group"] as ["owner", "group"]).forEach(
       (key): void => {
         const arr = trim(header[key]);
         if (arr.byteLength > 0) {
-          meta[key as keyof UntarOptions] = decoder.decode(arr);
+          meta[key] = decoder.decode(arr);
         }
       }
     );
ry

comment created time in 17 days

push eventkitsonk/deno_std

Kitson Kelly

commit sha 2292fbe6b1935588e19bc2736b364e82b7c5d38e

Remove console.error from asserts. (#483)

view details

Xin Du (Clark)

commit sha c64734cbd980dad79ebc04015a16de0b9f654325

use unknown instead of any (#486)

view details

push time in 17 days

more