Skip to content

Instantly share code, notes, and snippets.

View lucacasonato's full-sized avatar
🖥️
Programming

Luca Casonato lucacasonato

🖥️
Programming
View GitHub Profile
function decorate(target: any) {}
@decorate
class Foo {}
Deno.utime();
@lucacasonato
lucacasonato / deno_doc_polyfill.ts
Last active April 15, 2020 17:41
Deno.doc pollyfill
export enum DocNodeKind {
Function = "function",
Variable = "variable",
Class = "class",
Enum = "enum",
Interface = "interface",
TypeAlias = "typeAlias",
Namespace = "namespace",
}
export interface DocNodeLocation {
export function example(param?: string) {
return "test";
}
export function greeter(name?: string) {
console.log("Hello" + (name ? " " + name : "") + "!");
}
const test = "hello";
export { test };
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
export namespace Deno {
/** The current process id of the runtime. */
export let pid: number;
/** Reflects the NO_COLOR environment variable.
@lucacasonato
lucacasonato / code.js
Created April 1, 2020 19:38
Issue with large amounts of piped data in Deno.run
const proc = Deno.run({
cmd: ["deno", "doc", "lib.deno.d.ts", "--json", "--reload"],
stdout: "piped",
stderr: "piped"
});
const status = await proc.status();
await Deno.copy(Deno.stdout, proc.stdout)
@lucacasonato
lucacasonato / app.js
Created March 30, 2020 00:06
deno --importmap=importmap.json app.js
import * as voca from "voca";
console.log(voca);
Compile file:///home/lucacasonato/Downloads/test.ts
error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
► file:///home/lucacasonato/Downloads/test2.ts:5:7
5 hello(1);