@@ -17,7 +17,7 @@ function getBitsInline(
1717
1818 // Fast path for single bit (common in huffman)
1919 if ( numBits === 1 ) {
20- const val = ( data [ bytePosition ] ! >> bitPosition ) & 1
20+ const val = ( data [ bytePosition ] >> bitPosition ) & 1
2121 bitPosition -= 1
2222 if ( bitPosition < 0 ) {
2323 bytePosition += 1
@@ -32,7 +32,7 @@ function getBitsInline(
3232 let val = 0
3333 for ( let i = 0 ; i < numBits ; i ++ ) {
3434 val <<= 1
35- val |= ( data [ bytePosition ] ! >> bitPosition ) & 1
35+ val |= ( data [ bytePosition ] >> bitPosition ) & 1
3636 bitPosition -= 1
3737 if ( bitPosition < 0 ) {
3838 bytePosition += 1
@@ -87,7 +87,7 @@ export default class HuffmanIntCodec extends CramCodec<
8787 // degenerate zero-length huffman code: special-case the decoding.
8888 // empty codeBook (no codes at all) is also valid for unused data series;
8989 // decode() will throw 'Huffman symbol not found' if such a codec is used.
90- if ( this . sortedCodes . length > 0 && this . sortedCodes [ 0 ] ! . bitLength === 0 ) {
90+ if ( this . sortedCodes . length > 0 && this . sortedCodes [ 0 ] . bitLength === 0 ) {
9191 this . _decode = this . _decodeZeroLengthCode
9292 }
9393 }
@@ -99,8 +99,8 @@ export default class HuffmanIntCodec extends CramCodec<
9999 )
100100 for ( let i = 0 ; i < this . parameters . numCodes ; i ++ ) {
101101 codes [ i ] = {
102- symbol : this . parameters . symbols [ i ] ! ,
103- bitLength : this . parameters . bitLengths [ i ] ! ,
102+ symbol : this . parameters . symbols [ i ] ,
103+ bitLength : this . parameters . bitLengths [ i ] ,
104104 }
105105 }
106106 // sort the codes by bit length and symbol value
@@ -113,7 +113,7 @@ export default class HuffmanIntCodec extends CramCodec<
113113 if ( ! this . codeBook [ code . bitLength ] ) {
114114 this . codeBook [ code . bitLength ] = [ ]
115115 }
116- this . codeBook [ code . bitLength ] ! . push ( code . symbol )
116+ this . codeBook [ code . bitLength ] . push ( code . symbol )
117117 } )
118118 }
119119
@@ -159,7 +159,7 @@ export default class HuffmanIntCodec extends CramCodec<
159159
160160 this . bitCodeToValue = new Array ( maxBitCode + 1 ) . fill ( - 1 )
161161 for ( let i = 0 ; i < this . sortedBitCodes . length ; i += 1 ) {
162- this . bitCodeToValue [ this . sortedCodes [ i ] ! . bitCode ] = i
162+ this . bitCodeToValue [ this . sortedCodes [ i ] . bitCode ] = i
163163 }
164164 }
165165
@@ -178,7 +178,7 @@ export default class HuffmanIntCodec extends CramCodec<
178178
179179 // the special case for zero-length codes
180180 _decodeZeroLengthCode ( ) {
181- return this . sortedCodes [ 0 ] ! . value
181+ return this . sortedCodes [ 0 ] . value
182182 }
183183
184184 _decode ( _slice : CramSlice , coreDataBlock : CramFileBlock , coreCursor : Cursor ) {
@@ -187,22 +187,22 @@ export default class HuffmanIntCodec extends CramCodec<
187187 let prevLen = 0
188188 let bits = 0
189189 for ( let i = 0 ; i < this . sortedCodes . length ; i += 1 ) {
190- const length = this . sortedCodes [ i ] ! . bitLength
190+ const length = this . sortedCodes [ i ] . bitLength
191191 const bitsToRead = length - prevLen
192192 if ( bitsToRead > 0 ) {
193193 bits <<= bitsToRead
194194 bits |= getBitsInline ( input , coreCursor , bitsToRead )
195195 }
196196 prevLen = length
197197 {
198- const index = this . bitCodeToValue [ bits ] !
198+ const index = this . bitCodeToValue [ bits ]
199199 if ( index > - 1 && this . sortedBitLengthsByBitCode [ index ] === length ) {
200- return this . sortedValuesByBitCode [ index ] !
200+ return this . sortedValuesByBitCode [ index ]
201201 }
202202
203203 for (
204204 let j = i ;
205- this . sortedCodes [ j + 1 ] ! . bitLength === length &&
205+ this . sortedCodes [ j + 1 ] . bitLength === length &&
206206 j < this . sortedCodes . length ;
207207 j += 1
208208 ) {
0 commit comments