chemical-groups
Advanced tools
Comparing version 1.2.2 to 1.3.0
{ | ||
"name": "chemical-groups", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "JSON containing information about chemical groups", | ||
"main": "lib/index.js", | ||
"module": "src/index.js", | ||
"main": "src/index.js", | ||
"files": [ | ||
"src", | ||
"lib" | ||
"src" | ||
], | ||
@@ -21,4 +19,4 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/main/packages/chemical-elements#readme", | ||
"gitHead": "bd2c06e05f2196c5f9c6ff011cf3ef41e1b6a0f9" | ||
"homepage": "https://github.com/cheminfo/mass-tools/tree/master/packages/chemical-elements#readme", | ||
"gitHead": "ade929b07af4e2f0f8b3fe1aaf0df70c50f4b2db" | ||
} |
@@ -1,8 +0,11 @@ | ||
import { groupsObject, groups } from '..'; | ||
'use strict'; | ||
let data = require('..'); | ||
test('data size', () => { | ||
expect(groups.length).toBeGreaterThan(200); | ||
expect(data.groups.length).toBeGreaterThan(200); | ||
}); | ||
test('groupsObject', () => { | ||
test('getGroupsObject', () => { | ||
let groupsObject = data.getGroupsObject(); | ||
expect(groupsObject.Ala).toStrictEqual({ | ||
@@ -9,0 +12,0 @@ elements: [ |
@@ -1,3 +0,5 @@ | ||
import { groupsToSequence } from '..'; | ||
'use strict'; | ||
let groupsToSequence = require('../groupsToSequence'); | ||
test('groupsToSequence', () => { | ||
@@ -4,0 +6,0 @@ expect(groupsToSequence('HOAlaGlyOH')).toBe('AG'); |
@@ -1,4 +0,6 @@ | ||
import { groups } from './groups'; | ||
'use strict'; | ||
export const groupsObject = {}; | ||
const groups = require('./groups'); | ||
const groupsObject = {}; | ||
groups.forEach((e) => { | ||
@@ -10,1 +12,3 @@ if (groupsObject[e.symbol]) { | ||
}); | ||
module.exports = groupsObject; |
@@ -1,9 +0,11 @@ | ||
import { groupsObject } from './groupsObject.js'; | ||
'use strict'; | ||
const groupsObject = require('./groupsObject.js'); | ||
/** | ||
* Recreate a one letter sequence | ||
* @param {object} mf | ||
* @param {} mf | ||
*/ | ||
export function groupsToSequence(mf) { | ||
function groupsToSequence(mf) { | ||
mf = mf.replace(/\([^(]*\)/g, ''); | ||
@@ -26,1 +28,3 @@ let parts = mf.split(/(?=[A-Z ])/); | ||
} | ||
module.exports = groupsToSequence; |
@@ -1,3 +0,18 @@ | ||
export * from './groups.js'; | ||
export * from './groupsObject.js'; | ||
export * from './groupsToSequence.js'; | ||
'use strict'; | ||
const groups = require('./groups.js'); | ||
const groupsToSequence = require('./groupsToSequence'); | ||
function getGroupsObject() { | ||
let object = {}; | ||
groups.forEach((e) => { | ||
object[e.symbol] = e; | ||
}); | ||
return object; | ||
} | ||
module.exports = { | ||
groups, | ||
getGroupsObject, | ||
groupsToSequence, | ||
}; |
Sorry, the diff of this file is too big to display
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
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
143246
9
90