openchemlib-utils
Advanced tools
Comparing version 0.6.1 to 0.7.0
# Changelog | ||
## [0.7.0](https://www.github.com/cheminfo/openchemlib-utils/compare/v0.6.1...v0.7.0) (2021-03-01) | ||
### Features | ||
* allow to initOCL with keepExisting option ([6f9049a](https://www.github.com/cheminfo/openchemlib-utils/commit/6f9049aaad5416d4beeb117eafe680108d67d2ec)) | ||
### [0.6.1](https://www.github.com/cheminfo/openchemlib-utils/compare/v0.6.0...v0.6.1) (2021-01-17) | ||
@@ -4,0 +11,0 @@ |
@@ -22,4 +22,11 @@ 'use strict'; | ||
} | ||
function initOCL(newOCL) { | ||
/** | ||
* | ||
* @param {OCL} newOCL | ||
* @param {object} [options={}] | ||
* @param {boolean} [options.keepExisting=false] Will keep current OCL if we initialize more than once | ||
*/ | ||
function initOCL(newOCL, options = {}) { | ||
const { keepExisting = false } = options; | ||
if (OCL && keepExisting) return; | ||
if (OCL && OCL !== newOCL) { | ||
@@ -866,3 +873,3 @@ throw new Error('OCL-utils was already initialized with a different OCL'); | ||
let fragment; | ||
let fragment$1; | ||
@@ -915,3 +922,3 @@ /** | ||
if (!fragment) fragment = new OCL.Molecule(0, 0); | ||
if (!fragment$1) fragment$1 = new OCL.Molecule(0, 0); | ||
@@ -950,5 +957,5 @@ let atoms = []; | ||
molecule.copyMoleculeByAtoms(fragment, atomMask, true, atomMap); | ||
makeRacemic(fragment); | ||
let oclID = fragment.getCanonizedIDCode( | ||
molecule.copyMoleculeByAtoms(fragment$1, atomMask, true, atomMap); | ||
makeRacemic(fragment$1); | ||
let oclID = fragment$1.getCanonizedIDCode( | ||
OCL.Molecule.CANONIZER_ENCODE_ATOM_CUSTOM_LABELS, | ||
@@ -973,3 +980,3 @@ ); | ||
let fragment$1; | ||
let fragment; | ||
@@ -996,4 +1003,4 @@ /** | ||
if (!fragment$1) { | ||
fragment$1 = new OCL.Molecule(0, 0); | ||
if (!fragment) { | ||
fragment = new OCL.Molecule(0, 0); | ||
} | ||
@@ -1000,0 +1007,0 @@ |
{ | ||
"name": "openchemlib-utils", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -9,4 +9,11 @@ let OCL; | ||
} | ||
export function initOCL(newOCL) { | ||
/** | ||
* | ||
* @param {OCL} newOCL | ||
* @param {object} [options={}] | ||
* @param {boolean} [options.keepExisting=false] Will keep current OCL if we initialize more than once | ||
*/ | ||
export function initOCL(newOCL, options = {}) { | ||
const { keepExisting = false } = options; | ||
if (OCL && keepExisting) return; | ||
if (OCL && OCL !== newOCL) { | ||
@@ -13,0 +20,0 @@ throw new Error('OCL-utils was already initialized with a different OCL'); |
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
79298
2117