mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
425 B
16 lines
425 B
8 years ago
|
// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
||
|
if (!String.prototype.includes) {
|
||
|
String.prototype.includes = function(search, start) {
|
||
|
'use strict';
|
||
|
if (typeof start !== 'number') {
|
||
|
start = 0;
|
||
|
}
|
||
|
|
||
|
if (start + search.length > this.length) {
|
||
|
return false;
|
||
|
} else {
|
||
|
return this.indexOf(search, start) !== -1;
|
||
|
}
|
||
|
};
|
||
|
}
|