bplist-parser
Advanced tools
Comparing version 0.3.1 to 0.3.2
module.exports = { | ||
"env": { | ||
"mocha": true, | ||
"node": true, | ||
@@ -191,3 +192,3 @@ "commonjs": true, | ||
"no-spaced-func": "error", | ||
"no-sync": "error", | ||
// "no-sync": "error", | ||
"no-tabs": "error", | ||
@@ -194,0 +195,0 @@ "no-template-curly-in-string": "error", |
declare namespace bPlistParser { | ||
type CallbackFunction<T = any> = (error: Error|null, result: [T]) => void | ||
export function parseFile<T = any>(fileNameOrBuffer: string|Buffer, callback?: CallbackFunction<T>): Promise<[T]> | ||
export function parseFileSync<T = any>(fileNameOrBuffer: string|Buffer): [T] | ||
export function parseBuffer<T = any>(buffer: string|Buffer): [T] | ||
} | ||
export = bPlistParser |
@@ -53,2 +53,9 @@ /* eslint-disable no-console */ | ||
exports.parseFileSync = function (fileNameOrBuffer) { | ||
if (!Buffer.isBuffer(fileNameOrBuffer)) { | ||
fileNameOrBuffer = fs.readFileSync(fileNameOrBuffer); | ||
} | ||
return parseBuffer(fileNameOrBuffer); | ||
}; | ||
const parseBuffer = exports.parseBuffer = function (buffer) { | ||
@@ -178,5 +185,5 @@ // check header | ||
}); | ||
} else { | ||
} | ||
throw new Error("Too little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); | ||
} | ||
} | ||
@@ -183,0 +190,0 @@ |
{ | ||
"name": "bplist-parser", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Binary plist parser.", | ||
@@ -5,0 +5,0 @@ "main": "bplistParser.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24125
645