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