marpple / FxTS

A functional programming library for TypeScript/JavaScript
https://fxts.dev
Apache License 2.0
935 stars 71 forks source link

sort example not working #281

Closed flex-hyuntae closed 2 months ago

flex-hyuntae commented 2 months ago

Bug Report

sort((a, b) => a > b, [3, 4, 1, 2, 5, 2]); // [1, 2, 2, 3, 4, 5]
sort((a, b) => a > b, 'bcdaef); // ["a", "b", "c", "d", "e", "f"]

๐Ÿ’ป Code

๐Ÿ™ Actual behavior

sort((a, b) => a > b, [3, 4, 1, 2, 5, 2]); // [3, 4, 1, 2, 5, 2]
sort((a, b) => a > b, 'bcdaef); // ['b', 'c', 'd', 'a', 'e', 'f']

๐Ÿ™‚ Expected behavior

sort((a, b) => a > b, [3, 4, 1, 2, 5, 2]); // [1, 2, 2, 3, 4, 5]
sort((a, b) => a > b, 'bcdaef); // ["a", "b", "c", "d", "e", "f"]

I don't know what the intent is

If it is intended to use '>' inside the Sort function, then the function should be fixed. If not, I think you need to fix the example


Version Information

ppeeou commented 2 months ago

@flex-hyuntae thank you for your report๐Ÿ‘ I will fix it :)

flex-hyuntae commented 1 month ago

@ppeeou Hello, first example also not working