UNPKG

chai-latte

Version:

Build expressive & readable fluent interface libraries.

16 lines (15 loc) 267 B
export const getPrototypeChain = (obj) => { const chain = [] let t = obj while (t) { t = Object.getPrototypeOf(t) if (t === null) { break; } if (t.constructor) { chain.push(t.constructor) } chain.push(t) } return chain }