Comparator

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

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/390752-comparator/code/Comparator.js?version=738265

Author
Gerrit
Ratings
0 0 0
Version
0.3
Created
Updated
License
N/A
Applies to
All sites

Author's Description

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.