mirror of https://github.com/vuejs/core.git
14 lines
523 B
TypeScript
14 lines
523 B
TypeScript
/**
|
|
* Used during vnode props/slots normalization to check if the vnode props/slots
|
|
* are the internal attrs / slots object of a component via
|
|
* `Object.getPrototypeOf`. This is more performant than defining a
|
|
* non-enumerable property. (one of the optimizations done for ssr-benchmark)
|
|
*/
|
|
const internalObjectProto = {}
|
|
|
|
export const createInternalObject = (): any =>
|
|
Object.create(internalObjectProto)
|
|
|
|
export const isInternalObject = (obj: object): boolean =>
|
|
Object.getPrototypeOf(obj) === internalObjectProto
|