Skip to content

Commit

Permalink
fix: remove num-sort dep (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 authored Feb 11, 2024
1 parent c43482e commit 66fac3e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"description": "Compares two spectra using a tree similarity",
"main": "lib/index.js",
"module": "src/index.js",
"types": "tree-similarity.d.ts",
"files": [
"lib",
"src"
"src",
"tree-similarity.d.ts"
],
"scripts": {
"compile": "rollup -c",
Expand Down Expand Up @@ -40,7 +42,6 @@
},
"dependencies": {
"binary-search": "^1.3.6",
"cheminfo-types": "^1.7.2",
"num-sort": "^3.0.0"
"cheminfo-types": "^1.7.2"
}
}
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export default {
format: 'cjs',
file: 'lib/index.js'
},
external: ['binary-search', 'num-sort']
external: ['binary-search']
};
9 changes: 4 additions & 5 deletions src/createTree.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import binarySearch from 'binary-search';
import { numberSortAscending } from 'num-sort';

/**
* @typedef {import("../types").Tree} Tree
* @typedef {import("../types").CreateTreeOptions} CreateTreeOptions
* @typedef {import("../types").Spectrum} Spectrum
* @typedef {import("../tree-similarity").Tree} Tree
* @typedef {import("../tree-similarity").CreateTreeOptions} CreateTreeOptions
* @typedef {import("../tree-similarity").Spectrum} Spectrum
*/

/**
Expand All @@ -31,7 +30,7 @@ function mainCreateTree(x, y, from, to, minWindow, threshold) {
}

// search first point
let start = binarySearch(x, from, numberSortAscending);
let start = binarySearch(x, from, (a, b) => a - b);
if (start < 0) {
start = ~start;
}
Expand Down
4 changes: 2 additions & 2 deletions src/treeSimilarity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import("../types").Tree} Tree
* @typedef {import("../types").TreeSimilarityOptions} TreeSimilarityOptions
* @typedef {import("../tree-similarity").Tree} Tree
* @typedef {import("../tree-similarity").TreeSimilarityOptions} TreeSimilarityOptions
*/
/**
* Similarity between two nodes
Expand Down
File renamed without changes.

0 comments on commit 66fac3e

Please sign in to comment.