@nuintun/buffer 0.2.3 → 0.2.5

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.
package/cjs/Binary.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/cjs/enum.d.cts CHANGED
@@ -8,7 +8,7 @@ export declare const enum SizeOf {
8
8
  UINT16 = 2,
9
9
  INT32 = 4,
10
10
  UINT32 = 4,
11
- INI64 = 8,
11
+ INT64 = 8,
12
12
  UINT64 = 8,
13
13
  FLOAT32 = 4,
14
14
  FLOAT64 = 8
package/cjs/errors.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/cjs/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -268,15 +268,15 @@ class Buffer {
268
268
  }
269
269
  /**
270
270
  * @method writeInt64
271
- * @description 在缓冲区中写入一个无符号的 64 位有符号整数
271
+ * @description 在缓冲区中写入一个 64 位有符号整数
272
272
  * @param {bigint} value 要写入的 32 位有符号整数
273
273
  * @param {boolean} [littleEndian] 是否为小端字节序
274
274
  */
275
275
  writeInt64(value, littleEndian) {
276
- this.#alloc(8 /* SizeOf.INI64 */);
276
+ this.#alloc(8 /* SizeOf.INT64 */);
277
277
  this.#dataView.setBigInt64(this.#offset, value, littleEndian);
278
- this.#grow(8 /* SizeOf.INI64 */);
279
- this.#seek(8 /* SizeOf.INI64 */);
278
+ this.#grow(8 /* SizeOf.INT64 */);
279
+ this.#seek(8 /* SizeOf.INT64 */);
280
280
  }
281
281
  /**
282
282
  * @method writeUint64
@@ -414,9 +414,9 @@ class Buffer {
414
414
  * @returns {bigint} 介于 -9223372036854775808 和 9223372036854775807 之间的 64 位有符号整数
415
415
  */
416
416
  readInt64(littleEndian) {
417
- this.#assertRead(8 /* SizeOf.INI64 */);
417
+ this.#assertRead(8 /* SizeOf.INT64 */);
418
418
  const value = this.#dataView.getBigInt64(this.#offset, littleEndian);
419
- this.#seek(8 /* SizeOf.INI64 */);
419
+ this.#seek(8 /* SizeOf.INT64 */);
420
420
  return value;
421
421
  }
422
422
  /**
package/cjs/index.d.cts CHANGED
@@ -122,7 +122,7 @@ export declare class Buffer {
122
122
  writeUint32(value: number, littleEndian?: boolean): void;
123
123
  /**
124
124
  * @method writeInt64
125
- * @description 在缓冲区中写入一个无符号的 64 位有符号整数
125
+ * @description 在缓冲区中写入一个 64 位有符号整数
126
126
  * @param {bigint} value 要写入的 32 位有符号整数
127
127
  * @param {boolean} [littleEndian] 是否为小端字节序
128
128
  */
package/cjs/utils.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/esm/Binary.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/esm/enum.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const enum SizeOf {
8
8
  UINT16 = 2,
9
9
  INT32 = 4,
10
10
  UINT32 = 4,
11
- INI64 = 8,
11
+ INT64 = 8,
12
12
  UINT64 = 8,
13
13
  FLOAT32 = 4,
14
14
  FLOAT64 = 8
package/esm/errors.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/esm/index.d.ts CHANGED
@@ -122,7 +122,7 @@ export declare class Buffer {
122
122
  writeUint32(value: number, littleEndian?: boolean): void;
123
123
  /**
124
124
  * @method writeInt64
125
- * @description 在缓冲区中写入一个无符号的 64 位有符号整数
125
+ * @description 在缓冲区中写入一个 64 位有符号整数
126
126
  * @param {bigint} value 要写入的 32 位有符号整数
127
127
  * @param {boolean} [littleEndian] 是否为小端字节序
128
128
  */
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
@@ -266,15 +266,15 @@ class Buffer {
266
266
  }
267
267
  /**
268
268
  * @method writeInt64
269
- * @description 在缓冲区中写入一个无符号的 64 位有符号整数
269
+ * @description 在缓冲区中写入一个 64 位有符号整数
270
270
  * @param {bigint} value 要写入的 32 位有符号整数
271
271
  * @param {boolean} [littleEndian] 是否为小端字节序
272
272
  */
273
273
  writeInt64(value, littleEndian) {
274
- this.#alloc(8 /* SizeOf.INI64 */);
274
+ this.#alloc(8 /* SizeOf.INT64 */);
275
275
  this.#dataView.setBigInt64(this.#offset, value, littleEndian);
276
- this.#grow(8 /* SizeOf.INI64 */);
277
- this.#seek(8 /* SizeOf.INI64 */);
276
+ this.#grow(8 /* SizeOf.INT64 */);
277
+ this.#seek(8 /* SizeOf.INT64 */);
278
278
  }
279
279
  /**
280
280
  * @method writeUint64
@@ -412,9 +412,9 @@ class Buffer {
412
412
  * @returns {bigint} 介于 -9223372036854775808 和 9223372036854775807 之间的 64 位有符号整数
413
413
  */
414
414
  readInt64(littleEndian) {
415
- this.#assertRead(8 /* SizeOf.INI64 */);
415
+ this.#assertRead(8 /* SizeOf.INT64 */);
416
416
  const value = this.#dataView.getBigInt64(this.#offset, littleEndian);
417
- this.#seek(8 /* SizeOf.INI64 */);
417
+ this.#seek(8 /* SizeOf.INT64 */);
418
418
  return value;
419
419
  }
420
420
  /**
package/esm/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @package @nuintun/buffer
3
3
  * @license MIT
4
- * @version 0.2.3
4
+ * @version 0.2.5
5
5
  * @author nuintun <nuintun@qq.com>
6
6
  * @description A buffer tool for javascript.
7
7
  * @see https://github.com/nuintun/Buffer#readme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuintun/buffer",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "A buffer tool for javascript.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -31,20 +31,6 @@
31
31
  "url": "https://github.com/nuintun/Buffer/issues"
32
32
  },
33
33
  "homepage": "https://github.com/nuintun/Buffer#readme",
34
- "scripts": {
35
- "lint": "tsc --noEmit",
36
- "test": "node tests/index.js",
37
- "clean": "node tools/clean.js",
38
- "prepublishOnly": "npm run build",
39
- "build:cjs": "rollup -c tools/rollup.cjs.js",
40
- "build:esm": "rollup -c tools/rollup.esm.js",
41
- "build:fix-types": "node tools/fix-types.js",
42
- "build:tests": "rollup -c tools/rollup.tests.js",
43
- "build:examples": "rollup -c tools/rollup.examples.js",
44
- "format": "prettier --write . --ignore-path .prettierignore",
45
- "build:main": "npm run build:cjs && npm run build:esm && npm run build:fix-types",
46
- "build": "npm run clean && npm run build:main && npm run build:tests && npm run build:examples && npm run format"
47
- },
48
34
  "dependencies": {
49
35
  "tslib": "^2.8.1"
50
36
  },
@@ -55,7 +41,20 @@
55
41
  "magic-string": "^0.30.17",
56
42
  "prettier": "^3.5.3",
57
43
  "rimraf": "^6.0.1",
58
- "rollup": "^4.39.0",
44
+ "rollup": "^4.40.2",
59
45
  "typescript": "^5.8.3"
46
+ },
47
+ "scripts": {
48
+ "lint": "tsc --noEmit",
49
+ "test": "node tests/index.js",
50
+ "clean": "node tools/clean.js",
51
+ "build:cjs": "rollup -c tools/rollup.cjs.js",
52
+ "build:esm": "rollup -c tools/rollup.esm.js",
53
+ "build:fix-types": "node tools/fix-types.js",
54
+ "build:tests": "rollup -c tools/rollup.tests.js",
55
+ "build:examples": "rollup -c tools/rollup.examples.js",
56
+ "format": "prettier --write . --ignore-path .prettierignore",
57
+ "build:main": "pnpm build:cjs && pnpm build:esm && pnpm build:fix-types",
58
+ "build": "pnpm clean && pnpm build:main && pnpm build:tests && pnpm build:examples && pnpm format"
60
59
  }
61
- }
60
+ }