CodeCommitsIssuesPull requestsActionsInsightsSecurity
b96e14fd294a74341222ff389e283354499d0b68

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.script/utils/stringExtenssions.ts

12lines · modepreview

interface String {
  endsWithAny: (suffixes: string[]) => boolean;
  startsWithAny: (prefixes: string[]) => boolean;
}

String.prototype.endsWithAny = function(this: string, suffixes: string[]): boolean {
  return suffixes.some(suffix => this.endsWith(suffix));
};

String.prototype.startsWithAny = function(this: string, prefixes: string[]): boolean {
  return prefixes.some(prefix => this.startsWith(prefix));
};