2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2018-04-03 14:16:57 +00:00
|
|
|
// By Mozilla Contributors licensed under CC-BY-SA 2.5 (http://creativecommons.org/licenses/by-sa/2.5/)
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|