internalObject.ts 523 B

12345678910111213
  1. /**
  2. * Used during vnode props/slots normalization to check if the vnode props/slots
  3. * are the internal attrs / slots object of a component via
  4. * `Object.getPrototypeOf`. This is more performant than defining a
  5. * non-enumerable property. (one of the optimizations done for ssr-benchmark)
  6. */
  7. const internalObjectProto = {}
  8. export const createInternalObject = (): any =>
  9. Object.create(internalObjectProto)
  10. export const isInternalObject = (obj: object): boolean =>
  11. Object.getPrototypeOf(obj) === internalObjectProto