@gmod/cram 4.0.10 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +6 -6
  2. package/dist/craiIndex.d.ts +1 -1
  3. package/dist/craiIndex.js +7 -7
  4. package/dist/craiIndex.js.map +1 -1
  5. package/dist/cram-bundle.js +1 -2
  6. package/dist/cramFile/codecs/_base.d.ts +3 -3
  7. package/dist/cramFile/codecs/beta.d.ts +5 -5
  8. package/dist/cramFile/codecs/beta.js +7 -7
  9. package/dist/cramFile/codecs/beta.js.map +1 -1
  10. package/dist/cramFile/codecs/byteArrayLength.d.ts +5 -5
  11. package/dist/cramFile/codecs/byteArrayLength.js +4 -4
  12. package/dist/cramFile/codecs/byteArrayLength.js.map +1 -1
  13. package/dist/cramFile/codecs/byteArrayStop.d.ts +5 -5
  14. package/dist/cramFile/codecs/byteArrayStop.js +7 -7
  15. package/dist/cramFile/codecs/byteArrayStop.js.map +1 -1
  16. package/dist/cramFile/codecs/dataSeriesTypes.d.ts +1 -1
  17. package/dist/cramFile/codecs/external.d.ts +5 -5
  18. package/dist/cramFile/codecs/external.js +12 -11
  19. package/dist/cramFile/codecs/external.js.map +1 -1
  20. package/dist/cramFile/codecs/gamma.d.ts +5 -5
  21. package/dist/cramFile/codecs/gamma.js +8 -8
  22. package/dist/cramFile/codecs/gamma.js.map +1 -1
  23. package/dist/cramFile/codecs/huffman.d.ts +6 -6
  24. package/dist/cramFile/codecs/huffman.js +9 -9
  25. package/dist/cramFile/codecs/huffman.js.map +1 -1
  26. package/dist/cramFile/codecs/index.d.ts +3 -3
  27. package/dist/cramFile/codecs/index.js +16 -16
  28. package/dist/cramFile/codecs/index.js.map +1 -1
  29. package/dist/cramFile/codecs/subexp.d.ts +5 -5
  30. package/dist/cramFile/codecs/subexp.js +9 -9
  31. package/dist/cramFile/codecs/subexp.js.map +1 -1
  32. package/dist/cramFile/container/compressionScheme.d.ts +4 -4
  33. package/dist/cramFile/container/compressionScheme.js +5 -5
  34. package/dist/cramFile/container/compressionScheme.js.map +1 -1
  35. package/dist/cramFile/container/index.d.ts +8 -8
  36. package/dist/cramFile/container/index.js +15 -16
  37. package/dist/cramFile/container/index.js.map +1 -1
  38. package/dist/cramFile/file.d.ts +3 -3
  39. package/dist/cramFile/file.js +29 -35
  40. package/dist/cramFile/file.js.map +1 -1
  41. package/dist/cramFile/index.d.ts +2 -2
  42. package/dist/cramFile/index.js +4 -4
  43. package/dist/cramFile/index.js.map +1 -1
  44. package/dist/cramFile/record.d.ts +2 -2
  45. package/dist/cramFile/record.js +17 -17
  46. package/dist/cramFile/record.js.map +1 -1
  47. package/dist/cramFile/sectionParsers.d.ts +3 -3
  48. package/dist/cramFile/sectionParsers.js +56 -56
  49. package/dist/cramFile/sectionParsers.js.map +1 -1
  50. package/dist/cramFile/slice/decodeRecord.d.ts +6 -6
  51. package/dist/cramFile/slice/decodeRecord.js +17 -17
  52. package/dist/cramFile/slice/decodeRecord.js.map +1 -1
  53. package/dist/cramFile/slice/index.d.ts +5 -5
  54. package/dist/cramFile/slice/index.js +46 -52
  55. package/dist/cramFile/slice/index.js.map +1 -1
  56. package/dist/htscodecs/arith_gen.d.ts +1 -1
  57. package/dist/htscodecs/arith_gen.js +17 -17
  58. package/dist/htscodecs/arith_gen.js.map +1 -1
  59. package/dist/htscodecs/fqzcomp.js +10 -10
  60. package/dist/htscodecs/fqzcomp.js.map +1 -1
  61. package/dist/htscodecs/index.js +6 -6
  62. package/dist/htscodecs/index.js.map +1 -1
  63. package/dist/htscodecs/rans.js +2 -2
  64. package/dist/htscodecs/rans.js.map +1 -1
  65. package/dist/htscodecs/rans4x16.js +7 -7
  66. package/dist/htscodecs/rans4x16.js.map +1 -1
  67. package/dist/htscodecs/tok3.js +9 -9
  68. package/dist/htscodecs/tok3.js.map +1 -1
  69. package/dist/index.d.ts +3 -3
  70. package/dist/index.js +7 -7
  71. package/dist/index.js.map +1 -1
  72. package/dist/indexedCramFile.d.ts +4 -4
  73. package/dist/indexedCramFile.js +5 -5
  74. package/dist/indexedCramFile.js.map +1 -1
  75. package/dist/{io/index.js → io.js} +1 -1
  76. package/dist/io.js.map +1 -0
  77. package/dist/rans/d04.js +28 -28
  78. package/dist/rans/d04.js.map +1 -1
  79. package/dist/rans/d14.js +16 -16
  80. package/dist/rans/d14.js.map +1 -1
  81. package/dist/rans/decoding.js +8 -8
  82. package/dist/rans/decoding.js.map +1 -1
  83. package/dist/rans/frequencies.js +15 -15
  84. package/dist/rans/frequencies.js.map +1 -1
  85. package/dist/rans/index.js +17 -17
  86. package/dist/rans/index.js.map +1 -1
  87. package/esm/craiIndex.d.ts +1 -1
  88. package/esm/craiIndex.js +3 -3
  89. package/esm/craiIndex.js.map +1 -1
  90. package/esm/cramFile/codecs/_base.d.ts +3 -3
  91. package/esm/cramFile/codecs/beta.d.ts +5 -5
  92. package/esm/cramFile/codecs/beta.js +4 -4
  93. package/esm/cramFile/codecs/beta.js.map +1 -1
  94. package/esm/cramFile/codecs/byteArrayLength.d.ts +5 -5
  95. package/esm/cramFile/codecs/byteArrayLength.js +2 -2
  96. package/esm/cramFile/codecs/byteArrayLength.js.map +1 -1
  97. package/esm/cramFile/codecs/byteArrayStop.d.ts +5 -5
  98. package/esm/cramFile/codecs/byteArrayStop.js +4 -4
  99. package/esm/cramFile/codecs/byteArrayStop.js.map +1 -1
  100. package/esm/cramFile/codecs/dataSeriesTypes.d.ts +1 -1
  101. package/esm/cramFile/codecs/external.d.ts +5 -5
  102. package/esm/cramFile/codecs/external.js +8 -7
  103. package/esm/cramFile/codecs/external.js.map +1 -1
  104. package/esm/cramFile/codecs/gamma.d.ts +5 -5
  105. package/esm/cramFile/codecs/gamma.js +4 -4
  106. package/esm/cramFile/codecs/gamma.js.map +1 -1
  107. package/esm/cramFile/codecs/huffman.d.ts +6 -6
  108. package/esm/cramFile/codecs/huffman.js +5 -5
  109. package/esm/cramFile/codecs/huffman.js.map +1 -1
  110. package/esm/cramFile/codecs/index.d.ts +3 -3
  111. package/esm/cramFile/codecs/index.js +8 -8
  112. package/esm/cramFile/codecs/index.js.map +1 -1
  113. package/esm/cramFile/codecs/subexp.d.ts +5 -5
  114. package/esm/cramFile/codecs/subexp.js +4 -4
  115. package/esm/cramFile/codecs/subexp.js.map +1 -1
  116. package/esm/cramFile/container/compressionScheme.d.ts +4 -4
  117. package/esm/cramFile/container/compressionScheme.js +2 -2
  118. package/esm/cramFile/container/compressionScheme.js.map +1 -1
  119. package/esm/cramFile/container/index.d.ts +8 -8
  120. package/esm/cramFile/container/index.js +5 -6
  121. package/esm/cramFile/container/index.js.map +1 -1
  122. package/esm/cramFile/file.d.ts +3 -3
  123. package/esm/cramFile/file.js +11 -17
  124. package/esm/cramFile/file.js.map +1 -1
  125. package/esm/cramFile/index.d.ts +2 -2
  126. package/esm/cramFile/index.js +2 -2
  127. package/esm/cramFile/index.js.map +1 -1
  128. package/esm/cramFile/record.d.ts +2 -2
  129. package/esm/cramFile/record.js +1 -1
  130. package/esm/cramFile/record.js.map +1 -1
  131. package/esm/cramFile/sectionParsers.d.ts +3 -3
  132. package/esm/cramFile/sectionParsers.js +1 -1
  133. package/esm/cramFile/sectionParsers.js.map +1 -1
  134. package/esm/cramFile/slice/decodeRecord.d.ts +6 -6
  135. package/esm/cramFile/slice/decodeRecord.js +3 -3
  136. package/esm/cramFile/slice/decodeRecord.js.map +1 -1
  137. package/esm/cramFile/slice/index.d.ts +5 -5
  138. package/esm/cramFile/slice/index.js +18 -24
  139. package/esm/cramFile/slice/index.js.map +1 -1
  140. package/esm/htscodecs/arith_gen.d.ts +1 -1
  141. package/esm/htscodecs/arith_gen.js +4 -4
  142. package/esm/htscodecs/arith_gen.js.map +1 -1
  143. package/esm/htscodecs/fqzcomp.js +3 -3
  144. package/esm/htscodecs/fqzcomp.js.map +1 -1
  145. package/esm/htscodecs/index.js +5 -5
  146. package/esm/htscodecs/index.js.map +1 -1
  147. package/esm/htscodecs/rans.js +1 -1
  148. package/esm/htscodecs/rans.js.map +1 -1
  149. package/esm/htscodecs/rans4x16.js +1 -1
  150. package/esm/htscodecs/rans4x16.js.map +1 -1
  151. package/esm/htscodecs/tok3.js +4 -4
  152. package/esm/htscodecs/tok3.js.map +1 -1
  153. package/esm/index.d.ts +3 -3
  154. package/esm/index.js +3 -3
  155. package/esm/index.js.map +1 -1
  156. package/esm/indexedCramFile.d.ts +4 -4
  157. package/esm/indexedCramFile.js +2 -2
  158. package/esm/indexedCramFile.js.map +1 -1
  159. package/esm/{io/index.js → io.js} +1 -1
  160. package/esm/io.js.map +1 -0
  161. package/esm/rans/d04.js +3 -3
  162. package/esm/rans/d04.js.map +1 -1
  163. package/esm/rans/d14.js +2 -2
  164. package/esm/rans/d14.js.map +1 -1
  165. package/esm/rans/decoding.js +2 -2
  166. package/esm/rans/decoding.js.map +1 -1
  167. package/esm/rans/frequencies.js +3 -3
  168. package/esm/rans/frequencies.js.map +1 -1
  169. package/esm/rans/index.js +5 -5
  170. package/esm/rans/index.js.map +1 -1
  171. package/package.json +15 -9
  172. package/src/craiIndex.ts +4 -4
  173. package/src/cramFile/codecs/_base.ts +3 -3
  174. package/src/cramFile/codecs/beta.ts +8 -8
  175. package/src/cramFile/codecs/byteArrayLength.ts +6 -6
  176. package/src/cramFile/codecs/byteArrayStop.ts +8 -8
  177. package/src/cramFile/codecs/dataSeriesTypes.ts +1 -1
  178. package/src/cramFile/codecs/external.ts +15 -12
  179. package/src/cramFile/codecs/gamma.ts +8 -8
  180. package/src/cramFile/codecs/huffman.ts +8 -8
  181. package/src/cramFile/codecs/index.ts +11 -11
  182. package/src/cramFile/codecs/subexp.ts +8 -8
  183. package/src/cramFile/container/compressionScheme.ts +6 -6
  184. package/src/cramFile/container/index.ts +6 -7
  185. package/src/cramFile/file.ts +12 -18
  186. package/src/cramFile/index.ts +2 -2
  187. package/src/cramFile/record.ts +3 -3
  188. package/src/cramFile/sectionParsers.ts +4 -4
  189. package/src/cramFile/slice/decodeRecord.ts +8 -8
  190. package/src/cramFile/slice/index.ts +23 -29
  191. package/src/htscodecs/arith_gen.ts +5 -5
  192. package/src/htscodecs/fqzcomp.ts +3 -3
  193. package/src/htscodecs/index.ts +5 -5
  194. package/src/htscodecs/rans.ts +1 -1
  195. package/src/htscodecs/rans4x16.ts +1 -1
  196. package/src/htscodecs/tok3.ts +4 -4
  197. package/src/index.ts +3 -3
  198. package/src/indexedCramFile.ts +5 -5
  199. package/src/rans/d04.ts +3 -3
  200. package/src/rans/d14.ts +2 -2
  201. package/src/rans/decoding.ts +2 -2
  202. package/src/rans/frequencies.ts +3 -3
  203. package/src/rans/index.ts +5 -5
  204. package/dist/cram-bundle.js.LICENSE.txt +0 -12
  205. package/dist/io/index.js.map +0 -1
  206. package/esm/io/index.js.map +0 -1
  207. package/src/cramFile/declare.d.ts +0 -1
  208. /package/dist/{io/index.d.ts → io.d.ts} +0 -0
  209. /package/esm/{io/index.d.ts → io.d.ts} +0 -0
  210. /package/src/{io/index.ts → io.ts} +0 -0
