This commit is contained in:
IDONTSUDO 2024-04-11 22:02:57 +03:00
parent c17515d571
commit 0c03906518
25 changed files with 475 additions and 201 deletions

View file

@ -51,4 +51,10 @@ export const ArrayExtensions = () => {
return this.indexOf(element) !== -1;
};
}
if ([].repeat === undefined) {
// eslint-disable-next-line no-extend-native
Array.prototype.repeat = function (quantity) {
return Array(quantity).fill(this[0]);
};
}
};

View file

@ -19,6 +19,7 @@ declare global {
isEmpty(): boolean;
isNotEmpty(): boolean;
hasIncludeElement(element: T): boolean;
repeat(quantity: number): Array<T>;
}
interface Number {
fromArray(): number[];