Skip to content

Commit 91612bb

Browse files
committedAug 12, 2024·
Revert "Update cast.js"
This reverts commit e3a9e65.
1 parent 6308686 commit 91612bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/cast.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = function cast(schema, obj, options, context) {
6565
if (!Array.isArray(val)) {
6666
throw new CastError('Array', val, path);
6767
}
68-
for (let k = 0; k < val.length; ++k) {
68+
for (let k = val.length - 1; k >= 0; k--) {
6969
if (val[k] == null || typeof val[k] !== 'object') {
7070
throw new CastError('Object', val[k], path + '.' + k);
7171
}

0 commit comments

Comments
 (0)
Please sign in to comment.