Skip to content
Discussion options

You must be logged in to vote

The sort is silently ignored (evaluates to undefined) because item[l.field] in website-listing-read.ts performs a plain key lookup. "author.name" is not a valid top-level key on a ListingItem.

Relevant code:

  • listing.sort.map((l) => {
    return (item: ListingItem) => {
    // handle undefined for 'order' (it's used by our default)
    const value = item[l.field];
    if (value === undefined && l.field === kFieldOrder) {
    if (l.direction === "asc") {
    return Number.MAX_SAFE_INTEGER;
    } else {
    return 0;
    }
    } else {
    return value;
    }
    };

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by epurdom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants