Skip to content

Commit da7efb8

Browse files
Use base64 from firebase/util
1 parent d51d6bf commit da7efb8

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

packages/firestore/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@firebase/webchannel-wrapper": "0.2.41",
6060
"@grpc/grpc-js": "0.8.1",
6161
"@grpc/proto-loader": "^0.5.0",
62-
"js-base64": "2.5.2",
6362
"tslib": "1.11.1"
6463
},
6564
"peerDependencies": {
@@ -70,7 +69,6 @@
7069
"@firebase/app-exp": "0.x",
7170
"@firebase/app-types-exp": "0.x",
7271
"@types/json-stable-stringify": "1.0.32",
73-
"@types/js-base64": "2.3.1",
7472
"json-stable-stringify": "1.0.1",
7573
"protobufjs": "6.9.0",
7674
"rollup": "2.7.6",

packages/firestore/src/platform_rn/rn_platform.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@
1616
*/
1717

1818
import { BrowserPlatform } from '../platform_browser/browser_platform';
19-
import { Base64 } from 'js-base64';
19+
import { base64 } from '@firebase/util';
2020

2121
// Implements the Platform API for ReactNative.
2222
export class ReactNativePlatform extends BrowserPlatform {
2323
readonly base64Available = true;
2424

2525
atob(encoded: string): string {
26-
return Base64.decode(encoded);
26+
// WebSafe uses a different URL-encoding safe alphabet that doesn't match
27+
// the encoding used on the backend.
28+
return base64.decodeString(encoded, /* webSafe =*/ false);
2729
}
2830

2931
btoa(raw: string): string {
30-
return Base64.encode(raw);
32+
// WebSafe uses a different URL-encoding safe alphabet that doesn't match
33+
// the encoding used on the backend.
34+
return base64.encodeString(raw, /* webSafe =*/ false);
3135
}
3236
}

yarn.lock

-10
Original file line numberDiff line numberDiff line change
@@ -2130,11 +2130,6 @@
21302130
"@types/minimatch" "*"
21312131
"@types/node" "*"
21322132

2133-
2134-
version "2.3.1"
2135-
resolved "https://registry.npmjs.org/@types/js-base64/-/js-base64-2.3.1.tgz#c39f14f129408a3d96a1105a650d8b2b6eeb4168"
2136-
integrity sha512-4RKbhIDGC87s4EBy2Cp2/5S2O6kmCRcZnD5KRCq1q9z2GhBte1+BdsfVKCpG8yKpDGNyEE2G6IqFIh6W2YwWPA==
2137-
21382133
"@types/json-schema@^7.0.3":
21392134
version "7.0.4"
21402135
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
@@ -8735,11 +8730,6 @@ jquery@^3.4.1:
87358730
resolved "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
87368731
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
87378732

8738-
8739-
version "2.5.2"
8740-
resolved "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"
8741-
integrity sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==
8742-
87438733
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
87448734
version "4.0.0"
87458735
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"

0 commit comments

Comments
 (0)