From 80ae7c454ab3e04d1826067abbbd19f21a4c37ad Mon Sep 17 00:00:00 2001 From: James Prevett Date: Tue, 10 Dec 2024 14:50:49 -0600 Subject: [PATCH] Fixed `DateView` length issue --- eslint.shared.js | 8 ++++---- src/struct.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eslint.shared.js b/eslint.shared.js index 61c4919..9249176 100644 --- a/eslint.shared.js +++ b/eslint.shared.js @@ -46,10 +46,10 @@ export default function (tsconfigRootDir) { '@typescript-eslint/consistent-type-imports': 'warn', '@typescript-eslint/no-unnecessary-type-assertion': 'warn', '@typescript-eslint/require-await': 'warn', - '@typescript-eslint/no-unsafe-return': 'warn', - '@typescript-eslint/no-unsafe-assignment': 'warn', - '@typescript-eslint/no-unsafe-member-access': 'warn', - '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-redundant-type-constituents': 'warn', '@typescript-eslint/no-unsafe-call': 'warn', '@typescript-eslint/restrict-plus-operands': 'off', diff --git a/src/struct.ts b/src/struct.ts index 875a3b0..eb82799 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -133,7 +133,7 @@ export function deserialize(instance: unknown, _buffer: ArrayBufferLike | ArrayB const buffer = _buffer instanceof Uint8Array ? _buffer : new Uint8Array('buffer' in _buffer ? _buffer.buffer : _buffer); - const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteOffset + buffer.byteLength); + const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); for (const [name, { type, offset, length }] of members) { for (let i = 0; i < (length || 1); i++) {