is-monotonic

    1.0.0 • Public • Published

    is-monotonic

    checks that a given sequence is strictly increasing or decreasing

    Example

    const { isMonotonicIncreasing, isMonotonicDecreasing } = require('is-monotonic')
     
    isMonotonicIncreasing([1, 2, 3, 4]) // true
    isMonotonicIncreasing([1, 3, 2, 4]) // false
     
    isMonotonicDecreasing([4, 3, 2, 1]) // true
    isMonotonicDecreasing([4, 2, 3, 1]) // false

    See also

    Install

    npm i is-monotonic

    DownloadsWeekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.29 kB

    Total Files

    5

    Last publish

    Collaborators

    • fibo