Skip to content

Commit

Permalink
refactor(compare): update deps, use new Fn types
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 5, 2020
1 parent 424f516 commit c3a4b97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/compare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@microsoft/api-extractor": "^7.9.11",
"@thi.ng/api": "^6.12.3",
"@types/mocha": "^8.0.3",
"@types/node": "^14.6.1",
"mocha": "^8.1.2",
Expand All @@ -48,9 +49,6 @@
"typedoc": "^0.18.0",
"typescript": "^4.0.2"
},
"dependencies": {
"@thi.ng/api": "^6.12.3"
},
"files": [
"*.js",
"*.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/compare/src/numeric.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import type { FnN2 } from "@thi.ng/api";

/**
* Numeric comparator (ascending order)
*
* @param a -
* @param b -
*/
export const compareNumAsc = (a: number, b: number) => a - b;
export const compareNumAsc: FnN2 = (a, b) => a - b;

/**
* Numeric comparator (descending order)
*
* @param a -
* @param b -
*/
export const compareNumDesc = (a: number, b: number) => b - a;
export const compareNumDesc: FnN2 = (a, b) => b - a;
2 changes: 1 addition & 1 deletion packages/compare/src/reverse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Comparator } from "@thi.ng/api";
import type { Comparator } from "@thi.ng/api";

/**
* HOF comparator. Returns new comparator with reversed order of given
Expand Down

0 comments on commit c3a4b97

Please sign in to comment.