sdf-parser
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -5,2 +5,3 @@ 'use strict'; | ||
var ensureString = require('ensure-string'); | ||
var pipeline = require('pumpify'); | ||
@@ -35,2 +36,12 @@ var split2 = require('split2'); | ||
/** | ||
* Parse a SDF file | ||
* @param {string|ArrayBuffer|Uint8Array} sdf SDF file to parse | ||
* @param {any} [options={}] | ||
* @param {array<string>} [options.include] List of fields to include | ||
* @param {array<string>} [options.exclude] List of fields to exclude | ||
* @param {boolean} [options.dynamicTyping] Dynamically type the data | ||
* @param {object} [options.modifiers] Object containing callbacks to apply on some specific fields | ||
* @param {boolean} [options.mixedEOL=false] Set to true if you know there is a mixture between \r\n and \n | ||
*/ | ||
function parse(sdf, options = {}) { | ||
@@ -46,2 +57,3 @@ const { | ||
sdf = ensureString.ensureString(sdf); | ||
if (typeof sdf !== 'string') { | ||
@@ -185,2 +197,3 @@ throw new TypeError('Parameter "sdf" must be a string'); | ||
const filterStream = filter__default["default"].bind(null, { objectMode: true }); | ||
function filterCb(chunk) { | ||
@@ -187,0 +200,0 @@ return chunk.length > 1 && chunk.trim().length > 1; |
{ | ||
"name": "sdf-parser", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "SDF parser", | ||
@@ -11,2 +11,3 @@ "main": "lib/index.js", | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
@@ -46,15 +47,16 @@ "build": "npm run compile && cheminfo-build --root SDFParser", | ||
"devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.15.4", | ||
"@babel/plugin-transform-modules-commonjs": "^7.16.8", | ||
"babel-eslint": "^10.1.0", | ||
"callback-stream": "^1.1.0", | ||
"cheminfo-build": "^1.1.11", | ||
"eslint": "^7.32.0", | ||
"eslint-config-cheminfo": "^6.0.1", | ||
"jest": "^27.2.5", | ||
"eslint": "^8.10.0", | ||
"eslint-config-cheminfo": "^7.3.0", | ||
"jest": "^27.5.1", | ||
"openchemlib": "^7.4.3", | ||
"prettier": "^2.4.1" | ||
"prettier": "^2.5.1" | ||
}, | ||
"dependencies": { | ||
"ensure-string": "^1.1.0", | ||
"pumpify": "^2.0.1", | ||
"split2": "^3.2.2", | ||
"split2": "^4.1.0", | ||
"through2": "^4.0.2", | ||
@@ -61,0 +63,0 @@ "through2-filter": "^3.0.0" |
@@ -0,3 +1,14 @@ | ||
import { ensureString } from 'ensure-string'; | ||
import { getEntriesBoundaries } from './getEntriesBoundaries'; | ||
/** | ||
* Parse a SDF file | ||
* @param {string|ArrayBuffer|Uint8Array} sdf SDF file to parse | ||
* @param {any} [options={}] | ||
* @param {array<string>} [options.include] List of fields to include | ||
* @param {array<string>} [options.exclude] List of fields to exclude | ||
* @param {boolean} [options.dynamicTyping] Dynamically type the data | ||
* @param {object} [options.modifiers] Object containing callbacks to apply on some specific fields | ||
* @param {boolean} [options.mixedEOL=false] Set to true if you know there is a mixture between \r\n and \n | ||
*/ | ||
export function parse(sdf, options = {}) { | ||
@@ -13,2 +24,3 @@ const { | ||
sdf = ensureString(sdf); | ||
if (typeof sdf !== 'string') { | ||
@@ -15,0 +27,0 @@ throw new TypeError('Parameter "sdf" must be a string'); |
@@ -9,2 +9,3 @@ import pipeline from 'pumpify'; | ||
const filterStream = filter.bind(null, { objectMode: true }); | ||
function filterCb(chunk) { | ||
@@ -11,0 +12,0 @@ return chunk.length > 1 && chunk.trim().length > 1; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
356579
683
0
5
+ Addedensure-string@^1.1.0
+ Addedcheminfo-types@1.8.1(transitive)
+ Addedensure-string@1.2.0(transitive)
+ Addedisutf8@4.0.1(transitive)
+ Addedsplit2@4.2.0(transitive)
- Removedsplit2@3.2.2(transitive)
Updatedsplit2@^4.1.0