UNPKG

@nestjs/graphql

Version:

Nest - modern, fast, powerful node.js web framework (@graphql)

18 lines (17 loc) 510 B
import { isFunction } from '@nestjs/common/utils/shared.utils.js'; function isNativeClass(fn) { return (typeof fn === 'function' && /^class\s/.test(Function.prototype.toString.call(fn))); } export function getInterfacesArray(interfaces) { if (!interfaces) { return []; } if (Array.isArray(interfaces)) { return interfaces; } if (isFunction(interfaces) && !isNativeClass(interfaces)) { interfaces = interfaces(); } return [].concat(interfaces); }