Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

msgpackr

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msgpackr - npm Package Compare versions

Comparing version 1.9.6 to 1.9.7

2

package.json
{
"name": "msgpackr",
"author": "Kris Zyp",
"version": "1.9.6",
"version": "1.9.7",
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -135,22 +135,25 @@

let number = value;
if (number >> 0 === number && number < 0x20000000 && number > -0x1f000000) {
if (number < 0xf6 && number >= 0 && (nextTransition.num8 || number < 0x20 && !nextTransition.num32)) {
transition = nextTransition.num8 || createTypeTransition(nextTransition, NUMBER, 1);
target[position++] = number;
} else {
transition = nextTransition.num32 || createTypeTransition(nextTransition, NUMBER, 4);
targetView.setUint32(position, number, true);
position += 4;
}
break;
} else if (number < 0x100000000 && number >= -0x80000000) {
targetView.setFloat32(position, number, true);
if (float32Headers[target[position + 3] >>> 5]) {
let xShifted
// this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
if (((xShifted = number * mult10[((target[position + 3] & 0x7f) << 1) | (target[position + 2] >> 7)]) >> 0) === xShifted) {
// first check to see if we are using a lot of ids and should default to wide/common format
if (nextId < 200 || !nextTransition.num64) {
if (number >> 0 === number && number < 0x20000000 && number > -0x1f000000) {
if (number < 0xf6 && number >= 0 && (nextTransition.num8 && !(nextId > 200 && nextTransition.num32) || number < 0x20 && !nextTransition.num32)) {
transition = nextTransition.num8 || createTypeTransition(nextTransition, NUMBER, 1);
target[position++] = number;
} else {
transition = nextTransition.num32 || createTypeTransition(nextTransition, NUMBER, 4);
targetView.setUint32(position, number, true);
position += 4;
break;
}
break;
} else if (number < 0x100000000 && number >= -0x80000000) {
targetView.setFloat32(position, number, true);
if (float32Headers[target[position + 3] >>> 5]) {
let xShifted
// this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
if (((xShifted = number * mult10[((target[position + 3] & 0x7f) << 1) | (target[position + 2] >> 7)]) >> 0) === xShifted) {
transition = nextTransition.num32 || createTypeTransition(nextTransition, NUMBER, 4);
position += 4;
break;
}
}
}

@@ -157,0 +160,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc