order-enforcer

1.0.2 • Public • Published

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.

isDescending(list, [path])

Determines if a list is sorted in descending order.

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

Param Type Default Description
list Array.<*> list of items to determine if sorted
[path] String null for 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

Param Type Default Description
list Array.<*> list of items to determine if sorted
[path] String null for a list of objects, compares the value of the path of the object

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i order-enforcer

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • sahellebusch