Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mrijk committed Aug 13, 2018
1 parent 854478c commit b637ca8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function _conform(specs, values) {
if (_.isEmpty(specs)) {
return _.isEmpty(values) ? {} : invalidString;
}

for (let [head, rest] of generate(values)) {
const [key, predicate] = _.head(specs);
const conformHead = conform(predicate, head, true);
Expand Down
1 change: 0 additions & 1 deletion lib/def.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ module.exports = {
registry,
spec
};

2 changes: 1 addition & 1 deletion lib/explain.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function explain(spec, value) {
function explainStr(spec, value) {
const explanation = explainData(spec, value);
if (explanation == null) {
return 'Success!\n';
return 'Success!\n';
} else {
const {via, pred, reason} = explanation.problems[0];
const specString = via[0] ? `spec: ${via[0]} ` : '';
Expand Down
4 changes: 2 additions & 2 deletions lib/gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ function gen(p) {
}

function generate(generator) {
return sample(generator, 1).next().value;
return sample(generator, 1).next().value;
}

function* sampleFromSpec(spec, n = 10) {
let failedAttempts = 0;

for (let s of sampleInf(gen(spec))) {
if (n === 0) {
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function keys({req = [], opt = []}) {
};
}

function* explainInvalid(val, keys, via, required) {
function* explainInvalid(val, keys, via, required) {
for (let key of keys) {
if (val[key]) {
yield* firstProblem(key, val[key], {via, _in: [key]});
Expand Down
4 changes: 2 additions & 2 deletions lib/mapOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ function _conform(kpred, vpred, options, value) {
if (checkCount(val, options)) {
const {conformKeys = false} = options;
let valid = true;

const result = {};
for (let [k, v] of val) {
const conformedKey = conform(kpred, k);
const conformedValue = conform(vpred, v);
valid = valid && conformedKey !== invalidString && conformedValue !== invalidString;
result[conformKeys ? conformedKey : k] = conformedValue;
}

return valid ? result : invalidString;
} else {
return invalidString;
Expand Down

0 comments on commit b637ca8

Please sign in to comment.