project files added

This commit is contained in:
mhalfmann
2021-06-15 16:00:08 +02:00
parent e156e2f053
commit db46afa351
13928 changed files with 1569902 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(String.prototype, "endsWith",
{ value: require("./shim"),
configurable: true,
enumerable: false,
writable: true });
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
module.exports = require("./is-implemented")()
? String.prototype.endsWith
: require("./shim");
@@ -0,0 +1,8 @@
"use strict";
var str = "razdwatrzy";
module.exports = function () {
if (typeof str.endsWith !== "function") return false;
return (str.endsWith("trzy") === true) && (str.endsWith("raz") === false);
};
+18
View File
@@ -0,0 +1,18 @@
"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;
};