atom-sorter
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "atom-sorter", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Callback allowing to sort chemical elements (atoms) in Hill order", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -18,4 +18,8 @@ 'use strict'; | ||
expect(atoms).toEqual(['C', 'H', 'Br', 'Cl', 'N', 'O']); | ||
}); | ||
test('sort an array HCl', () => { | ||
let atoms = ['Cl', 'H']; | ||
atoms.sort((a, b) => atomSorter(a, b)); | ||
expect(atoms).toEqual(['H', 'Cl']); | ||
}); |
@@ -9,2 +9,3 @@ 'use strict'; | ||
if (a === 'H') return -1; | ||
if (b === 'H') return 1; | ||
if (a < b) return -1; | ||
@@ -11,0 +12,0 @@ return 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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
4614
30
1