1.0.2 • Published 8 years ago

order-enforcer v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

order-enforcer

Small library for verifying lists are in order. See tests for examples.

NPM

build status npm version

Functions

isAscending(list, path)

Determines if a list is sorted in ascending order.

Kind: global function

Throws:

  • TypeError if list is not an array or values to be compared are not a string or number

Returns: Boolean true if sorted

ParamTypeDefaultDescription
listArray.<*>list of items to determine if sorted
pathStringnullfor a list of objects, compares the value of the path of the object

isDescending(list, path)

Determines if a list is sorted in descending order.

Kind: global function

Throws:

  • TypeError if list is not an array or values to be compared are not a string or number

Returns: Boolean true if sorted

ParamTypeDefaultDescription
listArray.<*>list of items to determine if sorted
pathStringnullfor a list of objects, compares the value of the path of the object