mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
Fix URLSearchParams usage for react-native
This commit is contained in:
9
src/utils/native.ts
Normal file
9
src/utils/native.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const isReactNative = () => {
|
||||
try {
|
||||
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
||||
require('react-native');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
@@ -1,5 +0,0 @@
|
||||
export function createSearchParams(params: { [key: string]: string | number }): string {
|
||||
return Object.entries(params)
|
||||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
||||
.join('&');
|
||||
}
|
Reference in New Issue
Block a user