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

jcampconverter

Package Overview
Dependencies
Maintainers
4
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 8.1.2 to 8.1.3

7

CHANGELOG.md
# Changelog
### [8.1.3](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.2...v8.1.3) (2021-06-18)
### Bug Fixes
* prevent isNaN with dynamicTyping ([c171dcf](https://www.github.com/cheminfo/jcampconverter/commit/c171dcf0c1f9891bf85435c6693aec9c54a98c01))
### [8.1.2](https://www.github.com/cheminfo/jcampconverter/compare/v8.1.1...v8.1.2) (2021-05-27)

@@ -4,0 +11,0 @@

9

lib/index.js

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

const ntuplesSeparatorRegExp = /[ \t]*,[ \t]*/;
const numberRegExp = /^[-+]?[0-9]*\.?[0-9]+(e[-+]?[0-9]+)?$/;

@@ -1183,4 +1182,8 @@ class Spectrum {}

if (options.dynamicTyping) {
if (value.match(numberRegExp)) {
value = Number.parseFloat(value);
if (value === 'true' || value === 'TRUE') {
value = true;
} else if (value === 'false' || value === 'FALSE') {
value = false;
} else if (value !== '' && !isNaN(value)) {
value = parseFloat(value);
}

@@ -1187,0 +1190,0 @@ }

{
"name": "jcampconverter",
"version": "8.1.2",
"version": "8.1.3",
"description": "Parse and convert JCAMP data",

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

@@ -15,3 +15,2 @@ import { ensureString } from 'ensure-string';

const ntuplesSeparatorRegExp = /[ \t]*,[ \t]*/;
const numberRegExp = /^[-+]?[0-9]*\.?[0-9]+(e[-+]?[0-9]+)?$/;

@@ -307,4 +306,8 @@ class Spectrum {}

if (options.dynamicTyping) {
if (value.match(numberRegExp)) {
value = Number.parseFloat(value);
if (value === 'true' || value === 'TRUE') {
value = true;
} else if (value === 'false' || value === 'FALSE') {
value = false;
} else if (value !== '' && !isNaN(value)) {
value = parseFloat(value);
}

@@ -311,0 +314,0 @@ }

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