string-range

v1.2.2
check if a string is within a range

string-range

Check whether a string is within a range.

Example

var ranges = require('string-range')

ranges.satisfies('hello', {start: 'a', end: 'z'})
=> true
ranges.satisfies('Hello', {start: 'a', end: 'z'})
=> false

//force a range inside a prefix!

ranges.satisfies('TYPE~key', ranges.prefix({start:'a', end:'z'}, 'TYPE')
=> true

License

MIT

npm i string-range

Metadata

  • MIT
  • Whatever
  • Dominic Tarr
  • released 7/17/2013

Downloads

Maintainers