@rhyster/wow-casc-dbc 2.12.11 → 2.13.1
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/dist/index.cjs +2 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -7
- package/dist/index.mjs.map +1 -1
- package/dist/wdc.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/wdc.ts +3 -11
package/dist/index.mjs
CHANGED
|
@@ -1071,18 +1071,13 @@ const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = fal
|
|
|
1071
1071
|
const offsetBytes = fieldOffsetBits >>> 3;
|
|
1072
1072
|
const bitOffset = fieldOffsetBits & 7;
|
|
1073
1073
|
const sizeBytes = Math.ceil((fieldSizeBits + bitOffset) / 8);
|
|
1074
|
-
if (sizeBytes <= 6) {
|
|
1075
|
-
const rawValue = buffer.readUIntLE(offsetBytes, sizeBytes);
|
|
1076
|
-
return Number(
|
|
1077
|
-
signed ? BigInt.asIntN(fieldSizeBits, BigInt(rawValue >>> bitOffset)) : BigInt.asUintN(fieldSizeBits, BigInt(rawValue >>> bitOffset))
|
|
1078
|
-
);
|
|
1079
|
-
}
|
|
1080
1074
|
let value = 0n;
|
|
1081
1075
|
for (let i = sizeBytes - 1; i >= 0; i -= 1) {
|
|
1082
1076
|
const byte = buffer.readUInt8(offsetBytes + i);
|
|
1083
1077
|
value = value << 8n | BigInt(byte);
|
|
1084
1078
|
}
|
|
1085
|
-
|
|
1079
|
+
const result = signed ? BigInt.asIntN(fieldSizeBits, value >> BigInt(bitOffset)) : BigInt.asUintN(fieldSizeBits, value >> BigInt(bitOffset));
|
|
1080
|
+
return fieldSizeBits <= 32 ? Number(result) : result;
|
|
1086
1081
|
};
|
|
1087
1082
|
const isDataRangeAllZero = (buffer, offset, length) => {
|
|
1088
1083
|
const end = offset + length;
|