Skip to content

Commit

Permalink
add test + update dependancies
Browse files Browse the repository at this point in the history
  • Loading branch information
OrderAndCh4oS committed Sep 9, 2020
1 parent 7a209d3 commit 9d391bd
Show file tree
Hide file tree
Showing 7 changed files with 1,020 additions and 1,135 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@ const arr: IObj[] = [

const sortColumns: ISortColumns = makeSortColumns<IObj>(arr);

const sortedByNameAsc = arr.sort(sortOnColumn<IObj>('name', sortColumns['name']));
// Sort on 'name'
const sortedByNameAsc = arr.sort(sortOnColumn<IObj>('name', sortColumns.name));
console.log('Name Asc', sortedByNameAsc);

sortColumns['name'] = !sortColumns['name'];
sortColumns.name = !sortColumns.name;

const sortedByNameDesc = arr.sort(sortOnColumn<IObj>('name', sortColumns['name']));
const sortedByNameDesc = arr.sort(sortOnColumn<IObj>('name', sortColumns.name));
console.log('Name Desc', sortedByNameDesc);

// Sort on 'value'
const sortedByValueAsc = arr.sort(sortOnColumn<IObj>('value', sortColumns.value));
console.log('Value Asc', sortedByValueAsc);

sortColumns.value = !sortColumns.value;

const sortedByValueDesc = arr.sort(sortOnColumn<IObj>('value', sortColumns.value));
console.log('Value Desc', sortedByValueDesc);
```

## License
Expand Down
531 changes: 381 additions & 150 deletions example/package-lock.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = {
transform: {
"^.+\\.tsx?$": "ts-jest",
},
transform: { "^.+\\.tsx?$": "ts-jest" },
testRegex: "(/tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
};
Loading

0 comments on commit 9d391bd

Please sign in to comment.