UNPKG

@pothos/core

Version:

Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript

25 lines (24 loc) 584 B
export function classDepth(obj) { const proto = Object.getPrototypeOf(obj); if (!proto) { return 0; } return 1 + classDepth(proto); } // biome-ignore lint/suspicious/noExplicitAny: this is fine export function sortClasses(classes) { return [ ...classes ].sort((a, b) => { const depthA = classDepth(a); const depthB = classDepth(b); if (depthA > depthB) { return -1; } if (depthB > depthA) { return 1; } return 0; }); } //# sourceMappingURL=sort-classes.js.map