Skip to content

Instantly share code, notes, and snippets.

View keelii's full-sized avatar
🎯
Focusing

kily zhou keelii

🎯
Focusing
View GitHub Profile
@keelii
keelii / deno_ext.ts
Last active September 25, 2020 15:32
deno ext processer.
import { join } from "https://deno.land/std/path/mod.ts";
import { readLines } from "https://deno.land/std/io/bufio.ts";
type ProcessType = "remove" | "restore";
function getResultContent(type: ProcessType, m: string) {
const hasExtRE = /\.ts";$/;
if (type === "remove") {
if (hasExtRE.test(m)) {
return m.replace(hasExtRE, '";');
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this: