From 3383783f3c6383b7de6901157d085a123ae0ba49 Mon Sep 17 00:00:00 2001 From: Jonson Petard <41122242+greenhat616@users.noreply.github.com> Date: Mon, 14 Sep 2020 21:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8E=20types=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=A1=A8=E7=8E=B0=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/util/index.js b/util/index.js index 4ecd4ec..06aade5 100644 --- a/util/index.js +++ b/util/index.js @@ -1,5 +1,6 @@ module.exports = { toBoolean(val) { + if (typeof val === 'boolean') return val if (val === '') return val return val === 'true' || val == '1' },