@gmod/cram 5.0.3 → 5.0.4

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.
@@ -1 +1,8 @@
1
- declare const Stream: () => void;
1
+ export default class Stream {
2
+ readByte(): void;
3
+ read(buffer: any, bufOffset: any, length: any): number;
4
+ writeByte(_byte: any): void;
5
+ seek(new_pos: any): void;
6
+ write(buffer: any, bufOffset: any, length: any): any;
7
+ flush(): void;
8
+ }
@@ -1,41 +1,37 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
- /// * very simple input/output stream interface */
4
- const Stream = function () { };
5
- // input streams //////////////
6
- /** Returns the next byte, or -1 for EOF. */
7
- Stream.prototype.readByte = function () {
8
- throw new Error('abstract method readByte() not implemented');
9
- };
10
- /** Attempts to fill the buffer; returns number of bytes read, or
11
- * -1 for EOF. */
12
- Stream.prototype.read = function (buffer, bufOffset, length) {
13
- let bytesRead = 0;
14
- while (bytesRead < length) {
15
- const c = this.readByte();
16
- if (c < 0) {
17
- // EOF
18
- return bytesRead === 0 ? -1 : bytesRead;
4
+ class Stream {
5
+ readByte() {
6
+ throw new Error('abstract method readByte() not implemented');
7
+ }
8
+ read(buffer, bufOffset, length) {
9
+ let bytesRead = 0;
10
+ while (bytesRead < length) {
11
+ const c = this.readByte();
12
+ if (c < 0) {
13
+ // EOF
14
+ return bytesRead === 0 ? -1 : bytesRead;
15
+ }
16
+ buffer[bufOffset++] = c;
17
+ bytesRead++;
19
18
  }
20
- buffer[bufOffset++] = c;
21
- bytesRead++;
19
+ return bytesRead;
20
+ }
21
+ writeByte(_byte) {
22
+ throw new Error('abstract method readByte() not implemented');
22
23
  }
23
- return bytesRead;
24
- };
25
- Stream.prototype.seek = function (new_pos) {
26
- throw new Error('abstract method seek() not implemented');
27
- };
28
- // output streams ///////////
29
- Stream.prototype.writeByte = function (_byte) {
30
- throw new Error('abstract method readByte() not implemented');
31
- };
32
- Stream.prototype.write = function (buffer, bufOffset, length) {
33
- let i;
34
- for (i = 0; i < length; i++) {
35
- this.writeByte(buffer[bufOffset++]);
24
+ seek(new_pos) {
25
+ throw new Error('abstract method seek() not implemented');
26
+ }
27
+ write(buffer, bufOffset, length) {
28
+ let i;
29
+ for (i = 0; i < length; i++) {
30
+ this.writeByte(buffer[bufOffset++]);
31
+ }
32
+ return length;
36
33
  }
37
- return length;
38
- };
39
- Stream.prototype.flush = function () { };
40
- module.exports = Stream;
34
+ flush() { }
35
+ }
36
+ exports.default = Stream;
41
37
  //# sourceMappingURL=stream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/seek-bzip/stream.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,kDAAkD;AAClD,MAAM,MAAM,GAAG,cAAa,CAAC,CAAA;AAE7B,+BAA+B;AAC/B,4CAA4C;AAC5C,MAAM,CAAC,SAAS,CAAC,QAAQ,GAAG;IAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;AAC/D,CAAC,CAAA;AACD;kBACkB;AAClB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,MAAM,EAAE,SAAS,EAAE,MAAM;IACzD,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,OAAO,SAAS,GAAG,MAAM,EAAE,CAAC;QAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QACzB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,MAAM;YACN,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACzC,CAAC;QACD,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;QACvB,SAAS,EAAE,CAAA;IACb,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AACD,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,OA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AC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,SAAS,CAAC,KAAK;QACb,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IACD,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC3D,CAAC;IACD,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM;QAC7B,IAAI,CAAC,CAAA;QACL,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;QACrC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,KAAK,KAAI,CAAC;CACX;AA/BD,yBA+BC"}
@@ -1 +1,8 @@
1
- declare const Stream: () => void;
1
+ export default class Stream {
2
+ readByte(): void;
3
+ read(buffer: any, bufOffset: any, length: any): number;
4
+ writeByte(_byte: any): void;
5
+ seek(new_pos: any): void;
6
+ write(buffer: any, bufOffset: any, length: any): any;
7
+ flush(): void;
8
+ }
@@ -1,41 +1,34 @@
1
- "use strict";
2
1
  // @ts-nocheck
3
- /// * very simple input/output stream interface */
4
- const Stream = function () { };
5
- // input streams //////////////
6
- /** Returns the next byte, or -1 for EOF. */
7
- Stream.prototype.readByte = function () {
8
- throw new Error('abstract method readByte() not implemented');
9
- };
10
- /** Attempts to fill the buffer; returns number of bytes read, or
11
- * -1 for EOF. */
12
- Stream.prototype.read = function (buffer, bufOffset, length) {
13
- let bytesRead = 0;
14
- while (bytesRead < length) {
15
- const c = this.readByte();
16
- if (c < 0) {
17
- // EOF
18
- return bytesRead === 0 ? -1 : bytesRead;
2
+ export default class Stream {
3
+ readByte() {
4
+ throw new Error('abstract method readByte() not implemented');
5
+ }
6
+ read(buffer, bufOffset, length) {
7
+ let bytesRead = 0;
8
+ while (bytesRead < length) {
9
+ const c = this.readByte();
10
+ if (c < 0) {
11
+ // EOF
12
+ return bytesRead === 0 ? -1 : bytesRead;
13
+ }
14
+ buffer[bufOffset++] = c;
15
+ bytesRead++;
19
16
  }
20
- buffer[bufOffset++] = c;
21
- bytesRead++;
17
+ return bytesRead;
18
+ }
19
+ writeByte(_byte) {
20
+ throw new Error('abstract method readByte() not implemented');
22
21
  }
23
- return bytesRead;
24
- };
25
- Stream.prototype.seek = function (new_pos) {
26
- throw new Error('abstract method seek() not implemented');
27
- };
28
- // output streams ///////////
29
- Stream.prototype.writeByte = function (_byte) {
30
- throw new Error('abstract method readByte() not implemented');
31
- };
32
- Stream.prototype.write = function (buffer, bufOffset, length) {
33
- let i;
34
- for (i = 0; i < length; i++) {
35
- this.writeByte(buffer[bufOffset++]);
22
+ seek(new_pos) {
23
+ throw new Error('abstract method seek() not implemented');
24
+ }
25
+ write(buffer, bufOffset, length) {
26
+ let i;
27
+ for (i = 0; i < length; i++) {
28
+ this.writeByte(buffer[bufOffset++]);
29
+ }
30
+ return length;
36
31
  }
37
- return length;
38
- };
39
- Stream.prototype.flush = function () { };
40
- module.exports = Stream;
32
+ flush() { }
33
+ }
41
34
  //# sourceMappingURL=stream.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/seek-bzip/stream.ts"],"names":[],"mappings":";AAAA,cAAc;AACd,kDAAkD;AAClD,MAAM,MAAM,GAAG,cAAa,CAAC,CAAA;AAE7B,+BAA+B;AAC/B,4CAA4C;AAC5C,MAAM,CAAC,SAAS,CAAC,QAAQ,GAAG;IAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;AAC/D,CAAC,CAAA;AACD;kBACkB;AAClB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,MAAM,EAAE,SAAS,EAAE,MAAM;IACzD,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,OAAO,SAAS,GAAG,MAAM,EAAE,CAAC;QAC1B,MAAM,CAAC,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E,MAAM;QAC5B,IAAI,SAAS,GAAG,CAAC,CAAA;QACjB,OAAO,SAAS,GAAG,MAAM,EAAE,CAAC;YAC1B,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;YACzB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACV,MAAM;gBACN,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACzC,CAAC;YACD,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAA;YACvB,SAAS,EAAE,CAAA;QACb,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,SAAS,CAAC,KAAK;QACb,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IACD,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC3D,CAAC;IACD,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM;QAC7B,IAAI,CAAC,CAAA;QACL,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;QACrC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,KAAK,KAAI,CAAC;CACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmod/cram",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "read CRAM files with pure Javascript",
5
5
  "license": "MIT",
6
6
  "repository": "GMOD/cram-js",
@@ -1,42 +1,33 @@
1
1
  // @ts-nocheck
2
- /// * very simple input/output stream interface */
3
- const Stream = function () {}
4
-
5
- // input streams //////////////
6
- /** Returns the next byte, or -1 for EOF. */
7
- Stream.prototype.readByte = function () {
8
- throw new Error('abstract method readByte() not implemented')
9
- }
10
- /** Attempts to fill the buffer; returns number of bytes read, or
11
- * -1 for EOF. */
12
- Stream.prototype.read = function (buffer, bufOffset, length) {
13
- let bytesRead = 0
14
- while (bytesRead < length) {
15
- const c = this.readByte()
16
- if (c < 0) {
17
- // EOF
18
- return bytesRead === 0 ? -1 : bytesRead
2
+ export default class Stream {
3
+ readByte() {
4
+ throw new Error('abstract method readByte() not implemented')
5
+ }
6
+ read(buffer, bufOffset, length) {
7
+ let bytesRead = 0
8
+ while (bytesRead < length) {
9
+ const c = this.readByte()
10
+ if (c < 0) {
11
+ // EOF
12
+ return bytesRead === 0 ? -1 : bytesRead
13
+ }
14
+ buffer[bufOffset++] = c
15
+ bytesRead++
19
16
  }
20
- buffer[bufOffset++] = c
21
- bytesRead++
17
+ return bytesRead
22
18
  }
23
- return bytesRead
24
- }
25
- Stream.prototype.seek = function (new_pos) {
26
- throw new Error('abstract method seek() not implemented')
27
- }
28
-
29
- // output streams ///////////
30
- Stream.prototype.writeByte = function (_byte) {
31
- throw new Error('abstract method readByte() not implemented')
32
- }
33
- Stream.prototype.write = function (buffer, bufOffset, length) {
34
- let i
35
- for (i = 0; i < length; i++) {
36
- this.writeByte(buffer[bufOffset++])
19
+ writeByte(_byte) {
20
+ throw new Error('abstract method readByte() not implemented')
21
+ }
22
+ seek(new_pos) {
23
+ throw new Error('abstract method seek() not implemented')
24
+ }
25
+ write(buffer, bufOffset, length) {
26
+ let i
27
+ for (i = 0; i < length; i++) {
28
+ this.writeByte(buffer[bufOffset++])
29
+ }
30
+ return length
37
31
  }
38
- return length
32
+ flush() {}
39
33
  }
40
- Stream.prototype.flush = function () {}
41
-
42
- module.exports = Stream