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

sdf-parser

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sdf-parser - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

10

package.json
{
"name": "sdf-parser",
"version": "3.0.1",
"version": "3.1.0",
"description": "SDF parser",

@@ -38,8 +38,8 @@ "main": "./src/index.js",

"cheminfo-tools": "^1.20.2",
"eslint": "^4.14.0",
"eslint-config-cheminfo": "^1.9.1",
"eslint": "^4.16.0",
"eslint-config-cheminfo": "^1.14.1",
"eslint-plugin-no-only-tests": "^2.0.0",
"jest": "^22.0.4",
"jest": "^22.1.4",
"openchemlib": "^5.5.0",
"should": "^13.2.0"
"should": "^13.2.1"
},

@@ -46,0 +46,0 @@ "dependencies": {

@@ -39,3 +39,3 @@ # sdf-parser

* mixedEOL : if set to true will try to deal with mixed End Of Line separator
* dynamicTyping : convert fields containing only number to numbers (default: true)
## Advanced example with filtering and modifiers

@@ -42,0 +42,0 @@

'use strict';
function parse(sdf, options) {
options = options || {};
var include = options.include;
var exclude = options.exclude;
var filter = options.filter;
var modifiers = options.modifiers || {};
var forEach = options.forEach || {};
function parse(sdf, options = {}) {
const {
include,
exclude,
filter,
modifiers = {},
forEach = {},
dynamicTyping = true
} = options;
if (typeof sdf !== 'string') {

@@ -50,3 +53,3 @@ throw new TypeError('Parameter "sdf" must be a string');

counter: 0,
isNumeric: true,
isNumeric: dynamicTyping,
keep: false

@@ -80,3 +83,3 @@ };

if (labels[label].isNumeric) {
if (!isFinite(molecule[label])) {
if (!isFinite(molecule[label]) || molecule[label].match(/^0[0-9]/)) {
labels[label].isNumeric = false;

@@ -83,0 +86,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