add and run prettier

This commit is contained in:
Lee
2023-10-17 23:38:18 +01:00
parent 47a23f0484
commit f6f56aa09c
136 changed files with 8231 additions and 4493 deletions

View File

@ -1,21 +1,23 @@
import {default as createQueue, PRIORITY} from '../http-queue';
import {substituteVars} from "../../../utils/format";
import { default as createQueue, PRIORITY } from "../http-queue";
import { substituteVars } from "../../../utils/format";
const BEATMAPS_API_URL = 'https://api.beatsaver.com/';
const SONG_BY_HASH_URL = BEATMAPS_API_URL + '/maps/hash/${hash}';
const SONG_BY_KEY_URL = BEATMAPS_API_URL + '/maps/id/${key}'
const BEATMAPS_API_URL = "https://api.beatsaver.com/";
const SONG_BY_HASH_URL = BEATMAPS_API_URL + "/maps/hash/${hash}";
const SONG_BY_KEY_URL = BEATMAPS_API_URL + "/maps/id/${key}";
export default (options = {}) => {
const queue = createQueue(options);
const {fetchJson, fetchHtml, ...queueToReturn} = queue;
const { fetchJson, fetchHtml, ...queueToReturn } = queue;
const byHash = async (hash, priority = PRIORITY.FG_LOW, options = {}) => fetchJson(substituteVars(SONG_BY_HASH_URL, {hash}), options, priority)
const byKey = async (key, priority = PRIORITY.FG_LOW, options = {}) => fetchJson(substituteVars(SONG_BY_KEY_URL, {key}), options, priority)
const byHash = async (hash, priority = PRIORITY.FG_LOW, options = {}) =>
fetchJson(substituteVars(SONG_BY_HASH_URL, { hash }), options, priority);
const byKey = async (key, priority = PRIORITY.FG_LOW, options = {}) =>
fetchJson(substituteVars(SONG_BY_KEY_URL, { key }), options, priority);
return {
byHash,
byKey,
...queueToReturn,
}
}
};
};