@wdprlib/render
    Preparing search index...

    Function sortGalleryFiles

    • Sort page attachments by a gallery's order attribute.

      Returns a new array (the shared PageFileData list from the page context is never mutated). Rules:

      • name / name desc: code-point comparison of the filename; desc flips the comparison. Names are unique per page, so no tie-break.
      • created_at / created_at desc: files with createdAt come first, compared numerically (desc flips only this comparison); equal timestamps tie-break on name ascending (also under desc). Files without createdAt always sort last, keeping their given order.

      Parameters

      Returns PageFileData[]