EmbyCrackedClient/web/modules/polyfills/string.js

1 line
870 B
JavaScript
Raw Permalink Normal View History

2025-06-25 11:46:04 +08:00
String.prototype.includes||(String.prototype.includes=function(search,start){if(search instanceof RegExp)throw TypeError("first argument must not be a RegExp");return-1!==this.indexOf(search,start=void 0===start?0:start)}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(search,rawPos){rawPos=0<rawPos?0|rawPos:0;return this.substring(rawPos,rawPos+search.length)===search}}),String.prototype.endsWith||(String.prototype.endsWith=function(search,this_len){return(void 0===this_len||this_len>this.length)&&(this_len=this.length),this.substring(this_len-search.length,this_len)===search}),String.prototype.replaceAll||(String.prototype.replaceAll=function(find,replace){let s="",index,next;for(;~(next=this.indexOf(find,index));)s+=this.substring(index,next)+replace,index=next+find.length;return s+this.substring(index)});