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

string-natural-compare

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-natural-compare - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

13

natural-compare.js

@@ -80,2 +80,10 @@ 'use strict';

if (aIndex >= lengthA && bIndex < lengthB && lengthA >= lengthB) {
return -1;
}
if (bIndex >= lengthB && aIndex < lengthA && lengthB >= lengthA) {
return 1;
}
return lengthA - lengthB;

@@ -93,6 +101,9 @@ }

},
set: function(value) {
alphabet = value;
alphabetIndexMap = [];
var i = 0;
if (alphabet) {

@@ -103,3 +114,5 @@ for (; i < alphabet.length; i++) {

}
alphabetIndexMapLength = alphabetIndexMap.length;
for (i = 0; i < alphabetIndexMapLength; i++) {

@@ -106,0 +119,0 @@ if (alphabetIndexMap[i] === undefined) {

21

package.json
{
"name": "string-natural-compare",
"version": "2.0.2",
"version": "2.0.3",
"description": "Compare alphanumeric strings the same way a human would, using a natural order algorithm",

@@ -9,4 +9,3 @@ "author": "Nathan Woltman <nwoltman@outlook.com>",

"files": [
"natural-compare.js",
"LICENSE.txt"
"natural-compare.js"
],

@@ -22,11 +21,11 @@ "repository": {

"devDependencies": {
"coveralls": "^2.11.9",
"grunt": "~1.0.1",
"grunt-eslint": "^19.0.0",
"grunt-mocha-istanbul": "^5.0.1",
"grunt-mocha-test": "^0.13.2",
"istanbul": "^0.4.3",
"coveralls": "^3.0.2",
"grunt": "~1.0.3",
"grunt-eslint": "^21.0.0",
"grunt-mocha-istanbul": "^5.0.2",
"grunt-mocha-test": "^0.13.3",
"istanbul": "^0.4.5",
"jit-grunt": "^0.10.0",
"mocha": "^3.1.2",
"should": "^11.1.1"
"mocha": "^5.2.0",
"should": "^13.2.1"
},

@@ -33,0 +32,0 @@ "scripts": {

@@ -34,3 +34,7 @@ # String Natural Compare

```sh
# npm
npm install string-natural-compare --save
# yarn
yarn add string-natural-compare
```

@@ -65,3 +69,4 @@

);
// -> 1 (a number > 0)
// -> 1
// Other inputs with the same ordering as this may yield a different number > 0

@@ -68,0 +73,0 @@

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