Socket
Socket
Sign inDemoInstall

atom-sorter

Package Overview
Dependencies
0
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.11 to 1.2.0

src/__tests__/test.js

12

package.json
{
"name": "atom-sorter",
"version": "1.1.11",
"version": "1.2.0",
"description": "Callback allowing to sort chemical elements (atoms) in Hill order",
"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/atom-sorter#readme",
"gitHead": "bd2c06e05f2196c5f9c6ff011cf3ef41e1b6a0f9"
"homepage": "https://github.com/cheminfo/mass-tools/tree/master/packages/atom-sorter#readme",
"gitHead": "ade929b07af4e2f0f8b3fe1aaf0df70c50f4b2db"
}

@@ -6,2 +6,4 @@ # atom-sorter

.
## Installation

@@ -14,6 +16,6 @@

```js
import { atomSorter } from 'atom-sorter';
import atomSorter from 'atom-sorter';
['C', 'O', 'N', 'H'].sort(atomSorter);
// result is : ['C', 'H', 'N', 'O']
['C', 'O', 'N', 'H'].osrt(atomSorter);
// result is ...
```

@@ -20,0 +22,0 @@

@@ -1,10 +0,4 @@

/**
* Implementation of the Hill system for sorting atoms
* https://en.wikipedia.org/wiki/Chemical_formula#Hill_system
* @param {string} a - first atom to compare
* @param {string} b - second atom to compare
* @returns
*/
'use strict';
export function atomSorter(a, b) {
function atomSorter(a, b) {
if (a === b) return 0;

@@ -18,1 +12,3 @@ if (a === 'C') return -1;

}
module.exports = atomSorter;
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc