const endsWith = require('{%= name %}');
console.log(endsWith('foobar', 'bar')); //=> false
console.log(endsWith('foo/bar', 'bar')); //=> true
Type: boolean
Default: undefined
Enable case sensitivity.
endsWith('foo/bar', 'BAR');
//=> false
endsWith('foo/bar', 'BAR', { nocase: true });
//=> true
Type: boolean
Default: false
Allow matching against part of a path segment.
endsWith('foobar', 'bar');
//=> false
endsWith('foobar', 'bar', { partialMatch: true });
//=> true
Breaking changes
- No longer supports leading
!
as a negation character.