Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atom-sorter

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atom-sorter - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"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;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc