Skip to content

Instantly share code, notes, and snippets.

@heyzling
heyzling / recursiveRequired.ts
Last active March 3, 2024 16:31
Mapping Type, RecursiveRequired
/** Make type recursively Required.
* Source: https://gist.github.com/gomezcabo/dff1d95fd1eb354f686d6606a511d7da
* @typeParam T - Type of object to make recursively Required
* @typeParam K - fields which content should not be Required.
* Field themselfs still be Required, but their child fields will not.
* @typeParam OverrideRecordsWithArrays - flag.
* If true will override all Record<string,MyObj> in type to MyObj[] (i.e. array of objects)
*/
export type RecursiveRequiredOld<T, K, RecordsToArrays extends boolean> =
@heyzling
heyzling / go.sh
Last active February 6, 2019 15:59
Golang
# autocompletion server. VS Code need it
go get -u github.com/mdempsky/gocode
# autocompletion for func arguments.
go get golang.org/x/tools/cmd/godoc
go get github.com/rogpeppe/godef