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

nmr-processing

Package Overview
Dependencies
Maintainers
4
Versions
269
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nmr-processing - npm Package Compare versions

Comparing version 6.0.4 to 6.0.5

1

lib-esm/peaks/peaksToRanges.js

@@ -160,3 +160,2 @@ import { xyIntegration } from 'ml-spectra-processing';

ranges = joinRanges(ranges);
// return new Ranges(ranges);
return ranges;

@@ -163,0 +162,0 @@ }

10

lib-esm/peaks/util/joinRanges.js
export function joinRanges(ranges) {
ranges.sort((a, b) => a.from - b.from);
for (let i = 0; i < ranges.length - 1; i++) {
if (ranges[i].to > ranges[i + 1].from) {
const currentRange = ranges[i];
const nextRange = ranges[i + i];
ranges[i].to = Math.max(ranges[i + 1].to, ranges[i].to);
const currentRange = ranges[i];
const nextRange = ranges[i + 1];
if (currentRange.to > nextRange.from) {
currentRange.to = Math.max(nextRange.to, currentRange.to);
if (currentRange.signals && nextRange.signals) {
currentRange.signals = currentRange.signals.concat(nextRange.signals);
}
if (currentRange.integration) {
if (currentRange.integration !== undefined) {
currentRange.integration += nextRange.integration || 0;

@@ -13,0 +13,0 @@ }

@@ -166,3 +166,2 @@ "use strict";

ranges = (0, joinRanges_1.joinRanges)(ranges);
// return new Ranges(ranges);
return ranges;

@@ -169,0 +168,0 @@ }

@@ -7,10 +7,10 @@ "use strict";

for (let i = 0; i < ranges.length - 1; i++) {
if (ranges[i].to > ranges[i + 1].from) {
const currentRange = ranges[i];
const nextRange = ranges[i + i];
ranges[i].to = Math.max(ranges[i + 1].to, ranges[i].to);
const currentRange = ranges[i];
const nextRange = ranges[i + 1];
if (currentRange.to > nextRange.from) {
currentRange.to = Math.max(nextRange.to, currentRange.to);
if (currentRange.signals && nextRange.signals) {
currentRange.signals = currentRange.signals.concat(nextRange.signals);
}
if (currentRange.integration) {
if (currentRange.integration !== undefined) {
currentRange.integration += nextRange.integration || 0;

@@ -17,0 +17,0 @@ }

{
"name": "nmr-processing",
"version": "6.0.4",
"version": "6.0.5",
"description": "Pure functions allowing to process NMR spectra.",

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

@@ -261,3 +261,2 @@ import type { DataXY } from 'cheminfo-types';

if (joinOverlapRanges) ranges = joinRanges(ranges);
// return new Ranges(ranges);
return ranges;

@@ -264,0 +263,0 @@ }

@@ -5,11 +5,13 @@ import type { NMRRange } from '../../xy/NMRRange';

ranges.sort((a, b) => a.from - b.from);
for (let i = 0; i < ranges.length - 1; i++) {
if (ranges[i].to > ranges[i + 1].from) {
const currentRange = ranges[i];
const nextRange = ranges[i + i];
ranges[i].to = Math.max(ranges[i + 1].to, ranges[i].to);
const currentRange = ranges[i];
const nextRange = ranges[i + 1];
if (currentRange.to > nextRange.from) {
currentRange.to = Math.max(nextRange.to, currentRange.to);
if (currentRange.signals && nextRange.signals) {
currentRange.signals = currentRange.signals.concat(nextRange.signals);
}
if (currentRange.integration) {
if (currentRange.integration !== undefined) {
currentRange.integration += nextRange.integration || 0;

@@ -21,3 +23,4 @@ }

}
return ranges;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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