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

mf-parser

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mf-parser - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## 1.1.8 (2021-03-15)
# 0.60.0 (2021-03-15)
**Note:** Version bump only for package mf-parser
## 1.1.7 (2021-03-12)

@@ -8,0 +20,0 @@

11

package.json
{
"name": "mf-parser",
"version": "1.1.7",
"version": "1.1.8",
"description": "",

@@ -21,9 +21,10 @@ "main": "src/index.js",

"dependencies": {
"atom-sorter": "^1.1.6",
"chemical-elements": "^1.1.6",
"chemical-groups": "^1.1.1"
"atom-sorter": "^1.1.7",
"chemical-elements": "^1.1.7",
"chemical-groups": "^1.1.2"
},
"devDependencies": {
"jest-matcher-deep-close-to": "^2.0.1"
}
},
"gitHead": "edbce8dcb4f58223096d13c4cbaa1fb7a448283c"
}

@@ -203,2 +203,15 @@ 'use strict';

],
'CaCO3 . 3/2H2O': [
{ kind: 'atom', value: 'Ca' },
{ kind: 'atom', value: 'C' },
{ kind: 'atom', value: 'O' },
{ kind: 'multiplier', value: 3 },
{ kind: 'text', value: ' ' },
{ kind: 'salt', value: '.' },
{ kind: 'text', value: ' ' },
{ kind: 'preMultiplier', value: 1.5 },
{ kind: 'atom', value: 'H' },
{ kind: 'multiplier', value: 2 },
{ kind: 'atom', value: 'O' },
],
};

@@ -205,0 +218,0 @@

@@ -175,3 +175,8 @@ 'use strict';

ascii = this.mf.charCodeAt(this.i);
} while ((ascii > 47 && ascii < 58) || ascii === 46 || ascii === 45); // number, . or -
} while (
(ascii > 47 && ascii < 58) ||
ascii === 46 ||
ascii === 45 ||
ascii === 47
); // number . - /
// we need to deal with the case there is a from / to

@@ -183,7 +188,7 @@ if (previous === 46) this.i--;

return {
from: Number(number.substr(0, indexOfDash)),
to: Number(number.substr(indexOfDash + 1)),
from: parseNumberWithDivision(number.substr(0, indexOfDash)),
to: parseNumberWithDivision(number.substr(indexOfDash + 1)),
};
}
return { from: Number(number) };
return { from: parseNumberWithDivision(number) };
}

@@ -270,1 +275,13 @@

}
function parseNumberWithDivision(string) {
if (string.includes('/')) {
let parts = string.split('/');
if (parts.length !== 2) {
throw new TypeError('Can not parse MF with number like: ', string);
}
return Number(parts[0]) / Number(parts[1]);
} else {
return Number(string);
}
}
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