File tree Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 6161 "packageManager" : " pnpm@7.17.0" ,
6262 "dependencies" : {
6363 "bson" : " ^4.7.2" ,
64- "byte -base64" : " ^1.1.0 " ,
64+ "js -base64" : " ^3.7.5 " ,
6565 "lodash.clonedeep" : " ^4.5.0" ,
6666 "lz4js" : " ^0.2.0"
6767 },
Original file line number Diff line number Diff line change 11import { EJSON } from 'bson' ;
2- import { base64ToBytes } from 'byte -base64' ;
2+ import { Base64 } from 'js -base64' ;
33import { decompress } from 'lz4js' ;
44
55export type ParseTypeGuardFunction < T > = ( obj : any ) => obj is T ;
@@ -165,7 +165,7 @@ function unminifyKeys(
165165export function decompressString ( str : string ) : string {
166166 try {
167167 return new TextDecoder ( ) . decode (
168- Uint8Array . from ( decompress ( base64ToBytes ( str ) ) )
168+ Uint8Array . from ( decompress ( Base64 . toUint8Array ( str ) ) )
169169 ) ;
170170 } catch ( err : unknown ) {
171171 // str is not a base64 encoded string of a byte array
Original file line number Diff line number Diff line change 11import { EJSON } from 'bson' ;
2- import { bytesToBase64 } from 'byte -base64' ;
2+ import { Base64 } from 'js -base64' ;
33import cloneDeep from 'lodash.clonedeep' ;
44import { compress } from 'lz4js' ;
55import {
@@ -251,5 +251,7 @@ function minifyKeys(
251251}
252252
253253export function compressString ( str : string ) : string {
254- return bytesToBase64 ( compress ( new TextEncoder ( ) . encode ( str ) ) ) ;
254+ return Base64 . fromUint8Array (
255+ compress ( new TextEncoder ( ) . encode ( str ) ) as Uint8Array
256+ ) ;
255257}
You can’t perform that action at this time.
0 commit comments