Comparing version 2.2.0 to 2.2.1
@@ -373,4 +373,15 @@ 'use strict'; | ||
function parseMZ(xml) { | ||
const header = decoder.decode(xml.subarray(0, 200)); | ||
if (typeof xml === 'string') { | ||
const encoder = new TextEncoder(); | ||
xml = encoder.encode(xml); | ||
} | ||
if (!ArrayBuffer.isView(xml)) { | ||
xml = new Uint8Array(xml); | ||
} | ||
const header = xml.subarray | ||
? decoder.decode(xml.subarray(0, 200)) | ||
: xml.substring(0, 200); | ||
if (header.includes('mzData')) { | ||
@@ -377,0 +388,0 @@ return parseMzData(xml); |
{ | ||
"name": "mzdata", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Read and explore mzData v1.05 files", | ||
@@ -16,2 +16,4 @@ "main": "lib/index.js", | ||
"prepack": "rollup -c", | ||
"prettier": "prettier --check src", | ||
"prettier-write": "prettier --write src", | ||
"test-travis": "npm run test", | ||
@@ -18,0 +20,0 @@ "test": "npm run test-coverage && npm run eslint", |
@@ -13,4 +13,15 @@ import { parseMzData } from './mzdata/parseMzData'; | ||
export function parseMZ(xml) { | ||
const header = decoder.decode(xml.subarray(0, 200)); | ||
if (typeof xml === 'string') { | ||
const encoder = new TextEncoder(); | ||
xml = encoder.encode(xml); | ||
} | ||
if (!ArrayBuffer.isView(xml)) { | ||
xml = new Uint8Array(xml); | ||
} | ||
const header = xml.subarray | ||
? decoder.decode(xml.subarray(0, 200)) | ||
: xml.substring(0, 200); | ||
if (header.includes('mzData')) { | ||
@@ -17,0 +28,0 @@ return parseMzData(xml); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29326
831