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

jcampconverter

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jcampconverter - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

2

bower.json
{
"name": "jcampconverter",
"version": "2.0.5",
"version": "2.0.6",
"main": [

@@ -5,0 +5,0 @@ "dist/jcampconverter.js",

{
"name": "jcampconverter",
"version": "2.0.5",
"version": "2.0.6",
"description": "Parse and convert JCAMP data",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -36,3 +36,5 @@ # JCAMP converter

* keepRecordsRegExp - regexp to select which records should be placed in the info field. By default: :/^[A-Za-z]+$/}
* xy - instead of creating a 1D array containing [x1,y1,x2,y2, ...] create an object: {x:[], y:[]}
### Use as a module

@@ -39,0 +41,0 @@

@@ -24,2 +24,4 @@ 'use strict';

options.keepSpectra: keep the original spectra for a 2D
options.xy: true // create x / y array instead of a 1D array
options.keepRecordsRegExp: which fields do we keep
*/

@@ -257,2 +259,24 @@

if (options.xy) { // the spectraData should not be a oneD array but an object with x and y
if (spectra.length > 0) {
for (var i=0; i<spectra.length; i++) {
var spectrum=spectra[i];
if (spectrum.data.length>0) {
for (var j=0; j<spectrum.data.length; j++) {
var data=spectrum.data[j];
var newData={x:Array(data.length/2), y:Array(data.length/2)};
for (var k=0; k<data.length; k=k+2) {
newData.x[k/2]=data[k];
newData.y[k/2]=data[k+1];
}
spectrum.data[j]=newData;
}
}
}
}
}
if (result.profiling) {

@@ -259,0 +283,0 @@ result.profiling.push({action: 'Total time', time: new Date() - start});

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