Skip to content

Commit

Permalink
Better typing in test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Mesquita-Morris committed Apr 30, 2023
1 parent e3ceb18 commit 9be200c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ exports.criteria = criteria;
// private implementation of the pivot function; required for the recursive call which does not use the public interface.
const pivotImplementation = (source, first, second, ...others) => {
const matrix = first.map(() => []);
// for (var si = 0; si < source.length; ++si) {
// var value = source[si];
for (var value of source) {
for (var di = 0; di < first.length; ++di) {
if (first[di](value)) {
Expand Down
10 changes: 5 additions & 5 deletions src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ interface Person {
nationality: Nationality;
}

const arnold = { name: 'Arnold', gender: 'male', age: 60, nationality: Nationality.American };
const emily = { name: 'Emily', gender: 'female', age: 67, nationality: Nationality.American };
const seamus = { name: 'Seamus', gender: 'male', age: 67, nationality: Nationality.British };
const eugene = { name: 'Eugene', gender: 'male', age: 75, nationality: Nationality.British };
const arnold: Person = { name: 'Arnold', gender: 'male', age: 60, nationality: Nationality.American };
const emily: Person = { name: 'Emily', gender: 'female', age: 67, nationality: Nationality.American };
const seamus: Person = { name: 'Seamus', gender: 'male', age: 67, nationality: Nationality.British };
const eugene: Person = { name: 'Eugene', gender: 'male', age: 75, nationality: Nationality.British };

const data = [arnold, emily, seamus, eugene];
const data: Array<Person> = [arnold, emily, seamus, eugene];

// derive nationality and gender dimensions from the person data
const nationality = Object.values(Nationality).map(criteria('nationality'));
Expand Down

0 comments on commit 9be200c

Please sign in to comment.