Skip to content

Commit 667342b

Browse files
committed
chore: suggestions
1 parent 176e57b commit 667342b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ try {
188188

189189
## React Native
190190

191-
BSON vendors the required polyfills for `TextEncoder`, `TextDecoder`, `atob`, `btoa` when using React Native. One
192-
additional polyfill, `crypto.getRandomValues` is required and can be installed with the following command:
191+
BSON vendors the required polyfills for `TextEncoder`, `TextDecoder`, `atob`, `btoa` imported from React Native and therefore doesn't expect users to polyfill these. One additional polyfill, `crypto.getRandomValues` is recommended and can be installed with the following command:
193192

194193
```sh
195194
npm install --save react-native-get-random-values

etc/rollup/rollup-plugin-require-vendor/require_vendor.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import MagicString from 'magic-string';
22

3-
const REQUIRE_TEXT_ENCODING =
3+
const REQUIRE_POLYFILLS =
44
`const { TextEncoder, TextDecoder } = require('../vendor/text-encoding');
55
const { encode: btoa, decode: atob } = require('../vendor/base64');\n`
66

@@ -20,7 +20,7 @@ export class RequireVendor {
2020

2121
// MagicString lets us edit the source code and still generate an accurate source map
2222
const magicString = new MagicString(code);
23-
magicString.prepend(REQUIRE_TEXT_ENCODING);
23+
magicString.prepend(REQUIRE_POLYFILLS);
2424

2525
return {
2626
code: magicString.toString(),

0 commit comments

Comments
 (0)