Comparator

Configurable Comparator similar to java.util.Comparator in Java 8

As of 2019-10-03. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/390752/738034/Comparator.js

Author
Gerrit
Version
0.1
Created
2019-10-03
Updated
2019-10-03
License
N/A

Sets up a "compare(a, b)" - function:
- With accessor-functions (e.g. to sort by properies)
- In ascending or descending order
- null and undefined first or last

Possible chaining of Comparators or Accessor-functions.