RobinBobin / react-native-google-drive-api-wrapper

This wrapper facilitates the use of the Google Drive API in React Native projects.
110 stars 43 forks source link

Make tsc with strict mode happy #95

Closed hongqn closed 11 months ago

hongqn commented 11 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

tsc with strict: true reports the following error:

node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/permissions/Permissions.ts(11,40): error TS2322: Type 'object | undefined' is not assignable to type 'object'.
  Type 'undefined' is not assignable to type 'object'.
node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/permissions/Permissions.ts(17,54): error TS2322: Type 'object | undefined' is not assignable to type 'object'.
  Type 'undefined' is not assignable to type 'object'.

Today I used patch-package to patch @robinbobin/react-native-google-drive-api-wrapper@1.2.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/aux/Uris.ts b/node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/aux/Uris.ts
index f9fd8d1..936c9c2 100644
--- a/node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/aux/Uris.ts
+++ b/node_modules/@robinbobin/react-native-google-drive-api-wrapper/api/aux/Uris.ts
@@ -15,7 +15,7 @@ interface FilesParameters {
 interface PermissionsParameters {
   fileId: string
   permissionId?: string
-  queryParameters: object
+  queryParameters?: object
 }

 interface UriParameters {

This issue body was partially generated by patch-package.

RobinBobin commented 11 months ago

Hello there, Thanks a lot for the message and the patch. Could you make another step forward in improving my package and making a PR from your patch, please? I will gladly merge it. Thanks.

RobinBobin commented 11 months ago

Please, increase the version to 1.2.4 if you make a PR πŸ™ .

hongqn commented 11 months ago

Thanks for the quick response. I'll submit a PR :)