mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-18 11:44:09 +00:00
Migrate from ESLint to Oxlint and Oxfmt
This commit is contained in:
@@ -9,14 +9,18 @@ const apiClients: Map<string, ShlinkApiClient> = new Map();
|
||||
const getSelectedServerFromState = (getState: GetState): ServerWithId => {
|
||||
const { selectedServer } = getState();
|
||||
if (!hasServerData(selectedServer)) {
|
||||
throw new Error('There\'s no selected server or it is not found');
|
||||
throw new Error("There's no selected server or it is not found");
|
||||
}
|
||||
|
||||
return selectedServer;
|
||||
};
|
||||
|
||||
export const buildShlinkApiClient = (httpClient: HttpClient) => (getStateOrSelectedServer: GetState | ServerWithId) => {
|
||||
const { url: baseUrl, apiKey, forwardCredentials } = typeof getStateOrSelectedServer === 'function'
|
||||
const {
|
||||
url: baseUrl,
|
||||
apiKey,
|
||||
forwardCredentials,
|
||||
} = typeof getStateOrSelectedServer === 'function'
|
||||
? getSelectedServerFromState(getStateOrSelectedServer)
|
||||
: getStateOrSelectedServer;
|
||||
const serverKey = `${apiKey}_${baseUrl}_${forwardCredentials ? 'forward' : 'no-forward'}`;
|
||||
|
||||
Reference in New Issue
Block a user