@@ -2,22 +2,22 @@ import crc32 from 'crc/calculators/crc32'
2
2
  import QuickLRU from 'quick-lru'
3
3
  import { XzReadableStream } from 'xz-decompress'
4
4
 
5
- import { CramMalformedError, CramUnimplementedError } from '../errors'
6
- import * as htscodecs from '../htscodecs'
7
- import { open } from '../io'
8
- import ransuncompress from '../rans'
9
- import { parseHeaderText } from '../sam'
10
- import { decode } from '../seek-bzip'
11
- import { unzip } from '../unzip'
12
- import CramContainer from './container'
13
- import CramRecord from './record'
5
+ import { CramMalformedError, CramUnimplementedError } from '../errors.ts'
6
+ import * as htscodecs from '../htscodecs/index.ts'
7
+ import { open } from '../io.ts'
8
+ import ransuncompress from '../rans/index.ts'
9
+ import { parseHeaderText } from '../sam.ts'
10
+ import { decode } from '../seek-bzip/index.ts'
11
+ import { unzip } from '../unzip.ts'
12
+ import CramContainer from './container/index.ts'
13
+ import CramRecord from './record.ts'
14
14
  import {
15
15
  BlockHeader,
16
16
  CompressionMethod,
17
17
  cramFileDefinition,
18
18
  getSectionParsers,
19
- } from './sectionParsers'
20
- import { parseItem, tinyMemoize } from './util'
19
+ } from './sectionParsers.ts'
20
+ import { parseItem, tinyMemoize } from './util.ts'
21
21
 
