Skip to content

Commit

Permalink
Fix issue with index out of bounds error in indexMapper
Browse files Browse the repository at this point in the history
Signed-off-by: sayan404 <sayanmajumder0002@gmail.com>
  • Loading branch information
sayan404 committed Mar 28, 2024
1 parent a7e014d commit 3866c09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/node/builtin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// mappers to store all the mappers of required drafts in an array.
const drafts = ['draft3', 'draft4', 'draft6', 'draft7', '2019-09', '2020-12']
// indexMapper maps drafts to their index in the mappers array. This is used to find the subarray of mappers to be returned.
const indexMapper = new Map(drafts.map((draft, index) => [draft, index * 2]))
const indexMapper = new Map(drafts.map((draft, index) => [draft, index]))
const loadRequiredRules = (fromIndex, toIndex) => {
const mappers = []
for (let index = fromIndex; index <= toIndex; index++) {
Expand Down

0 comments on commit 3866c09

Please sign in to comment.