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

brukerconverter

Package Overview
Dependencies
Maintainers
6
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brukerconverter - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2-pre.1673538890

30

lib/index.js

@@ -563,2 +563,3 @@ 'use strict';

* @param {boolean} [options.xy] - if true, spectra data is a object with x and y
* @param {boolean} [options.keepFiles] - if true, the fileCollectionItems will be saved in source.
* @param {boolean} [options.keepSpectra=false] - for 2D should we keep the spectra or just the matrix ?

@@ -584,2 +585,5 @@ * @param {RegExp} [options.keepRecordsRegExp='\/.*\/'] - regular expresion to parse the metadata of the spectrum.

}
if (options.keepFiles) {
result.source.files = brukerFiles.fileCollectionItems;
}
// todo we could as well keep the FileList at this level if

@@ -592,5 +596,5 @@ // we want to keep the original data

if (result.meta.GRPDLY) {
result.meta.GRPDLY = Number(result.meta.GRPDLY);
result.meta.DSPFVS = Number(result.meta.DSPFVS);
result.meta.DECIM = Number(result.meta.DECIM);
maybeAdd(result.meta, 'DSPFVS', result.meta.DSPFVS);
maybeAdd(result.meta, 'GRPDLY', result.meta.GRPDLY);
maybeAdd(result.meta, 'DECIM', result.meta.DECIM);
}

@@ -623,2 +627,21 @@

function maybeAdd(obj, name, value) {
if (value === undefined) return;
if (Array.isArray(value)) {
obj[name] = value.map(cleanValue);
} else {
obj[name] = [cleanValue(value)];
}
}
function cleanValue(value) {
if (typeof value === 'string') {
if (value.startsWith('<') && value.endsWith('>')) {
value = value.substring(1, value.length - 1);
}
value = value.trim();
}
return value;
}
/**

@@ -651,3 +674,4 @@ *

exports.convertFileCollection = convertFileCollection;
exports.convertOneExperiment = convertOneExperiment;
exports.convertZip = convertZip;
exports.groupByExperiments = groupByExperiments;

4

package.json
{
"name": "brukerconverter",
"version": "6.0.1",
"version": "6.0.2-pre.1673538890",
"description": "Parse and convert Bruker raw data",

@@ -53,2 +53,2 @@ "main": "lib/index.js",

}
}
}
export { convertZip } from './helpers/convertZip';
export { convertOneExperiment } from './util/convertOneExperiment';
export { convertFileCollection } from './convertFileCollection';
export { groupByExperiments } from './groupByExperiments';

@@ -10,2 +10,3 @@ import { convert1D } from './convert1D';

* @param {boolean} [options.xy] - if true, spectra data is a object with x and y
* @param {boolean} [options.keepFiles] - if true, the fileCollectionItems will be saved in source.
* @param {boolean} [options.keepSpectra=false] - for 2D should we keep the spectra or just the matrix ?

@@ -31,2 +32,5 @@ * @param {RegExp} [options.keepRecordsRegExp='\/.*\/'] - regular expresion to parse the metadata of the spectrum.

}
if (options.keepFiles) {
result.source.files = brukerFiles.fileCollectionItems;
}
// todo we could as well keep the FileList at this level if

@@ -39,5 +43,5 @@ // we want to keep the original data

if (result.meta.GRPDLY) {
result.meta.GRPDLY = Number(result.meta.GRPDLY);
result.meta.DSPFVS = Number(result.meta.DSPFVS);
result.meta.DECIM = Number(result.meta.DECIM);
maybeAdd(result.meta, 'DSPFVS', result.meta.DSPFVS);
maybeAdd(result.meta, 'GRPDLY', result.meta.GRPDLY);
maybeAdd(result.meta, 'DECIM', result.meta.DECIM);
}

@@ -69,1 +73,20 @@

}
function maybeAdd(obj, name, value) {
if (value === undefined) return;
if (Array.isArray(value)) {
obj[name] = value.map(cleanValue);
} else {
obj[name] = [cleanValue(value)];
}
}
function cleanValue(value) {
if (typeof value === 'string') {
if (value.startsWith('<') && value.endsWith('>')) {
value = value.substring(1, value.length - 1);
}
value = value.trim();
}
return value;
}
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