adding b as shortcut

This commit is contained in:
2023-09-22 18:58:48 +02:00
parent 2b1ccd1825
commit c0e79ed704
2 changed files with 24 additions and 21 deletions

View File

@ -1017,6 +1017,7 @@ export class UserAPI {
); );
return results.some((value) => value === true); return results.some((value) => value === true);
}; };
b = this.beat;
public pulse = (...n: number[]): boolean => { public pulse = (...n: number[]): boolean => {
const results: boolean[] = n.map( const results: boolean[] = n.map(

View File

@ -16,6 +16,7 @@ declare global {
repeatPair(amount: number): T; repeatPair(amount: number): T;
repeatOdd(amount: number): T; repeatOdd(amount: number): T;
beat(division: number): T; beat(division: number): T;
b(division: number): T;
bar(): T; bar(): T;
pulse(): T; pulse(): T;
pick(): T; pick(): T;
@ -138,6 +139,7 @@ export const makeArrayExtensions = (api: UserAPI) => {
); );
return this[slice_count % this.length]; return this[slice_count % this.length];
}; };
Array.prototype.b = Array.prototype.beat;
Array.prototype.shuffle = function() { Array.prototype.shuffle = function() {
/** /**