Returns true if the given string or array ends with any of the given substrings.
Install with npm
$ npm i ends-with-any --save
var endsWithAny = require('ends-with-any');
true
All of the following return true:
endsWithAny('abc', 'c');
endsWithAny('xyz', 'z');
endsWithAny(['a', 'b', 'c'], 'c');
endsWithAny(['x', 'y', 'z'], 'z');
endsWithAny('abc', ['a', 'z', 'c']);
endsWithAny('xyz', ['x', 'y', 'z']);
endsWithAny('foo bar baz', ['slls', 'a', 'baz']);
endsWithAny(['a', 'b', 'c'], ['c', 'g', 'foo']);
endsWithAny(['x', 'y', 'z'], ['alpha', 'delta', 'z']);
//=> true
false
All of the following return false:
endsWithAny('xyz', 'x');
endsWithAny('abc', 'a');
endsWithAny('abc', ['x', 'y', 'z']);
endsWithAny('xyz', ['a', 'b', 'c']);
endsWithAny('foo bar baz', ['slls', 'a', 'foo']);
//=> false
true if the given string or array ends with suffix using strict equality for… moretrue if the given string or array starts with prefix using strict equality for… moreInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on July 09, 2015.