From d63027cb733b376f890629981d27cfef184fc6ba Mon Sep 17 00:00:00 2001 From: Wilian Webber Rech Date: Mon, 5 Jan 2026 20:21:36 -0300 Subject: [PATCH] Bug Fix: Uncaught ReferenceError: require is not defined when converting JSON to SAV --- src/converter/properties/ByteProperty.js | 3 +-- src/converter/properties/Int64Property.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/converter/properties/ByteProperty.js b/src/converter/properties/ByteProperty.js index d159286..0b2776e 100644 --- a/src/converter/properties/ByteProperty.js +++ b/src/converter/properties/ByteProperty.js @@ -1,4 +1,4 @@ -import {getStringByteSize} from "../sav-writer.js"; +import SavWriter, {getStringByteSize} from "../sav-writer.js"; class ByteProperty { static SIZE_ONE = [0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; @@ -40,7 +40,6 @@ class ByteProperty { // backwards compatibility toBytes() { - const SavWriter = require("../sav-writer"); const savWriter = new SavWriter(this.getByteSize()); this.write(savWriter); return savWriter.array; diff --git a/src/converter/properties/Int64Property.js b/src/converter/properties/Int64Property.js index 5c3097c..a541e81 100644 --- a/src/converter/properties/Int64Property.js +++ b/src/converter/properties/Int64Property.js @@ -1,4 +1,4 @@ -import {getStringByteSize} from "../sav-writer.js"; +import SavWriter, {getStringByteSize} from "../sav-writer.js"; class Int64Property { static SIZE_EIGHT = [0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; @@ -35,7 +35,6 @@ class Int64Property { // backwards compatibility toBytes() { - const SavWriter = require("../sav-writer"); const savWriter = new SavWriter(this.getByteSize()); this.write(savWriter); return savWriter.array;