File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/firestore/src/util Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1616 */
1717
1818import { randomBytes } from '../platform/random_bytes' ;
19+ import { newTextEncoder } from '../platform/text_serializer' ;
1920
2021import { debugAssert } from './assert' ;
2122
@@ -77,8 +78,8 @@ export interface Equatable<T> {
7778/** Compare strings in UTF-8 encoded byte order */
7879export function compareUtf8Strings ( left : string , right : string ) : number {
7980 // Convert the string to UTF-8 encoded bytes
80- const encodedLeft = new TextEncoder ( ) . encode ( left ) ;
81- const encodedRight = new TextEncoder ( ) . encode ( right ) ;
81+ const encodedLeft = newTextEncoder ( ) . encode ( left ) ;
82+ const encodedRight = newTextEncoder ( ) . encode ( right ) ;
8283
8384 for ( let i = 0 ; i < Math . min ( encodedLeft . length , encodedRight . length ) ; i ++ ) {
8485 const comparison = primitiveComparator ( encodedLeft [ i ] , encodedRight [ i ] ) ;
You can’t perform that action at this time.
0 commit comments