Skip to content

Commit

Permalink
Cleanup tuple as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurits Rijk committed Jul 3, 2017
1 parent 25be434 commit 996260d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/tuple.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const _ = require('lodash');

const {invalidString} = require('./conform');
const {explainData} = require('./explainData');
const {explainData, firstProblem} = require('./explainData');
const {gen} = require('./gen');
const isValid = require('./isValid');

Expand Down Expand Up @@ -37,15 +37,7 @@ function* explainInvalid(values, predicates, via) {
const index = _.findIndex(pairs, isInvalid);
if (index !== -1) {
const [spec, val] = pairs[index];

const {pred} = explainData(spec, val).problems[0];
yield {
path: [index],
pred,
val,
via,
'in': [index]
};
yield* firstProblem(spec, val, {path: [index], via, _in: [index]})
}
}

Expand Down

0 comments on commit 996260d

Please sign in to comment.