Comparing version 5.0.4 to 5.1.0
@@ -247,2 +247,18 @@ import { decode, encode } from './utf8'; | ||
/** | ||
* Read a 64-bit signed integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigInt64() { | ||
const value = this._data.getBigInt64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigUint64() { | ||
const value = this._data.getBigUint64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 1-byte ASCII character and move pointer forward by 1 byte. | ||
@@ -382,2 +398,24 @@ */ | ||
/** | ||
* Write `value` as a 64-bit signed bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigInt64(value) { | ||
this.ensureAvailable(8); | ||
this._data.setBigInt64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigUint64(value) { | ||
this.ensureAvailable(8); | ||
this._data.setBigUint64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write the charCode of `str`'s first character as an 8-bit unsigned integer | ||
@@ -384,0 +422,0 @@ * and move pointer forward by 1 byte. |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ // eslint-disable-next-line import/no-unassigned-import |
@@ -0,0 +0,0 @@ import { TextDecoder, TextEncoder } from 'util'; |
@@ -159,2 +159,10 @@ /// <reference types="node" /> | ||
/** | ||
* Read a 64-bit signed integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigInt64(): bigint; | ||
/** | ||
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigUint64(): bigint; | ||
/** | ||
* Read a 1-byte ASCII character and move pointer forward by 1 byte. | ||
@@ -226,2 +234,12 @@ */ | ||
/** | ||
* Write `value` as a 64-bit signed bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigInt64(value: bigint): this; | ||
/** | ||
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigUint64(value: bigint): this; | ||
/** | ||
* Write the charCode of `str`'s first character as an 8-bit unsigned integer | ||
@@ -228,0 +246,0 @@ * and move pointer forward by 1 byte. |
@@ -250,2 +250,18 @@ "use strict"; | ||
/** | ||
* Read a 64-bit signed integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigInt64() { | ||
const value = this._data.getBigInt64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes. | ||
*/ | ||
readBigUint64() { | ||
const value = this._data.getBigUint64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 1-byte ASCII character and move pointer forward by 1 byte. | ||
@@ -385,2 +401,24 @@ */ | ||
/** | ||
* Write `value` as a 64-bit signed bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigInt64(value) { | ||
this.ensureAvailable(8); | ||
this._data.setBigInt64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
writeBigUint64(value) { | ||
this.ensureAvailable(8); | ||
this._data.setBigUint64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write the charCode of `str`'s first character as an 8-bit unsigned integer | ||
@@ -387,0 +425,0 @@ * and move pointer forward by 1 byte. |
@@ -0,0 +0,0 @@ "use strict"; |
import './text-encoding-polyfill'; | ||
export declare function decode(bytes: Uint8Array): string; | ||
export declare function encode(str: string): Uint8Array; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare function decode(bytes: Uint8Array): string; | ||
export declare function encode(str: string): Uint8Array; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "iobuffer", | ||
"version": "5.0.4", | ||
"version": "5.1.0", | ||
"description": "Read and write binary data on ArrayBuffers", | ||
@@ -42,12 +42,12 @@ "main": "./lib/IOBuffer.js", | ||
"devDependencies": { | ||
"@types/jest": "^27.0.2", | ||
"@types/node": "^16.10.3", | ||
"eslint": "^7.32.0", | ||
"eslint-config-cheminfo-typescript": "^9.0.0", | ||
"jest": "^27.2.5", | ||
"prettier": "^2.4.1", | ||
"@types/jest": "^27.0.3", | ||
"@types/node": "^17.0.0", | ||
"eslint": "^8.4.1", | ||
"eslint-config-cheminfo-typescript": "^10.3.0", | ||
"jest": "^27.4.5", | ||
"prettier": "^2.5.1", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^27.0.5", | ||
"typescript": "^4.4.3" | ||
"ts-jest": "^27.1.2", | ||
"typescript": "^4.5.4" | ||
} | ||
} |
@@ -317,2 +317,20 @@ import { decode, encode } from './utf8'; | ||
/** | ||
* Read a 64-bit signed integer number and move pointer forward by 8 bytes. | ||
*/ | ||
public readBigInt64(): bigint { | ||
const value = this._data.getBigInt64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes. | ||
*/ | ||
public readBigUint64(): bigint { | ||
const value = this._data.getBigUint64(this.offset, this.littleEndian); | ||
this.offset += 8; | ||
return value; | ||
} | ||
/** | ||
* Read a 1-byte ASCII character and move pointer forward by 1 byte. | ||
@@ -466,2 +484,26 @@ */ | ||
/** | ||
* Write `value` as a 64-bit signed bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
public writeBigInt64(value: bigint): this { | ||
this.ensureAvailable(8); | ||
this._data.setBigInt64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8 | ||
* bytes. | ||
*/ | ||
public writeBigUint64(value: bigint): this { | ||
this.ensureAvailable(8); | ||
this._data.setBigUint64(this.offset, value, this.littleEndian); | ||
this.offset += 8; | ||
this._updateLastWrittenByte(); | ||
return this; | ||
} | ||
/** | ||
* Write the charCode of `str`'s first character as an 8-bit unsigned integer | ||
@@ -468,0 +510,0 @@ * and move pointer forward by 1 byte. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
113557
28
2298
1