update dependencies
This commit is contained in:
@@ -1,21 +1,15 @@
|
||||
import globals from "globals";
|
||||
import pluginJs from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
import globals from 'globals';
|
||||
import pluginJs from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
|
||||
|
||||
export default [
|
||||
{
|
||||
files: ["src/*.ts"],
|
||||
ignores:[
|
||||
"node_modules",
|
||||
"dist",
|
||||
"lib",
|
||||
"coverage"
|
||||
],
|
||||
files: ['src/*.ts'],
|
||||
ignores: ['node_modules', 'dist', 'lib', 'coverage'],
|
||||
languageOptions: {
|
||||
globals: globals.browser,
|
||||
}
|
||||
},
|
||||
},
|
||||
pluginJs.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
@@ -8,6 +8,7 @@ export class Api {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
async get<T>(path: string, options?: Record<string, any>): Promise<T> {
|
||||
const params = parseOptions(options);
|
||||
const response = await fetch(`${BASE_URL_V3}${path}?${params}`, {
|
||||
|
||||
@@ -129,7 +129,7 @@ export type AppendToResponseMediaType =
|
||||
export type AppendToResponse<
|
||||
K,
|
||||
T extends AppendToResponseAllKeys[] | undefined,
|
||||
Media extends AppendToResponseMediaType
|
||||
Media extends AppendToResponseMediaType,
|
||||
> = K &
|
||||
(T extends undefined
|
||||
? object
|
||||
@@ -141,7 +141,9 @@ export type AppendToResponse<
|
||||
: Omit<Credits, 'id'>;
|
||||
}
|
||||
: object) &
|
||||
('videos' extends T[number] ? { videos: Omit<Videos, 'id'> } : object) &
|
||||
('videos' extends T[number]
|
||||
? { videos: Omit<Videos, 'id'> }
|
||||
: object) &
|
||||
('images' extends T[number]
|
||||
? {
|
||||
images: Omit<
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
export function parseOptions(options?: Record<string, any>): string {
|
||||
return options ? new URLSearchParams(Object.entries(options)).toString() : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user