File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ export const E_STRICT_UNICODE = 'Input is not well-formed Unicode'
1010let isNative = ( x ) => x && ( haveNativeBuffer || `${ x } ` . includes ( '[native code]' ) )
1111if ( ! haveNativeBuffer && isNative ( ( ) => { } ) ) isNative = ( ) => false // e.g. XS, we don't want false positives
1212
13- export const nativeEncoder = isNative ( TextEncoder ) ? new TextEncoder ( ) : null
14- export const nativeDecoder = isNative ( TextDecoder )
15- ? new TextDecoder ( 'utf-8' , { ignoreBOM : true } )
16- : null
13+ export const nativeEncoder = /* @__PURE__ */ ( ( ) =>
14+ isNative ( TextEncoder ) ? new TextEncoder ( ) : null ) ( )
15+ export const nativeDecoder = /* @__PURE__ */ ( ( ) =>
16+ isNative ( TextDecoder ) ? new TextDecoder ( 'utf-8' , { ignoreBOM : true } ) : null ) ( )
1717
1818// Actually windows-1252, compatible with ascii and latin1 decoding
1919// Beware that on non-latin1, i.e. on windows-1252, this is broken in ~all Node.js versions released
Original file line number Diff line number Diff line change 99 skipWeb ,
1010} from './_utils.js'
1111
12- const { atob } = globalThis
13- const { toBase64 : web64 } = Uint8Array . prototype
12+ const atob = /* @__PURE__ */ ( ( ) => globalThis . atob ) ( )
13+ const web64 = /* @__PURE__ */ ( ( ) => Uint8Array . prototype . toBase64 ) ( )
1414
1515// See http://stackoverflow.com/a/22747272/680742, which says that lowest limit is in Chrome, with 0xffff args
1616// On Hermes, actual max is 0x20_000 minus current stack depth, 1/16 of that should be safe
@@ -147,7 +147,7 @@ export function encodeAsciiPrefix(x, s) {
147147export const encodeLatin1 = ( str ) => encodeCharcodes ( str , new Uint8Array ( str . length ) )
148148
149149// Expects nativeEncoder to be present
150- const useEncodeInto = isHermes && nativeEncoder ?. encodeInto
150+ const useEncodeInto = /* @__PURE__ */ ( ( ) => isHermes && nativeEncoder ?. encodeInto ) ( )
151151export const encodeAscii = useEncodeInto
152152 ? ( str , ERR ) => {
153153 // Much faster in Hermes
You can’t perform that action at this time.
0 commit comments