contiguous
v1.0.2
Published
check an Array for contiguous elements matching a predicate
Downloads
3,174
Maintainers
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)