@@ -128,8 +128,8 @@ function _decodeFixedVec (value: TypeDef, type: string, _: string, count: number
128128
129129 assert ( index !== - 1 , ( ) => `${ type } : Unable to extract location of ';'` ) ;
130130
131- const vecType = type . substr ( 1 , index - 1 ) ;
132- const [ strLength , displayName ] = type . substr ( index + 1 , max - index - 1 ) . split ( ';' ) ;
131+ const vecType = type . substring ( 1 , index ) ;
132+ const [ strLength , displayName ] = type . substring ( index + 1 , max ) . split ( ';' ) ;
133133 const length = parseInt ( strLength . trim ( ) , 10 ) ;
134134
135135 // as a first round, only u8 via u8aFixed, we can add more support
@@ -154,7 +154,7 @@ function _decodeTuple (value: TypeDef, _: string, subType: string, count: number
154154// decode a Int/UInt<bitLength[, name]>
155155// eslint-disable-next-line @typescript-eslint/no-unused-vars
156156function _decodeAnyInt ( value : TypeDef , type : string , _ : string , clazz : 'Int' | 'UInt' ) : TypeDef {
157- const [ strLength , displayName ] = type . substr ( clazz . length + 1 , type . length - clazz . length - 1 - 1 ) . split ( ',' ) ;
157+ const [ strLength , displayName ] = type . substring ( clazz . length + 1 , type . length - 1 ) . split ( ',' ) ;
158158 const length = parseInt ( strLength . trim ( ) , 10 ) ;
159159
160160 // as a first round, only u8 via u8aFixed, we can add more support
@@ -178,13 +178,13 @@ function _decodeUInt (value: TypeDef, type: string, subType: string): TypeDef {
178178function _decodeDoNotConstruct ( value : TypeDef , type : string , _ : string ) : TypeDef {
179179 const NAME_LENGTH = 'DoNotConstruct' . length ;
180180
181- value . displayName = type . substr ( NAME_LENGTH + 1 , type . length - NAME_LENGTH - 1 - 1 ) ;
181+ value . displayName = type . substring ( NAME_LENGTH + 1 , type . length - 1 ) ;
182182
183183 return value ;
184184}
185185
186186function hasWrapper ( type : string , [ start , end ] : [ string , string , TypeDefInfo , any ?] ) : boolean {
187- return ( type . substr ( 0 , start . length ) === start ) && ( type . substr ( - 1 * end . length ) === end ) ;
187+ return ( type . substring ( 0 , start . length ) === start ) && ( type . slice ( - 1 * end . length ) === end ) ;
188188}
189189
190190const nestedExtraction : [ string , string , TypeDefInfo , ( value : TypeDef , type : string , subType : string , count : number ) => TypeDef ] [ ] = [
@@ -213,7 +213,7 @@ const wrappedExtraction: [string, string, TypeDefInfo][] = [
213213] ;
214214
215215function extractSubType ( type : string , [ start , end ] : [ string , string , TypeDefInfo , any ?] ) : string {
216- return type . substr ( start . length , type . length - start . length - end . length ) ;
216+ return type . substring ( start . length , type . length - end . length ) ;
217217}
218218
219219// eslint-disable-next-line @typescript-eslint/ban-types
0 commit comments