@jsprismarine/jsbinaryutils
Advanced tools
@@ -18,3 +18,3 @@ /// <reference types="node" /> | ||
| */ | ||
| write(buf: Buffer): void; | ||
| write(buf: Uint8Array): void; | ||
| /** | ||
@@ -21,0 +21,0 @@ * Reads an unsigned byte (0 to 255). |
+4
-21
@@ -23,7 +23,2 @@ "use strict"; | ||
| } | ||
| /** | ||
| * Appends a buffer to the main buffer. | ||
| * | ||
| * @param buf | ||
| */ | ||
| write(buf) { | ||
@@ -311,7 +306,4 @@ this.binary.push(...buf); | ||
| writeFloat(v) { | ||
| // TODO: IEEE754 | ||
| this.doWriteAssertions(v, -3.4028234663852886e38, +3.4028234663852886e38); | ||
| const buf = Buffer.allocUnsafe(4); | ||
| buf.writeFloatBE(v); | ||
| this.write(buf); | ||
| this.write(new Uint8Array(new Float32Array([v]).buffer).reverse()); | ||
| } | ||
@@ -331,7 +323,4 @@ /** | ||
| writeFloatLE(v) { | ||
| // TODO: IEEE754 | ||
| this.doWriteAssertions(v, -3.4028234663852886e38, +3.4028234663852886e38); | ||
| const buf = Buffer.allocUnsafe(4); | ||
| buf.writeFloatLE(v); | ||
| this.write(buf); | ||
| this.write(new Uint8Array(new Float32Array([v]).buffer)); | ||
| } | ||
@@ -351,7 +340,4 @@ /** | ||
| writeDouble(v) { | ||
| // TODO: IEE765 | ||
| this.doWriteAssertions(v, -1.7976931348623157e308, +1.7976931348623157e308); | ||
| const buf = Buffer.allocUnsafe(8); | ||
| buf.writeDoubleBE(v); | ||
| this.write(buf); | ||
| this.write(new Uint8Array(new Float64Array([v]).buffer).reverse()); | ||
| } | ||
@@ -371,7 +357,4 @@ /** | ||
| writeDoubleLE(v) { | ||
| // TODO: IEE765 | ||
| this.doWriteAssertions(v, -1.7976931348623157e308, +1.7976931348623157e308); | ||
| const buf = Buffer.allocUnsafe(8); | ||
| buf.writeDoubleBE(v); | ||
| this.write(buf); | ||
| this.write(new Uint8Array(new Float64Array([v]).buffer)); | ||
| } | ||
@@ -378,0 +361,0 @@ /** |
+1
-1
| { | ||
| "name": "@jsprismarine/jsbinaryutils", | ||
| "version": "3.1.9", | ||
| "version": "3.2.0", | ||
| "description": "Basic binary data managing tool written in TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/BinaryStream.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%29153
-1.25%951
-1.76%