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

@mu-online-js/mu-packet-manager

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mu-online-js/mu-packet-manager - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

41

index.js

@@ -131,8 +131,16 @@ /**

// Handle chars.
const match = type.match(/^char\((\d+)\)$/);
if (match) {
const length = parseInt(match[1]);
const charsMatch = type.match(/^char\((\d+)\)$/);
if (charsMatch) {
const length = parseInt(charsMatch[1]);
objectToStore[key] = this.buf.toString('utf8', this.currentOffset, this.currentOffset+length).replace(/\x00.*$/g, '');
this.currentOffset += length;
}
// Handle predefined bytes length.
const byteMatch = type.match(/^byte\((\d+)\)$/);
if (byteMatch) {
const length = parseInt(byteMatch[1]);
objectToStore[key] = this.buf.toString('utf8', this.currentOffset, this.currentOffset+length).replace(/\x00.*$/g, '');
this.currentOffset += length;
}
this.lastType = type;

@@ -230,5 +238,5 @@ };

// Handle chars.
const match = type.match(/^char\((\d+)\)$/);
if (match) {
const length = parseInt(match[1]);
const charMatch = type.match(/^char\((\d+)\)$/);
if (charMatch) {
const length = parseInt(charMatch[1]);
this.buf.write(value, this.currentOffset, length, 'utf8');

@@ -238,2 +246,10 @@ this.currentOffset += length;

// Handle predefined bytes length.
const byteMatch = type.match(/^byte\((\d+)\)$/);
if (byteMatch) {
const length = parseInt(byteMatch[1]);
Buffer.from(value).copy(this.buf, this.currentOffset);
this.currentOffset += length;
}
this.lastType = type;

@@ -292,8 +308,15 @@ };

// Handle chars.
const match = type.match(/^char\((\d+)\)$/);
if (match) {
const length = parseInt(match[1]);
const charMatch = type.match(/^char\((\d+)\)$/);
if (charMatch) {
const length = parseInt(charMatch[1]);
size += length;
}
// Handle predefined bytes length.
const byteMatch = type.match(/^byte\((\d+)\)$/);
if (byteMatch) {
const length = parseInt(byteMatch[1]);
size += length;
}
this.lastType = type;

@@ -300,0 +323,0 @@ }

{
"name": "@mu-online-js/mu-packet-manager",
"version": "0.0.13",
"version": "0.0.14",
"description": "It allows you to define packet structures in a single place and easily convert between buffer and object representations of these structures.",

@@ -5,0 +5,0 @@ "main": "index.js",

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