Skip to content

Commit

Permalink
Fixed sort issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SanichKotikov committed Mar 22, 2021
1 parent 8c202de commit caf9af6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "relatives-tree",
"version": "3.0.0",
"version": "3.0.1",
"description": "Calculates families and nodes positions for rendering a family tree",
"main": "lib/index.js",
"module": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const toMap = <T extends { id: any }>(items: readonly T[]): Map<T['id'],
);

export const hasDiffParents = (node: Node): boolean => node.parents.map(prop('type')).filter(unique).length > 1;
export const byGender = (target: Gender) => (a: Node, b: Node) => (b.gender !== target) ? -1 : 0;
export const byGender = (target: Gender) => (a: Node, b: Node) => (b.gender !== target) ? -1 : 1;

export const relToNode = (store: Store) => (rel: Relation) => store.getNode(rel.id);
export const withRelType = (...types: readonly Relation['type'][]) => (item: Relation) => types.includes(item.type);

0 comments on commit caf9af6

Please sign in to comment.