UNPKG

@vitruvius-labs/ts-predicate

Version:
14 lines (13 loc) 446 B
/** @internal */ function getStructuredDataPropertyDescriptor(descriptor, key) { // @ts-expect-error: Key mapping // eslint-disable-next-line @ts/no-unsafe-assignment -- It is safe const property_descriptor = descriptor[key]; if (typeof property_descriptor === "function") { return { test: property_descriptor, }; } return property_descriptor; } export { getStructuredDataPropertyDescriptor };