22
22
  import type { GenericFilehandle } from 'generic-filehandle2'
23
23
 
@@ -282,11 +282,7 @@ export default class CramFile {
282
282
  ) {
283
283
  // console.log({ compressionMethod })
284
284
  if (compressionMethod === 'gzip') {
285
- const ret = unzip(inputBuffer)
286
- if (ret[0] === 24) {
287
- // console.log(ret.slice(0, 500).join(','))
288
- }
289
- return ret
285
+ return unzip(inputBuffer)
290
286
  } else if (compressionMethod === 'bzip2') {
291
287
  return decode(inputBuffer)
292
288
  } else if (compressionMethod === 'lzma') {
@@ -298,8 +294,6 @@ export default class CramFile {
298
294
  const outputBuffer = new Uint8Array(uncompressedSize)
299
295
  ransuncompress(inputBuffer, outputBuffer)
300
296
  return outputBuffer
301
- // htscodecs r4x8 is slower, but compatible.
302
- // htscodecs.r4x8_uncompress(inputBuffer, outputBuffer);
303
297
  } else if (compressionMethod === 'rans4x16') {
304
298
  return htscodecs.r4x16_uncompress(inputBuffer)
305
299
  } else if (compressionMethod === 'arith') {
@@ -1,3 +1,3 @@
1
- export { default as CramRecord } from './record'
1
+ export { default as CramRecord } from './record.ts'
2
2
 
3
- export { default } from './file'
3
+ export { default } from './file.ts'
@@ -1,7 +1,7 @@
1
- import Constants from './constants'
2
- import CramContainerCompressionScheme from './container/compressionScheme'
1
+ import Constants from './constants.ts'
2
+ import CramContainerCompressionScheme from './container/compressionScheme.ts'
3
3
 
4
- import type decodeRecord from './slice/decodeRecord'
4
+ import type decodeRecord from './slice/decodeRecord.ts'
5
5
 
6
6
  export interface RefRegion {
7
7
  start: number
@@ -1,7 +1,7 @@
1
- import { TupleOf } from '../typescript'
2
- import { DataSeriesEncodingMap } from './codecs/dataSeriesTypes'
3
- import { CramEncoding } from './encoding'
4
- import { parseItf8, parseLtf8 } from './util'
1
+ import { TupleOf } from '../typescript.ts'
2
+ import { DataSeriesEncodingMap } from './codecs/dataSeriesTypes.ts'
3
+ import { CramEncoding } from './encoding.ts'
4
+ import { parseItf8, parseLtf8 } from './util.ts'
5
5
 
6
6
  export function cramFileDefinition() {
7
7
  return {
@@ -1,18 +1,18 @@
1
- import { CramMalformedError } from '../../errors'
2
- import { Cursors, DataTypeMapping } from '../codecs/_base'
3
- import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes'
1
+ import { CramMalformedError } from '../../errors.ts'
2
+ import { Cursors, DataTypeMapping } from '../codecs/_base.ts'
3
+ import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes.ts'
4
4
  import CramContainerCompressionScheme, {
5
5
  DataSeriesTypes,
6
- } from '../container/compressionScheme'
6
+ } from '../container/compressionScheme.ts'
7
7
  import {
8
8
  BamFlagsDecoder,
9
9
  CramFlagsDecoder,
10
10
  MateFlagsDecoder,
11
11
  ReadFeature,
12
- } from '../record'
13
- import CramSlice, { SliceHeader } from './index'
14
- import { CramFileBlock } from '../file'
15
- import { isMappedSliceHeader } from '../sectionParsers'
12
+ } from '../record.ts'
13
+ import CramSlice, { SliceHeader } from './index.ts'
14
+ import { CramFileBlock } from '../file.ts'
15
+ import { isMappedSliceHeader } from '../sectionParsers.ts'
16
16
 
17
17
  /**
18
18
  * given a Buffer, read a string up to the first null character
@@ -1,20 +1,20 @@
1
- import { CramArgumentError, CramMalformedError } from '../../errors'
2
- import { Cursors, DataTypeMapping } from '../codecs/_base'
3
- import { CramBufferOverrunError } from '../codecs/getBits'
4
- import Constants from '../constants'
5
- import decodeRecord, { DataSeriesDecoder } from './decodeRecord'
6
- import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes'
7
- import CramContainer from '../container'
8
- import { DataSeriesTypes } from '../container/compressionScheme'
9
- import CramFile, { CramFileBlock } from '../file'
10
- import CramRecord from '../record'
1
+ import { CramArgumentError, CramMalformedError } from '../../errors.ts'
2
+ import { Cursors, DataTypeMapping } from '../codecs/_base.ts'
3
+ import { CramBufferOverrunError } from '../codecs/getBits.ts'
4
+ import Constants from '../constants.ts'
5
+ import decodeRecord, { DataSeriesDecoder } from './decodeRecord.ts'
6
+ import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes.ts'
7
+ import { DataSeriesTypes } from '../container/compressionScheme.ts'
8
+ import CramContainer from '../container/index.ts'
9
+ import CramFile, { CramFileBlock } from '../file.ts'
10
+ import CramRecord from '../record.ts'
11
11
  import {
12
12
  MappedSliceHeader,
13
13
  UnmappedSliceHeader,
14
14
  getSectionParsers,
15
15
  isMappedSliceHeader,
16
- } from '../sectionParsers'
17
- import { parseItem, sequenceMD5, tinyMemoize } from '../util'
16
+ } from '../sectionParsers.ts'
17
+ import { parseItem, sequenceMD5, tinyMemoize } from '../util.ts'
18
18
 
19
19
  export type SliceHeader = CramFileBlock & {
20
20
  parsedContent: MappedSliceHeader | UnmappedSliceHeader
@@ -28,15 +28,12 @@ interface RefRegion {
28
28
  }
29
29
 
30
30
  /**
31
- * @private
32
- * Try to estimate the template length from a bunch of interrelated multi-segment reads.
33
- * @param {Array[CramRecord]} allRecords
34
- * @param {number} currentRecordNumber
35
- * @param {CramRecord} thisRecord
31
+ * Try to estimate the template length from a bunch of interrelated
32
+ * multi-segment reads.
36
33
  */
37
34
  function calculateMultiSegmentMatedTemplateLength(
38
35
  allRecords: CramRecord[],
39
- currentRecordNumber: number,
36
+ _currentRecordNumber: number,
40
37
  thisRecord: CramRecord,
41
38
  ) {
42
39
  function getAllMatedRecords(startRecord: CramRecord) {
@@ -73,18 +70,16 @@ function calculateMultiSegmentMatedTemplateLength(
73
70
  }
74
71
 
75
72
  /**
76
- * @private
77
- * Attempt to calculate the `templateLength` for a pair of intra-slice paired reads.
78
- * Ported from htslib. Algorithm is imperfect.
79
- * @param {CramRecord} thisRecord
80
- * @param {CramRecord} mateRecord
73
+ * Attempt to calculate the `templateLength` for a pair of intra-slice paired
74
+ * reads. Ported from htslib. Algorithm is imperfect.
81
75
  */
82
76
  function calculateIntraSliceMatePairTemplateLength(
83
77
  thisRecord: CramRecord,
84
78
  mateRecord: CramRecord,
85
79
  ) {
86
- // this just estimates the template length by using the simple (non-gapped) end coordinate of each
87
- // read, because gapping in the alignment doesn't mean the template is longer or shorter
80
+ // this just estimates the template length by using the simple (non-gapped)
81
+ // end coordinate of each read, because gapping in the alignment doesn't mean
82
+ // the template is longer or shorter
88
83
  const start = Math.min(thisRecord.alignmentStart, mateRecord.alignmentStart)
89
84
  const end = Math.max(
90
85
  thisRecord.alignmentStart + thisRecord.readLength - 1,
@@ -96,10 +91,9 @@ function calculateIntraSliceMatePairTemplateLength(
96
91
  }
97
92
 
98
93
  /**
99
- * @private establishes a mate-pair relationship between two records in the
100
- * same slice. CRAM compresses mate-pair relationships between records in the
101
- * same slice down into just one record having the index in the slice of its
102
- * mate
94
+ * establishes a mate-pair relationship between two records in the same slice.
95
+ * CRAM compresses mate-pair relationships between records in the same slice
96
+ * down into just one record having the index in the slice of its mate
103
97
  */
104
98
  function associateIntraSliceMate(
105
99
  allRecords: CramRecord[],
@@ -34,12 +34,12 @@
34
34
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  */
36
36
 
37
- import { decode } from '../seek-bzip'
37
+ import { decode } from '../seek-bzip/index.ts'
38
38
 
39
- import RangeCoder from './arith_sh'
40
- import ByteModel from './byte_model'
41
- import IOStream from './iostream'
42
- import { concatUint8Array } from '../util'
39
+ import RangeCoder from './arith_sh.ts'
40
+ import ByteModel from './byte_model.ts'
41
+ import IOStream from './iostream.ts'
42
+ import { concatUint8Array } from '../util.ts'
43
43
 
44
44
  const ARITH_ORDER = 1
45
45
  const ARITH_EXT = 4
@@ -34,9 +34,9 @@
34
34
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  */
36
36
 
37
- import RangeCoder from './arith_sh'
38
- import ByteModel from './byte_model'
39
- import IOStream from './iostream'
37
+ import RangeCoder from './arith_sh.ts'
38
+ import ByteModel from './byte_model.ts'
39
+ import IOStream from './iostream.ts'
40
40
 
41
41
  // ----------------------------------------------------------------------
42
42
  // Main arithmetic entry function: decodes a compressed src and
@@ -39,11 +39,11 @@
39
39
  // This JavaScript file is not part of the reference implementation
40
40
  // and is simply and interface to get a consistent interface for cram-js.
41
41
 
42
- import arith from './arith_gen'
43
- import * as fqzcomp from './fqzcomp'
44
- import * as r4x8 from './rans'
45
- import * as r4x16 from './rans4x16'
46
- import * as tok3 from './tok3'
42
+ import arith from './arith_gen.ts'
43
+ import * as fqzcomp from './fqzcomp.ts'
44
+ import * as r4x8 from './rans.ts'
45
+ import * as r4x16 from './rans4x16.ts'
46
+ import * as tok3 from './tok3.ts'
47
47
 
48
48
  export function r4x8_uncompress(inputBuffer: Uint8Array) {
49
49
  return r4x8.decode(inputBuffer)
@@ -34,7 +34,7 @@
34
34
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  */
36
36
 
37
- import IOStream from './iostream'
37
+ import IOStream from './iostream.ts'
38
38
 
39
39
  // ----------------------------------------------------------------------
40
40
  // rANS primitives itself
@@ -34,7 +34,7 @@
34
34
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  */
36
36
 
37
- import IOStream from './iostream'
37
+ import IOStream from './iostream.ts'
38
38
 
39
39
  // ----------------------------------------------------------------------
40
40
  // rANS primitives itself
@@ -40,10 +40,10 @@
40
40
  // written specification as closely as possible. It is *NOT*
41
41
  // an efficient implementation, but see comments below.
42
42
 
43
- import { concatUint8Array } from '../util'
44
- import arith_gen from './arith_gen'
45
- import IOStream from './iostream'
46
- import * as rans from './rans4x16'
43
+ import { concatUint8Array } from '../util.ts'
44
+ import arith_gen from './arith_gen.ts'
45
+ import IOStream from './iostream.ts'
46
+ import * as rans from './rans4x16.ts'
47
47
 
48
48
  const arith = new arith_gen()
49
49
 
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { CramRecord, default as CramFile } from './cramFile'
2
- export { default as CraiIndex } from './craiIndex'
3
- export { default as IndexedCramFile } from './indexedCramFile'
1
+ export { CramRecord, default as CramFile } from './cramFile/index.ts'
2
+ export { default as CraiIndex } from './craiIndex.ts'
3
+ export { default as IndexedCramFile } from './indexedCramFile.ts'
@@ -1,8 +1,8 @@
1
- import { Slice } from './craiIndex'
2
- import CramFile from './cramFile'
3
- import { SeqFetch } from './cramFile/file'
4
- import CramRecord from './cramFile/record'
5
- import { CramUnimplementedError } from './errors'
1
+ import { Slice } from './craiIndex.ts'
2
+ import { SeqFetch } from './cramFile/file.ts'
3
+ import CramFile from './cramFile/index.ts'
4
+ import CramRecord from './cramFile/record.ts'
5
+ import { CramUnimplementedError } from './errors.ts'
6
6
 
7
7
  import type { GenericFilehandle } from 'generic-filehandle2'
8
8
 
package/src/rans/d04.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
- import { CramMalformedError } from '../errors'
3
- import { TF_SHIFT } from './constants'
4
- import Decoding from './decoding'
2
+ import { CramMalformedError } from '../errors.ts'
3
+ import { TF_SHIFT } from './constants.ts'
4
+ import Decoding from './decoding.ts'
5
5
 
6
6
  export default function uncompress(
7
7
  /* ByteBuffer */ input,
package/src/rans/d14.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
- import { TF_SHIFT } from './constants'
3
- import Decoding from './decoding'
2
+ import { TF_SHIFT } from './constants.ts'
3
+ import Decoding from './decoding.ts'
4
4
 
5
5
  export default function uncompress(
6
6
  /* ByteBuffer */ input,
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
- import { CramMalformedError } from '../errors'
3
- import { RANS_BYTE_L } from './constants'
2
+ import { CramMalformedError } from '../errors.ts'
3
+ import { RANS_BYTE_L } from './constants.ts'
4
4
 
5
5
  class FC {
6
6
  // int F, C;
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
- import { CramMalformedError } from '../errors'
3
- import { TOTFREQ } from './constants'
4
- import Decoding from './decoding'
2
+ import { CramMalformedError } from '../errors.ts'
3
+ import { TOTFREQ } from './constants.ts'
4
+ import Decoding from './decoding.ts'
5
5
 
6
6
  function assert(result) {
7
7
  if (!result) {
package/src/rans/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // @ts-nocheck
2
- import { CramMalformedError } from '../errors'
3
- import D04 from './d04'
4
- import D14 from './d14'
5
- import Decoding from './decoding'
6
- import { readStatsO0, readStatsO1 } from './frequencies'
2
+ import { CramMalformedError } from '../errors.ts'
3
+ import D04 from './d04.ts'
4
+ import D14 from './d14.ts'
5
+ import Decoding from './decoding.ts'
6
+ import { readStatsO0, readStatsO1 } from './frequencies.ts'
7
7
 
8
8
  // const /* int */ ORDER_BYTE_LENGTH = 1
9
9
  // const /* int */ COMPRESSED_BYTE_LENGTH = 4
@@ -1,12 +0,0 @@
1
- /*!
2
- * Based on xzwasm (c) Steve Sanderson. License: MIT - https://github.com/SteveSanderson/xzwasm
3
- * Contains xz-embedded by Lasse Collin and Igor Pavlov. License: Public domain - https://tukaani.org/xz/embedded.html
4
- * and walloc (c) 2020 Igalia, S.L. License: MIT - https://github.com/wingo/walloc
5
- */
6
-
7
- /*!
8
- * Determine if an object is a Buffer
9
- *
10
- * @author Feross Aboukhadijeh <https://feross.org>
11
- * @license MIT
12
- */
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;AAqBS,oBAAI;AArBb,6DAA2D;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,gCAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,+BAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAID,2DAA2D;AAAlD,gHAAA,SAAS,OAAA;AAAE,iHAAA,UAAU,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
@@ -1 +0,0 @@
1
- declare module 'seek-bzip'
File without changes
File without changes
File without changes