contiguous

check an Array for contiguous elements matching a predicate

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
contiguous
1.0.26 years ago8 years agoMinified + gzip package size for contiguous in KB

Readme

var contiguous = require('contiguous')
var assert = require('assert')

var isX = function(value) {
  return value === 'x'
}

assert(contiguous(['x', 'x'], isX) === true)

assert(contiguous(['x', 'y'], isX) === false)

assert(contiguous(['y', 'x'], isX) === false)

assert(contiguous([], isX) === false)

assert(contiguous(['x'], isX) === false)

assert(contiguous(['y'], isX) === false)