Home Manual Reference Source

Function

Static Public Summary
public

key(compare: Function, callable: Function): Function

Compile an object key comparison function given key comparison function and a key function.

public

len(compare: Function): Function

Compile an object length comparison function given a length comparison function.

public

prop(compare: Function, key: any): Function

Compile an object property comparison function given a property comparison function and a property key.

Static Public

public key(compare: Function, callable: Function): Function source

import key from '@total-order/key/src/key.js'

Compile an object key comparison function given key comparison function and a key function.

Params:

NameTypeAttributeDescription
compare Function

The function used to order values.

callable Function

The function that generates values used in the comparison.

Return:

Function

The function that orders objects by value.

public len(compare: Function): Function source

import len from '@total-order/key/src/len.js'

Compile an object length comparison function given a length comparison function.

Params:

NameTypeAttributeDescription
compare Function

The function used to order lengths.

Return:

Function

The function that orders objects by length.

public prop(compare: Function, key: any): Function source

import prop from '@total-order/key/src/prop.js'

Compile an object property comparison function given a property comparison function and a property key.

Params:

NameTypeAttributeDescription
compare Function

The function used to order propibutes.

key any

The key of the propibute used in the comparison.

Return:

Function

The function that orders objects by propibute.