mziccard / node-timsort

Tim Sort implementation for Node.js
MIT License
244 stars 37 forks source link

Allow to sort typed arrays #21

Open arcusfelis opened 4 years ago

arcusfelis commented 4 years ago

Hi, nice work.

I have only one issue: "Can only sort arrays" error when sorting something like Int32Array. Because of the usage of Array.isArray there https://github.com/mziccard/node-timsort/blob/master/src/timsort.js#L910

Array.isArray(new Int32Array(1))
false

Though, if the check is removed, the library works good.