From d6498a55a5d66696108981210564243dbfb5f3b0 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 28 Mar 2022 23:42:47 -0400 Subject: [PATCH] Fixed faulty Proxy check (#229) --- CHANGELOG.md | 1 + src/v8n.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74f76d..56d6771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Correct incorrect return type of `check` validation strategy (boolean -> void) +- Bug with `Proxy` check where it always returned `true` ## [1.4.0] - 2022-02-17 diff --git a/src/v8n.js b/src/v8n.js index 3c9fbf6..7072acc 100644 --- a/src/v8n.js +++ b/src/v8n.js @@ -2,7 +2,7 @@ import Context from './Context'; import optional from './rules/optional'; function v8n() { - return typeof Proxy !== undefined + return typeof Proxy !== 'undefined' ? proxyContext(new Context()) : proxylessContext(new Context()); }