Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 763 Bytes

.verb.md

File metadata and controls

48 lines (31 loc) · 763 Bytes

Usage

const endsWith = require('{%= name %}');

console.log(endsWith('foobar', 'bar'));  //=> false 
console.log(endsWith('foo/bar', 'bar')); //=> true

Options

options.nocase

Type: boolean

Default: undefined

Enable case sensitivity.

endsWith('foo/bar', 'BAR');
//=> false
endsWith('foo/bar', 'BAR', { nocase: true }); 
//=> true

options.partialMatch

Type: boolean

Default: false

Allow matching against part of a path segment.

endsWith('foobar', 'bar');                          
//=> false                 
endsWith('foobar', 'bar', { partialMatch: true });  
//=> true 

Release history

v2.0

Breaking changes

  • No longer supports leading ! as a negation character.