@rhyster/wow-casc-dbc 2.12.11 → 2.13.0

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 CHANGED
@@ -1083,18 +1083,13 @@ const readBitpackedValue = (buffer, fieldOffsetBits, fieldSizeBits, signed = fal
1083
1083
  const offsetBytes = fieldOffsetBits >>> 3;
1084
1084
  const bitOffset = fieldOffsetBits & 7;
1085
1085
  const sizeBytes = Math.ceil((fieldSizeBits + bitOffset) / 8);
1086
- if (sizeBytes <= 6) {
1087
- const rawValue = buffer.readUIntLE(offsetBytes, sizeBytes);
1088
- return Number(
1089
- signed ? BigInt.asIntN(fieldSizeBits, BigInt(rawValue >>> bitOffset)) : BigInt.asUintN(fieldSizeBits, BigInt(rawValue >>> bitOffset))
1090
- );
1091
- }
1092
1086
  let value = 0n;
1093
1087
  for (let i = sizeBytes - 1; i >= 0; i -= 1) {
1094
1088
  const byte = buffer.readUInt8(offsetBytes + i);
1095
1089
  value = value << 8n | BigInt(byte);
1096
1090
  }
1097
- return signed ? BigInt.asIntN(fieldSizeBits, value >> BigInt(bitOffset)) : BigInt.asUintN(fieldSizeBits, value >> BigInt(bitOffset));
1091
+ const result = signed ? BigInt.asIntN(fieldSizeBits, value >> BigInt(bitOffset)) : BigInt.asUintN(fieldSizeBits, value >> BigInt(bitOffset));
1092
+ return fieldSizeBits <= 32 ? Number(result) : result;
1098
1093
  };
1099
1094
  const isDataRangeAllZero = (buffer, offset, length) => {
1100
1095
  const end = offset + length;