scale now accept any array length
This commit is contained in:
@ -11,7 +11,6 @@
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.4.0",
|
||||
"@types/audioworklet": "^0.0.49",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@ -355,16 +355,14 @@ Array.prototype.scale = function <T>(this: T[], scaleName: string = "major") {
|
||||
|
||||
let result = [];
|
||||
|
||||
for (let i = 0; i < scale.length; i++) {
|
||||
for (let j = 0; j < scale.length; j++) {
|
||||
|
||||
if (!this[i]) {
|
||||
result.push(this[0] + scale[i]);
|
||||
} else {
|
||||
result.push(this[i] + scale[i]);
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
|
||||
result.push(this[i] + scale[j]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//this.shift()
|
||||
//this = [...result];
|
||||
return result;
|
||||
};
|
||||
|
||||
@ -1375,11 +1375,6 @@ tslib@^2.3.1, tslib@^2.6.1:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"
|
||||
integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==
|
||||
|
||||
typescript@^5.0.2:
|
||||
version "5.1.6"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
|
||||
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
|
||||
|
||||
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
|
||||
|
||||
Reference in New Issue
Block a user