'use strict';

/**
 * Module dependencies
 */

// normalize-path is 500% - 1000% faster than path.normalize()
var normalize = require('normalize-path');
var endsWith = require('ends-with');

/**
 * Return true if `filepath` ends with the given `token`
 *
 * @param  {String} `filepath`
 * @param  {String} `token`
 * @return {Boolean}
 */

module.exports = function(fp, token) {
  return endsWith(normalize(fp, false), normalize(token, false));
};