If I enable debugging (citeproc-js/src/registry.js#L803-L805), the processor prints the following log. It seems that year-suffix is not involved in the procedure of citation sorting and the cites are outputted in the order that they are cited. Is this the expected behavior?
Sorry, I’m a bit confused. In your first post, you write
I’m planning to sort the citations items with output (Nietzsche 1988a, 1988b) but citeproc-js gives (Nietzsche 1988a, 1988b).
Those are the same thing?
Then in the text fixture with APA, you say
I also compare apa.csl with biblatex-apa. The former outputs (Nietzsche, 1988b, 1988a) and the latter outputs (Nietzsche, 1988a, 1988b).
But assuming that apa.csl is the former, that’s not actually what the text fixture shows:
>>===== RESULT =====>>
>> (Nietzsche, 1988a, 1988b)
<<===== RESULT =====<<
Just taking your question as ‘how can I sort by year-suffix in the citation’ the answer is that per spec, year suffixes are in the oder items appear in the bibliography. Consequently, you can sort by year suffix by sorting citation the same way the bibliography is sorted.
The original question uses a style that doesn’t sort citations at all, as you note on GH, so the reverse sorting there is not an accident.