Sha256: ae653ae2c7af9ec5d0d02788d5908e66f43f0a958b2d75d8b055d301d14ef97d

Contents?: true

Size: 596 Bytes

Versions: 46

Compression:

Stored size: 596 Bytes

Contents

"use strict";

var toInteger = require("../../../number/to-integer")
  , value     = require("../../../object/valid-value")
  , isValue   = require("../../../object/is-value")
  , min       = Math.min
  , max       = Math.max;

module.exports = function (searchString /*, endPosition*/) {
	var self, start, endPos;
	self = String(value(this));
	searchString = String(searchString);
	endPos = arguments[1];
	start =
		(isValue(endPos) ? min(max(toInteger(endPos), 0), self.length) : self.length) -
		searchString.length;
	return start < 0 ? false : self.indexOf(searchString, start) === start;
};

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
govuk_publishing_components-16.19.0 node_modules/es5-ext/string/#/ends-with/shim.js
govuk_publishing_components-16.18.0 node_modules/es5-ext/string/#/ends-with/shim.js
govuk_publishing_components-16.17.0 node_modules/es5-ext/string/#/ends-with/shim.js
optimacms-0.4.3 spec/dummy/node_modules/es5-ext/string/#/ends-with/shim.js
optimacms-0.4.2 spec/dummy/node_modules/es5-ext/string/#/ends-with/shim.js
cortex-0.1.3 spec/dummy/node_modules/es5-ext/string/#/ends-with/shim.js