Helpers for typescript
(documentation, wip)
export {AnyHelp} from "./AnyHelp";
helpers that work on any type e.g.
isNotNull
export {ArrayHelp} from "./ArrayHelp"
helpers for array, better typesafety for higher order function array helpers
export {ObjectHelp} from "./ObjectHelp"
helper for object
export {EQ, EQ_NS} from "./Equality"
export {KeySet} from "./KeySet"
export {MapHelp} from "./MapHelp"
export {WebHelp} from "./WebHelp"
export {Global} from "./Global"
export {ChunkedIterate} from "./ChunkedIterate"
export {Decorators} from "./Decorators"
export {TypeHelp} from "./TypeHelp"
export {StringHelp} from "./StringHelp"
export {FunctionHelp} from "./FunctionHelp"
export {ProxyHelp} from "./ProxyHelp"
export {Ided, Idify} from "./Ided"
a way to DRYly write an object whose properties use the key they are assigned to in their own initialization
type Color = {name: T}
const colors = {
...Ided.byName({name: "red"}),
...Ided.byName({name: "green"}),
}
//Colors will have the type:
{red: {name: "red"}, {green: {name: "green"}}
export {Heap} from "./Heap"
a simple heap implementation
export {YoconHelp} from "./yocon/YoconHelp"
a work in progress port of the
export {StringEnum, Enum} from "./Enum"
better versions of enums
export * from "./TopLevelExports"
$3
function createRecord
(obj: T,): T extends object ? Record> : never {
return obj as any
}$3
$3
$3
$3
$3
$3
//iife = immediately invoked function expression, useful to avoid having to add extra parens
iife(() => x + 1) // invokes immediately
(() => x + 1)()//Lines starting with a ( are Problematic without explicit semicolons
//Consider
const y = 1
const x = y
(() => x + 1)()
//This will be interpreted as
const y = 1
const x = y(() => x + 1)()
$3
$3
$3
$3
$3
$3
$3
$3
$3
export * from "./TopLevelTypes"
$3
$3
$3
$3
$3
$3
$3
$3
$3
$3
$3
$3
$3