From 6d88db5c73ea54063190830da3d1a40421c51bf3 Mon Sep 17 00:00:00 2001 From: qige2016 <286882998@qq.com> Date: Mon, 15 Jun 2020 12:00:17 +0800 Subject: [PATCH] fix[plop]: set trim => trim() (#3254) notEmpty --- plop-templates/utils.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/plop-templates/utils.js b/plop-templates/utils.js index 0310ca02..04987539 100644 --- a/plop-templates/utils.js +++ b/plop-templates/utils.js @@ -1,9 +1,2 @@ -exports.notEmpty = name => { - return v => { - if (!v || v.trim === '') { - return `${name} is required` - } else { - return true - } - } -} +exports.notEmpty = name => v => + !v || v.trim() === '' ? `${name} is required` : true