Keybase proof
I hereby claim:
- I am jedmao on github.
- I am jedmao (https://keybase.io/jedmao) on keybase.
- I have a public key ASA7BpF6w9OoKvLe-RIf_anWdjJFBXsYAEPV9yw8cSgctgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import { readFile as _readFile } from 'fs'; | |
import * as ts from 'typescript'; | |
import { promisify } from 'util'; | |
const readFile = promisify(_readFile); | |
transform('input.ts'); | |
async function transform(filename: string) { | |
const sourceFile = ts.createSourceFile( |
Document = _ children:(Newline / Comment / Rule)* _ sections:Section* _ { | |
return { | |
type: 'EditorConfig', | |
version: '15.0.0', | |
children: children.concat(sections), | |
} | |
} | |
_ 'whitespace' = [ \t\n\r]* |
/** Essentials */ | |
export type Primitive = string | number | boolean | bigint | symbol | undefined | null; | |
/** Like Readonly but recursive */ | |
export type DeepReadonly<T> = T extends Primitive | |
? T | |
: T extends Function | |
? T | |
: T extends Date | |
? T |
// @ts-check | |
/** | |
* @typedef {{ items: Array<CartItem> }} Cart | |
* @typedef {{ | |
* sku: string, | |
* name: string, | |
* price: number, | |
* color?: Color, | |
* size?: Size, |
abap: ABAP | |
bat: Windows Bat | |
bib: BibTex | |
c: C | |
clj: Clojure | |
coffee: CoffeeScript | |
cpp: C++ | |
cs: C# | |
cshtml: Razor page/view | |
css: CSS |
abap: ABAP | |
bat: Windows Bat | |
bibtex: BibTeX | |
clojure: Clojure | |
coffeescript: Coffeescript | |
c: C | |
cpp: C++ | |
csharp: C# | |
css: CSS | |
diff: Diff |
import React from 'react' | |
export interface LabeledProps { | |
label: string | |
/** | |
* @default 'input' | |
*/ | |
children?: React.ReactNode | |
/** | |
* @default 'label' |
type ObjectPairs<T, X = keyof T, Y = string> = Array<[X, Y]> | Map<X, Y> | |
export function objectFromEntries< | |
T extends { [key: string]: any } = { [key: string]: any }, | |
P extends ObjectPairs<T> = ObjectPairs<T> | |
>(pairs: P) { | |
const result = {} as T | |
for (const [key, value] of pairs.entries()) { | |
result[key] = value | |
} | |
return result |
import { FC, useCallback } from 'react' | |
import { connect } from 'react-redux'; | |
import addToCart from '../actions/cart' | |
import useAddToCart, { UseAddToCartOptions } from './useAddToCart' | |
interface DispatchProps { | |
onSubmit(options: UseAddToCartOptions): Promise<void>, | |
} |