hackernews-node/node_modules/prisma-datamodel/dist/util/sort.js
/**
 * Sorts the given list of types in topological order,
 * depending on their relation. Respects embedded types.
 *
 * The topological order is established by traversing the dependency graph in depth-first order (dfs toposort).
 * @param types The types to sort.
 * @returns A new list containing all types in topological order.
 */
Sorts the given list of types in topological order,
depending on their relation. Respects embedded types.

The topological order is established by traversing the dependency graph in depth-first order (dfs toposort).
@param types The types to sort.
@returns A new list containing all types in topological order.
Sorts the given list of types in topological order depending on their relation . Respects embedded types . The topological order is established by traversing the dependency graph in depth - first order ( dfs toposort ) . @param types The types to sort . @returns A new list containing all types in topological order .
function toposort(types) {
    var sorted = [];
    for (var _i = 0, types_1 = types; _i < types_1.length; _i++) {
        var type = types_1[_i];
        if (!type.isEmbedded) {
            toposortType(type, sorted);
        }
    }
    if (sorted.length !== types.length) {
        gqlAssert_1.default.raise('Failed to establish topological order. This usually indicates an embedded type which is not used in the data model.');
    }
    return sorted;
}
function toposort ( types ) { var sorted = [ ] ; for ( var _i = 0 , types_1 = types ; _i < types_1 . length ; _i ++ ) { var type = types_1 [ _i ] ; if ( ! type . isEmbedded ) { toposortType ( type , sorted ) ; } } if ( sorted . length !== types . length ) { gqlAssert_1 . default . raise ( 'Failed to establish topological order. This usually indicates an embedded type which is not used in the data model.' ) ; } return sorted ; }
Sorts the given list of types in topological order,
 depending on their relation.
Sorts the given list of types in topological order depending on their relation .
// Embedded never at top level.