This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'shim-definitions' { // This module name should match the package name. | |
/** | |
* This allows something like VSCode to auto-import with the name | |
* `shimDefinitions`. It could be any other name you want. | |
*/ | |
const shimDefinitions: any; | |
/** | |
* Doing this allows you to import like so: | |
* ```ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env deno run --allow-read --allow-write | |
import { parse } from "https://deno.land/[email protected]/flags/mod.ts"; | |
import { relative, resolve } from "https://deno.land/[email protected]/path/mod.ts"; | |
/* | |
Transforms the content all files in a directory to remove `.ts` from | |
the end of imports. | |
*/ | |
const { args, exit, mkdir, readDir, readFile, remove, stat, writeFile } = Deno; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env deno run --allow-read --allow-hrtime | |
import { readLines } from "https://deno.land/[email protected]/io/mod.ts"; | |
function intersection<T>(a: Set<T>, b: Set<T>): Set<T> { | |
// Quick optimisation by iterating the smaller set instead of the larger one. | |
const [small, large] = a.size > b.size ? [b, a] : [a, b]; | |
const intersect = new Set<T>(); | |
for (const item of small) { | |
if (large.has(item)) { |
OlderNewer