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

bplist-parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bplist-parser - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

36

bplistParser.js

@@ -15,9 +15,6 @@ 'use strict';

var parseFile = exports.parseFile = function (fileName, callback) {
fs.readFile(fileName, function (err, data) {
if (err) {
return callback(err);
}
var parseFile = exports.parseFile = function (fileNameOrBuffer, callback) {
function tryParseBuffer(buffer) {
try {
var result = parseBuffer(data);
var result = parseBuffer(buffer);
return callback(null, result);

@@ -27,3 +24,12 @@ } catch (ex) {

}
});
}
if (Buffer.isBuffer(fileNameOrBuffer)) {
return tryParseBuffer(fileNameOrBuffer);
} else {
fs.readFile(fileNameOrBuffer, function (err, data) {
if (err) { return callback(err); }
tryParseBuffer(data);
});
}
};

@@ -88,4 +94,5 @@

case 0x1:
case 0x8: // UID (really just an integer)
return parseInteger();
case 0x8:
return parseUID();
case 0x2:

@@ -134,2 +141,11 @@ return parseReal();

function parseUID() {
var length = objInfo + 1;
if (length < exports.maxObjectSize) {
return readUInt(buffer.slice(offset + 1, offset + 1 + length));
} else {
throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available.");
}
}
function parseReal() {

@@ -208,3 +224,3 @@ var length = Math.pow(2, objInfo);

if (isUtf16) {
plistString = swapBytes(plistString);
plistString = swapBytes(plistString);
enc = "ucs2";

@@ -314,2 +330,2 @@ }

return buffer;
}
}
{
"name": "bplist-parser",
"version": "0.0.4",
"version": "0.0.5",
"description": "Binary plist parser.",

@@ -5,0 +5,0 @@ "main": "bplistParser.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