Merge pull request #14 from Hoidi/master
Replace querystring with URLSearchParams
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "tmdb-ts",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "tmdb-ts",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.4"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tmdb-ts",
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.6",
|
||||
"description": "TMDB v3 library wrapper",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import querystring from 'querystring';
|
||||
import { BaseEndpoint } from './base';
|
||||
import { ChangeOptions, Changes } from '../types/changes';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
|
||||
export class ChangeEndpoint extends BaseEndpoint {
|
||||
@@ -9,18 +9,17 @@ export class ChangeEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async movies(options?: ChangeOptions): Promise<Changes> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Changes>(`/movie/changes?${params}`);
|
||||
}
|
||||
|
||||
async tvShows(options?: ChangeOptions): Promise<Changes> {
|
||||
const params = querystring.stringify(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Changes>(`/tv/changes?${params}`);
|
||||
}
|
||||
|
||||
async person(options?: ChangeOptions): Promise<Changes> {
|
||||
const params = querystring.stringify(options);
|
||||
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Changes>(`/person/changes${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DetailedCollection, ImageCollection, LanguageOption, Translations } from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring from 'querystring';
|
||||
|
||||
const BASE_COLLECTION = '/collection';
|
||||
|
||||
@@ -10,18 +10,17 @@ export class CollectionsEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async details(id: number, options? : LanguageOption): Promise<DetailedCollection> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<DetailedCollection>(`${BASE_COLLECTION}/${id}?${params}`);
|
||||
}
|
||||
|
||||
async images(id: number, options? : LanguageOption): Promise<ImageCollection> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<ImageCollection>(`${BASE_COLLECTION}/${id}/images?${params}`);
|
||||
}
|
||||
|
||||
async translations(id: number, options? : LanguageOption): Promise<Translations> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Translations>(`${BASE_COLLECTION}/${id}/translations?${params}`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import { MovieDiscoverResult, SortOption, TvShowDiscoverResult } from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring, { ParsedUrlQueryInput } from 'querystring';
|
||||
|
||||
const BASE_DISCOVER = '/discover';
|
||||
|
||||
interface DiscoverQueryOptions extends ParsedUrlQueryInput{
|
||||
interface DiscoverQueryOptions {
|
||||
language?: string;
|
||||
sort_by?: SortOption;
|
||||
page?: number;
|
||||
@@ -66,12 +66,12 @@ export class DiscoverEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async movie(options?: MovieQueryOptions): Promise<MovieDiscoverResult> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<MovieDiscoverResult>(`${BASE_DISCOVER}/movie?${params}`);
|
||||
}
|
||||
|
||||
async tvShow(options?: TvShowQueryOptions): Promise<TvShowDiscoverResult> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TvShowDiscoverResult>(`${BASE_DISCOVER}/tv?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring from 'querystring';
|
||||
import { ExternalIdOptions, FindResult } from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
export class FindEndpoint extends BaseEndpoint {
|
||||
constructor(accessToken: string) {
|
||||
@@ -8,7 +8,7 @@ export class FindEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async byId(externalId: string, options: ExternalIdOptions): Promise<FindResult> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<FindResult>(`/find/${externalId}?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring from 'querystring';
|
||||
import { BelongingMovies, Keyword, KeywordsOptions } from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
const BASE_Keyword = '/keyword';
|
||||
|
||||
@@ -14,7 +14,7 @@ export class KeywordsEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async belongingMovies(keywordId : number, options?: KeywordsOptions): Promise<BelongingMovies> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<BelongingMovies>(`${BASE_Keyword}/${keywordId}/movies?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,16 @@ import {
|
||||
ExternalIds,
|
||||
Images,
|
||||
Keywords,
|
||||
LanguageOption,
|
||||
LatestMovie,
|
||||
MovieChanges,
|
||||
MovieDetails,
|
||||
MovieLists,
|
||||
MoviesPlayingNow,
|
||||
PageOption,
|
||||
PopularMovies,
|
||||
Recommendations,
|
||||
RegionOption,
|
||||
ReleaseDates,
|
||||
Reviews,
|
||||
SimilarMovies,
|
||||
@@ -21,7 +24,7 @@ import {
|
||||
Videos,
|
||||
WatchProviders,
|
||||
} from '../types';
|
||||
import querystring from 'querystring';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
const BASE_MOVIE = '/movie';
|
||||
|
||||
@@ -39,7 +42,7 @@ export class MoviesEndpoint extends BaseEndpoint{
|
||||
}
|
||||
|
||||
async changes(id: number, options?: ChangeOptions): Promise<MovieChanges>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<MovieChanges>(`${BASE_MOVIE}/${id}/changes?${params}`);
|
||||
}
|
||||
|
||||
@@ -59,13 +62,13 @@ export class MoviesEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<Keywords>(`${BASE_MOVIE}/${id}/keywords`);
|
||||
}
|
||||
|
||||
async lists(id: number, options?: {page?: number}): Promise<MovieLists>{
|
||||
const params = querystring.encode(options);
|
||||
async lists(id: number, options?: LanguageOption | PageOption): Promise<MovieLists>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<MovieLists>(`${BASE_MOVIE}/${id}/lists?${params}`);
|
||||
}
|
||||
|
||||
async recommendations(id: number, options?: {page?: number}): Promise<Recommendations>{
|
||||
const params = querystring.encode(options);
|
||||
async recommendations(id: number, options?: PageOption): Promise<Recommendations>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Recommendations>(`${BASE_MOVIE}/${id}/recommendations?${params}`);
|
||||
}
|
||||
|
||||
@@ -73,13 +76,13 @@ export class MoviesEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<ReleaseDates>(`${BASE_MOVIE}/${id}/release_dates`);
|
||||
}
|
||||
|
||||
async reviews(id: number, options?: {page?: number}): Promise<Reviews>{
|
||||
const params = querystring.encode(options);
|
||||
async reviews(id: number, options?: PageOption): Promise<Reviews>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Reviews>(`${BASE_MOVIE}/${id}/reviews?${params}`);
|
||||
}
|
||||
|
||||
async similar(id: number, options?: {page?: number}): Promise<SimilarMovies>{
|
||||
const params = querystring.encode(options);
|
||||
async similar(id: number, options?: PageOption): Promise<SimilarMovies>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<SimilarMovies>(`${BASE_MOVIE}/${id}/similar?${params}`);
|
||||
}
|
||||
|
||||
@@ -103,23 +106,23 @@ export class MoviesEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<LatestMovie>(`${BASE_MOVIE}/latest`);
|
||||
}
|
||||
|
||||
async nowPlaying(options?: {page?: number, region?: string, language?: string}): Promise<MoviesPlayingNow>{
|
||||
const params = querystring.encode(options);
|
||||
async nowPlaying(options?: PageOption & LanguageOption & RegionOption): Promise<MoviesPlayingNow>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<MoviesPlayingNow>(`${BASE_MOVIE}/now_playing?${params}`);
|
||||
}
|
||||
|
||||
async popular(options?: {page?: number}): Promise<PopularMovies>{
|
||||
const params = querystring.encode(options);
|
||||
async popular(options?: PageOption): Promise<PopularMovies>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<PopularMovies>(`${BASE_MOVIE}/popular?${params}`);
|
||||
}
|
||||
|
||||
async topRated(options?: {page?: number, region?: string, language?: string}): Promise<TopRatedMovies>{
|
||||
const params = querystring.encode(options);
|
||||
async topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedMovies>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TopRatedMovies>(`${BASE_MOVIE}/top_rated?${params}`);
|
||||
}
|
||||
|
||||
async upcoming(options?: {page?: number, region?: string, language?: string}): Promise<UpcomingMovies>{
|
||||
const params = querystring.encode(options);
|
||||
async upcoming(options?: PageOption & LanguageOption & RegionOption): Promise<UpcomingMovies>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<UpcomingMovies>(`${BASE_MOVIE}/upcoming?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
import { ChangeOptions, ExternalIds, Image, PeopleTranslations, PersonChanges, PersonCombinedCredits, PersonDetail, PersonMovieCredit, PersonTvShowCredit, PopularPersons, TaggedImages } from '../types';
|
||||
import {
|
||||
ChangeOptions,
|
||||
ExternalIds,
|
||||
Image,
|
||||
PageOption,
|
||||
PeopleTranslations,
|
||||
PersonChanges,
|
||||
PersonCombinedCredits,
|
||||
PersonDetail,
|
||||
PersonMovieCredit,
|
||||
PersonTvShowCredit,
|
||||
PopularPersons,
|
||||
TaggedImages
|
||||
} from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring from 'querystring';
|
||||
|
||||
const BASE_PERSON = '/person';
|
||||
|
||||
|
||||
export class PeopleEndpoint extends BaseEndpoint {
|
||||
constructor(accessToken: string) {
|
||||
super(accessToken);
|
||||
@@ -15,7 +27,7 @@ export class PeopleEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async changes(id: number, options? : ChangeOptions): Promise<PersonChanges> {
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<PersonChanges>(`${BASE_PERSON}/${id}/changes?${params}`);
|
||||
}
|
||||
|
||||
@@ -39,8 +51,8 @@ export class PeopleEndpoint extends BaseEndpoint {
|
||||
return await this.api.get<{id: number, profiles: Image[]}>(`${BASE_PERSON}/${id}/images`)
|
||||
}
|
||||
|
||||
async taggedImages(id: number, options?: {page?: number}): Promise<TaggedImages>{
|
||||
const params = querystring.encode(options);
|
||||
async taggedImages(id: number, options?: PageOption): Promise<TaggedImages>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TaggedImages>(`${BASE_PERSON}/${id}/tagged_images?${params}`);
|
||||
}
|
||||
|
||||
@@ -52,8 +64,8 @@ export class PeopleEndpoint extends BaseEndpoint {
|
||||
return await this.api.get<PersonDetail>(`${BASE_PERSON}/latest`);
|
||||
}
|
||||
|
||||
async popular(options?: {page?: number}): Promise<PopularPersons>{
|
||||
const params = querystring.encode(options);
|
||||
async popular(options?: PageOption): Promise<PopularPersons>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<PopularPersons>(`${BASE_PERSON}/popular?${params}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { BaseEndpoint } from './base';
|
||||
import querystring, { ParsedUrlQueryInput } from 'querystring';
|
||||
import { Search } from '../types/search';
|
||||
import { Collection, Company, Movie, Person, TV } from '../types';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
const BASE_SEARCH = '/search';
|
||||
|
||||
export interface SearchOptions extends ParsedUrlQueryInput {
|
||||
export interface SearchOptions {
|
||||
query: string;
|
||||
page?: number;
|
||||
}
|
||||
@@ -31,35 +31,34 @@ export class SearchEndpoint extends BaseEndpoint {
|
||||
}
|
||||
|
||||
async companies(options: SearchOptions): Promise<Search<Company>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<Company>>(`${BASE_SEARCH}/company?${params}`);
|
||||
}
|
||||
|
||||
async collections(options: SearchOptions): Promise<Search<Collection>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<Collection>>(`${BASE_SEARCH}/collection?${params}`);
|
||||
}
|
||||
|
||||
async keywords(options: SearchOptions): Promise<Search<{ id: string, name: string }>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<{ id: string, name: string }>>(`${BASE_SEARCH}/keyword?${params}`);
|
||||
}
|
||||
|
||||
async movies(options: MovieSearchOptions): Promise<Search<Movie>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<Movie>>(`${BASE_SEARCH}/movie?${params}`);
|
||||
}
|
||||
|
||||
async people(options: PeopleSearchOptions): Promise<Search<Person>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<Person>>(`${BASE_SEARCH}/person?${params}`);
|
||||
}
|
||||
|
||||
// TODO: Multi search
|
||||
|
||||
async tvShows(options: TvSearchOptions): Promise<Search<TV>>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Search<TV>>(`${BASE_SEARCH}/tv?${params}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,10 +8,13 @@ import {
|
||||
ExternalIds,
|
||||
Images,
|
||||
Keywords,
|
||||
LanguageOption,
|
||||
LatestTvShows,
|
||||
OnTheAir,
|
||||
PageOption,
|
||||
PopularTvShows,
|
||||
Recommendations,
|
||||
RegionOption,
|
||||
Reviews,
|
||||
ScreenedTheatrically,
|
||||
SeasonDetails,
|
||||
@@ -24,7 +27,7 @@ import {
|
||||
Videos,
|
||||
WatchProviders,
|
||||
} from '../types';
|
||||
import querystring from 'querystring';
|
||||
import { parseOptions } from '../utils';
|
||||
|
||||
const BASE_TV = '/tv';
|
||||
|
||||
@@ -42,7 +45,7 @@ export class TvShowsEndpoint extends BaseEndpoint{
|
||||
}
|
||||
|
||||
async changes(id: number, options?: ChangeOptions): Promise<TvShowChanges>{
|
||||
const params = querystring.encode(options);
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TvShowChanges>(`${BASE_TV}/${id}/changes?${params}`);
|
||||
}
|
||||
|
||||
@@ -74,13 +77,13 @@ export class TvShowsEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<Keywords>(`${BASE_TV}/${id}/keywords`);
|
||||
}
|
||||
|
||||
async recommendations(id: number, options?: {page?: number}): Promise<Recommendations>{
|
||||
const params = querystring.encode(options);
|
||||
async recommendations(id: number, options?: PageOption): Promise<Recommendations>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Recommendations>(`${BASE_TV}/${id}/recommendations?${params}`);
|
||||
}
|
||||
|
||||
async reviews(id: number, options?: {page?: number}): Promise<Reviews>{
|
||||
const params = querystring.encode(options);
|
||||
async reviews(id: number, options?: PageOption): Promise<Reviews>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<Reviews>(`${BASE_TV}/${id}/reviews?${params}`);
|
||||
}
|
||||
|
||||
@@ -88,8 +91,8 @@ export class TvShowsEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<ScreenedTheatrically>(`${BASE_TV}/${id}/screened_theatrically`);
|
||||
}
|
||||
|
||||
async similar(id: number, options?: {page?: number}): Promise<SimilarTvShows>{
|
||||
const params = querystring.encode(options);
|
||||
async similar(id: number, options?: PageOption): Promise<SimilarTvShows>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<SimilarTvShows>(`${BASE_TV}/${id}/similar?${params}`);
|
||||
}
|
||||
|
||||
@@ -117,21 +120,18 @@ export class TvShowsEndpoint extends BaseEndpoint{
|
||||
return await this.api.get<OnTheAir>(`${BASE_TV}/on_the_air`);
|
||||
}
|
||||
|
||||
async airingToday(options?: {page?: number, region?: string, language?: string}): Promise<TvShowsAiringToday>{
|
||||
const params = querystring.encode(options);
|
||||
async airingToday(options?: PageOption & LanguageOption & RegionOption): Promise<TvShowsAiringToday>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TvShowsAiringToday>(`${BASE_TV}/airing_today?${params}`);
|
||||
}
|
||||
|
||||
async popular(options?: {page?: number}): Promise<PopularTvShows>{
|
||||
const params = querystring.encode(options);
|
||||
async popular(options?: PageOption & LanguageOption & RegionOption): Promise<PopularTvShows>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<PopularTvShows>(`${BASE_TV}/popular?${params}`);
|
||||
}
|
||||
|
||||
async topRated(options?: {page?: number, region?: string, language?: string}): Promise<TopRatedTvShows>{
|
||||
const params = querystring.encode(options);
|
||||
async topRated(options?: PageOption & LanguageOption & RegionOption): Promise<TopRatedTvShows>{
|
||||
const params = parseOptions(options);
|
||||
return await this.api.get<TopRatedTvShows>(`${BASE_TV}/top_rated?${params}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { ParsedUrlQueryInput } from 'querystring';
|
||||
|
||||
export interface Change {
|
||||
id: number;
|
||||
adult: boolean | undefined;
|
||||
@@ -12,7 +10,7 @@ export interface Changes{
|
||||
total_results: number;
|
||||
}
|
||||
|
||||
export interface ChangeOptions extends ParsedUrlQueryInput {
|
||||
export interface ChangeOptions {
|
||||
end_date?: string;
|
||||
start_date?: string;
|
||||
page?: number;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ParsedUrlQueryInput } from 'querystring';
|
||||
import { Episode, Media, MediaType, Movie, Person, Season, TV } from '.';
|
||||
|
||||
export type ExternalSource =
|
||||
@@ -11,7 +10,7 @@ export type ExternalSource =
|
||||
| 'twitter_id'
|
||||
| 'instagram_id';
|
||||
|
||||
export interface ExternalIdOptions extends ParsedUrlQueryInput {
|
||||
export interface ExternalIdOptions {
|
||||
external_source: ExternalSource;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ParsedUrlQueryInput } from 'querystring';
|
||||
import { Movie } from '.';
|
||||
|
||||
export interface KeywordsOptions extends ParsedUrlQueryInput {
|
||||
export interface KeywordsOptions {
|
||||
include_adult?: boolean;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { ParsedUrlQueryInput } from 'querystring';
|
||||
|
||||
export interface LanguageOption extends ParsedUrlQueryInput {
|
||||
language?: string;
|
||||
export interface LanguageOption {
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export interface PageOption extends ParsedUrlQueryInput {
|
||||
page?: number;
|
||||
export interface RegionOption {
|
||||
region?: string;
|
||||
}
|
||||
|
||||
export interface PageOption {
|
||||
page?: number;
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from './getImagePath';
|
||||
export * from './parseOptions';
|
||||
|
||||
7
src/utils/parseOptions.ts
Normal file
7
src/utils/parseOptions.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function parseOptions(
|
||||
options?: { [s: string]: any },
|
||||
): string {
|
||||
return options
|
||||
? new URLSearchParams(Object.entries(options)).toString()
|
||||
: '';
|
||||
}
|
||||
Reference in New Issue
Block a user