UNPKG

gatsby-source-prismic

Version:

Gatsby source plugin for building websites using Prismic as a data source

17 lines (14 loc) 472 B
/** * Symbol used to identify if a value is a proxy. Attach this to proxies (done * automatically via `lib/createGetProxy`). */ export const IS_PROXY = Symbol("IS_PROXY"); // eslint-disable-next-line @typescript-eslint/ban-types export const createGetProxy = <T extends object>( target: T, get: ProxyHandler<T>["get"], ): T => { // @ts-expect-error - We are forcibly adding this "is proxy" property target[IS_PROXY] = true; return new Proxy(target, { get }); };