From d28810eb6453b193c554ac0de16bbe8b07d9a2ae Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 3 Jun 2020 01:58:34 +0200 Subject: [PATCH] Fix function handling --- README.md | 4 ++++ index.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index db1781c..074fbd9 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,10 @@ Note that this also means that a custom error-throwing handler is not possible i ## Changelog +### v1.0.1 (June 3, 2020) + +* __Bugfix:__ Fixed function handling; they were interpreted as literals in non-literal mode and vice versa. It now works correctly, according to what the documentation specifies. + ### v1.0.0 (March 23, 2020) Initial release. diff --git a/index.js b/index.js index 29308ff..dae373a 100644 --- a/index.js +++ b/index.js @@ -22,9 +22,9 @@ function doMatchValue(value, arms, functionsAreLiterals) { } module.exports = function matchValue(value, arms) { - return doMatchValue(value, arms, true); + return doMatchValue(value, arms, false); }; module.exports.literal = function matchValueLiteral(value, arms) { - return doMatchValue(value, arms, false); + return doMatchValue(value, arms, true); };