Skip to content

Commit

Permalink
Increase maxIterations
Browse files Browse the repository at this point in the history
  • Loading branch information
JAForbes committed Feb 11, 2024
1 parent e18ad83 commit fda396d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function safe(
let mode: Mode = "initialize";
let prevMode: Mode = "initialize";
let score = 0;
const maxIterations = path.length + pattern.length + 1;
const maxIterations = path.length + pattern.length + 2;
let iterations = 0;
// eslint-disable-next-line no-constant-condition
while (true) {
Expand Down
9 changes: 9 additions & 0 deletions test/fromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,12 @@ test("fromPath: complex", () => {
},
]);
});

test("fromPath: odin", () => {

const res = safe("/data/schedules", "/data/schedules/:schedule_id")

assert( res.tag == 'Left')
assert.match(res.value.message, /variable ':schedule_id'/)
console.log(res)
})

0 comments on commit fda396d

Please sign in to comment.