@@ -17,7 +17,7 @@ import {
1717import { AccountMap } from '../collections/custom-key-map'
1818import { MAX_BOX_SIZE } from '../constants'
1919import { lazyContext } from '../context-helpers/internal-context'
20- import { GenericTypeInfo , getEncoder } from '../encoders'
20+ import { getEncoder , TypeInfo } from '../encoders'
2121import { getGenericTypeInfo } from '../runtime-helpers'
2222import { asBytes , asBytesCls , asNumber , asUint8Array , conactUint8Arrays , toBytes } from '../util'
2323
@@ -131,7 +131,7 @@ export class BoxCls<TValue> {
131131
132132 private get fromBytes ( ) {
133133 const typeInfo = getGenericTypeInfo ( this )
134- const valueType = ( typeInfo ! . genericArgs ! as GenericTypeInfo [ ] ) [ 0 ]
134+ const valueType = ( typeInfo ! . genericArgs ! as TypeInfo [ ] ) [ 0 ]
135135 return ( val : Uint8Array ) => getEncoder < TValue > ( valueType ) ( val , valueType )
136136 }
137137
@@ -199,7 +199,7 @@ export class BoxMapCls<TKey, TValue> {
199199
200200 private get fromBytes ( ) {
201201 const typeInfo = getGenericTypeInfo ( this )
202- const valueType = ( typeInfo ! . genericArgs ! as GenericTypeInfo [ ] ) [ 1 ]
202+ const valueType = ( typeInfo ! . genericArgs ! as TypeInfo [ ] ) [ 1 ]
203203 return ( val : Uint8Array ) => getEncoder < TValue > ( valueType ) ( val , valueType )
204204 }
205205
@@ -320,7 +320,7 @@ export class BoxRefCls {
320320 if ( this . exists ) {
321321 return false
322322 }
323- this . backingValue = new Uint8Array ( Array ( size ) . fill ( 0 ) )
323+ this . backingValue = new Uint8Array ( size )
324324 return true
325325 }
326326
@@ -354,7 +354,7 @@ export class BoxRefCls {
354354 if ( updatedContent . length > content . length ) {
355355 updatedContent = updatedContent . slice ( 0 , content . length )
356356 } else if ( updatedContent . length < content . length ) {
357- updatedContent = conactUint8Arrays ( updatedContent , new Uint8Array ( Array ( content . length - updatedContent . length ) . fill ( 0 ) ) )
357+ updatedContent = conactUint8Arrays ( updatedContent , new Uint8Array ( content . length - updatedContent . length ) )
358358 }
359359 this . backingValue = updatedContent
360360 }
@@ -404,7 +404,7 @@ export class BoxRefCls {
404404 }
405405 let updatedContent
406406 if ( newSizeNumber > content . length ) {
407- updatedContent = conactUint8Arrays ( content , new Uint8Array ( Array ( newSizeNumber - content . length ) . fill ( 0 ) ) )
407+ updatedContent = conactUint8Arrays ( content , new Uint8Array ( newSizeNumber - content . length ) )
408408 } else {
409409 updatedContent = content . slice ( 0 , newSize )
410410 }
0 commit comments