We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6308686 commit 91612bbCopy full SHA for 91612bb
lib/cast.js
@@ -65,7 +65,7 @@ module.exports = function cast(schema, obj, options, context) {
65
if (!Array.isArray(val)) {
66
throw new CastError('Array', val, path);
67
}
68
- for (let k = 0; k < val.length; ++k) {
+ for (let k = val.length - 1; k >= 0; k--) {
69
if (val[k] == null || typeof val[k] !== 'object') {
70
throw new CastError('Object', val[k], path + '.' + k);
71
0 commit comments