Published
Edited
Sep 22, 2020
Insert cell
Insert cell
literal = t.union([t.literal('foo'), t.literal('bar')])
Insert cell
keyof = t.keyof({ foo: null, bar: null })
Insert cell
bench('invalid, union of string literals', () => {
literal.decode('gar');
})
Insert cell
bench('invalid, keyof', () => {
keyof.decode('gar');
})
Insert cell
bench('valid, union of string literals', () => {
literal.decode('foo');
})
Insert cell
bench('valid, keyof', () => {
keyof.decode('foo');
})
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more