sdf-parser
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -26,4 +26,9 @@ 'use strict'; | ||
res.push([previous, next]); | ||
previous = next = | ||
string.indexOf(eol, next + substring.length) + eol.length; | ||
const nextMatch = string.indexOf(eol, next + substring.length); | ||
if (nextMatch === -1) { | ||
next = -1; | ||
} else { | ||
previous = nextMatch + eol.length; | ||
next = previous; | ||
} | ||
} else { | ||
@@ -188,5 +193,5 @@ res.push([previous, string.length]); | ||
time: Date.now() - start, | ||
molecules: molecules, | ||
molecules, | ||
labels: Object.keys(labels), | ||
statistics: statistics, | ||
statistics, | ||
}; | ||
@@ -193,0 +198,0 @@ } |
{ | ||
"name": "sdf-parser", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "SDF parser", | ||
@@ -46,14 +46,14 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.16.8", | ||
"@babel/plugin-transform-modules-commonjs": "^7.18.6", | ||
"babel-eslint": "^10.1.0", | ||
"callback-stream": "^1.1.0", | ||
"cheminfo-build": "^1.1.11", | ||
"eslint": "^8.10.0", | ||
"eslint-config-cheminfo": "^7.3.0", | ||
"jest": "^27.5.1", | ||
"openchemlib": "^7.4.3", | ||
"prettier": "^2.5.1" | ||
"eslint": "^8.22.0", | ||
"eslint-config-cheminfo": "^8.0.2", | ||
"jest": "^28.1.3", | ||
"openchemlib": "^8.0.1", | ||
"prettier": "^2.7.1" | ||
}, | ||
"dependencies": { | ||
"ensure-string": "^1.1.0", | ||
"ensure-string": "^1.2.0", | ||
"pumpify": "^2.0.1", | ||
@@ -60,0 +60,0 @@ "split2": "^4.1.0", |
@@ -27,1 +27,8 @@ import fs from 'fs'; | ||
}); | ||
test('should parse sdf files without EOL in the EOF', () => { | ||
const eol = '\n'; | ||
const sdf = fs.readFileSync(`${__dirname}/test4.sdf`, 'utf-8'); | ||
expect(getEntriesBoundaries(sdf, `${eol}$$$$`, eol)).toMatchSnapshot(); | ||
}); |
@@ -9,4 +9,9 @@ export function getEntriesBoundaries(string, substring, eol) { | ||
res.push([previous, next]); | ||
previous = next = | ||
string.indexOf(eol, next + substring.length) + eol.length; | ||
const nextMatch = string.indexOf(eol, next + substring.length); | ||
if (nextMatch === -1) { | ||
next = -1; | ||
} else { | ||
previous = nextMatch + eol.length; | ||
next = previous; | ||
} | ||
} else { | ||
@@ -13,0 +18,0 @@ res.push([previous, string.length]); |
@@ -156,6 +156,6 @@ import { ensureString } from 'ensure-string'; | ||
time: Date.now() - start, | ||
molecules: molecules, | ||
molecules, | ||
labels: Object.keys(labels), | ||
statistics: statistics, | ||
statistics, | ||
}; | ||
} |
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
358629
20
698
Updatedensure-string@^1.2.0