Function source
Methods
-
by(relation, compare) → {Function} <constructor> source
-
A utility for creating a comparator function for a particular aspect of a figurative class of objects.
Parameters:
Name Type Description relationFunction A function that accepts a value and returns a corresponding value to use as a representative when sorting that object.
compareFunction an alternate comparator for comparing the represented values. The default is
Object.compare, which does a deep, type-sensitive, polymorphic comparison.Returns: Function
a comparator that has been annotated with
byandcompareproperties soArray#sortedcan perform a transform that reduces the need to callbyon each sorted object to just once. -
identity(any) → {Any} <constructor> source
-
A utility to reduce unnecessary allocations of
function (x) {return x}in its many colorful but ultimately wasteful parameter name variations.Parameters:
Name Type Description anyAny value
Returns: Any
that value
-
noop() <constructor> source
-
A utility to reduce unnecessary allocations of
function () {}in its many colorful variations. It does nothing and thus makes a suitable default in some circumstances.
Generated from a4679af