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

ctype

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctype - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

22

ctype.js

@@ -521,3 +521,3 @@ /*

else if (dispatch == 'write')
return (this.readStruct(value, this.types[type],
return (this.writeStruct(value, this.types[type],
buffer, offset));

@@ -697,3 +697,3 @@ else

ret = this.writeArray(value, type['type'],
len, buffer, offset);
buffer, offset);
} else {

@@ -714,3 +714,3 @@ if (type['type'] in deftypes)

*/
CTypeParser.prototype.writeStruct = function (def, buffer, offset)
CTypeParser.prototype.writeStruct = function (value, def, buffer, offset)
{

@@ -730,5 +730,5 @@ var ii, entry, type, key;

offset += this.writeEntry(entry['value'], type, buffer, offset);
offset += this.writeEntry(value[ii], type, buffer, offset);
/* Now that we've written it out, we can use it for arrays */
/* Keep track of types for array length resolution */
vals[key] = entry['value'];

@@ -748,5 +748,9 @@ }

* offset The offset in the buffer to write to
*
* TODO This endpoint really is just awful. See ticket CTYPE-6
*/
CTypeParser.prototype.writeData = function (def, buffer, offset)
{
var ii, vals, key;
if (def === undefined)

@@ -765,4 +769,8 @@ throw (new Error('missing definition for what we should be' +

ctCheckReq(def, this.types, [ 'value' ]);
this.writeStruct(def, buffer, offset);
vals = [];
for (ii = 0; ii < def.length; ii++) {
key = Object.keys(def[ii])[0];
vals.push(def[ii][key]['value']);
}
this.writeStruct(vals, def, buffer, offset);
};

@@ -769,0 +777,0 @@

{
"name": "ctype",
"version": "0.2.0",
"version": "0.2.1",
"description": "read and write binary structures and data types",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/rmustacc/node-ctype",

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