Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

end-with

gearcase49.2kMIT1.0.2

Determines whether a string ends with the characters of another string.

string, str, starts, start, with, ends, end, search, prefix, postfix, check, first, begin, last, end, shim, polyfill, Ponyfill, util, utils, utility, tool

readme

end-with Version Badge

Determines whether a string ends with the characters of another string.

ES2015 String#endsWith() ponyfill.

Ponyfill: A polyfill that doesn't overwrite the native method.

MIT License

build:? coverage:?

Install

$ npm install --save end-with 

Usage

For more use-cases see the tests

var endWith = require('end-with');

endWith('abcde', 'e');  // => true
endWith('abcde', 'de'); // => true
endWith('abcde', 'bc'); // => false
endWith('abcde', '');   // => true
endWith('abcde');       // => false
endWith('abcde', null); // => false
  • start-with - Determines whether a string begins with the characters of another string.
  • pad-start - ES spec-compliant String.prototype.padStart shim.
  • pad-end - ES spec-compliant String.prototype.padEnd shim.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.