chimpanzee
Advanced tools
Comparing version 0.0.27 to 0.0.28
@@ -29,8 +29,8 @@ "use strict"; | ||
function fn(obj, context, key) { | ||
return schemas.length ? function run(schemas) { | ||
return schemas.length ? function run(schemas, nonMatching = []) { | ||
const newContext = _extends({}, context); | ||
return (0, _utils.waitForSchema)(schemas[0], obj, newContext, key, function (result) { | ||
return result instanceof _results.Match ? result : schemas.length > 1 ? function () { | ||
return run(schemas.slice(1)); | ||
} : new _results.Skip("None of the items matched.", { obj, context, key }, meta); | ||
return run(schemas.slice(1), nonMatching.concat(result)); | ||
} : new _results.Skip("None of the items matched.", { obj, context, key, nonMatching }, meta); | ||
}); | ||
@@ -37,0 +37,0 @@ }(schemas) : new _results.Empty({ obj, context, key }, meta); |
@@ -65,7 +65,8 @@ "use strict"; | ||
return x; | ||
}) || function (result) { | ||
}) || function () { | ||
const result = builder.get(obj, context, key); | ||
return [_results.Match, _results.Skip, _results.Fault].some(function (resultType) { | ||
return result instanceof resultType; | ||
}) ? result : new _results.Match(result, { obj, context, key }, meta); | ||
}(builder.get(obj, context, key)); | ||
}(); | ||
}() : fn; | ||
@@ -72,0 +73,0 @@ }; |
{ | ||
"name": "chimpanzee", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"author": "Jeswin<jeswinpk@agilehead.com>", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
150079
963