objecta
Assert on an object's property.
Implementation:
{ if typeof key !== 'string' throw `Expected an string for property name`; if typeof object !== 'object' throw `Expected an object for property ''`; return objectkey; } { const value = ex; if value === undefined throw `Expected property ''`; return value; } { const value = ex; if value === undefined return false; return true; } { if typeof type !== 'string' throw `Expected a type specification for ''`; const value = ex; if value === undefined return false; if typeof value !== type throw `Expected type '' for ''`; return true; }
https://twitter.com/@evanxsummers