« get me outta code hell

find: don't assume {mode} object to destructure from - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-02 19:05:37 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-02 19:05:37 -0300
commitd00f71c185123b4d68ab4738e5dc0edae06d6762 (patch)
tree896e72c585f93870ba2138ac6d3300ffa327f829
parent161db8862cef023f5076c4495e48202d54d8b84a (diff)
find: don't assume {mode} object to destructure from
-rw-r--r--src/find.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/find.js b/src/find.js
index c8edce9..716aca5 100644
--- a/src/find.js
+++ b/src/find.js
@@ -69,7 +69,7 @@ function findHelper({
   // errors for null matches (with details about the error), while 'warn' and
   // 'quiet' both return null, with 'warn' logging details directly to the
   // console.
-  return (fullRef, data, {mode = 'warn'}) => {
+  return (fullRef, data, {mode = 'warn'} = {}) => {
     if (!fullRef) return null;
     if (typeof fullRef !== 'string') {
       throw new TypeError(`Expected a string, got ${typeAppearance(fullRef)}`);