cyperdark / osu-api-extended

Package for advanced work with "osu" api
MIT License
49 stars 15 forks source link

Error types.filter is not a function #4

Closed 4xy0m closed 3 years ago

4xy0m commented 3 years ago

i have a error when i use v2.beatmaps_events() & i have fix this error in /dist/index.ts

The fix:

beatmaps_events(types) {

return __awaiter(this, void 0, void 0, function* () { let params = ''; const array = [] array.push(types) array.filter((r, i) => (i === types.length - 1 ? (params += types[]=${r}) : (params += types[]=${r}&))); const { data } = yield this.api.get(/beatmapsets/events${params !== '' ??${params}: ''}); return data; }); }