Skip to content

Commit

Permalink
try/catch in get
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Nov 19, 2023
1 parent e714eb6 commit fcf2b38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/squint/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,10 @@ export function get(coll, key, otherwise = undefined) {
// we choose .get as the default implementation, e.g. fetch Headers are not Maps, but do implement a .get method
let g = coll['get'];
if (g instanceof Function) {
try {
v = coll.get(key);
break;
break;
} catch (e) {}
}
v = coll[key];
break;
Expand Down

0 comments on commit fcf2b38

Please sign in to comment.