From 84110722d104badf5f832e525b604ff6217b8c39 Mon Sep 17 00:00:00 2001 From: Danny Ouellet Date: Wed, 5 Feb 2020 12:39:39 -0500 Subject: [PATCH 1/4] console.error to console.warning --- src/createBaseForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createBaseForm.js b/src/createBaseForm.js index bd7bfdcc..099b0425 100644 --- a/src/createBaseForm.js +++ b/src/createBaseForm.js @@ -635,9 +635,9 @@ function createBaseForm(option = {}, mixins = []) { }); pending.catch(e => { // eslint-disable-next-line no-console - if (console.error && process.env.NODE_ENV !== 'production') { + if (console.warning && process.env.NODE_ENV !== 'production') { // eslint-disable-next-line no-console - console.error(e); + console.warning(e); } return e; }); From b101e1fb28bfbe38d6db41baf578084628e844d4 Mon Sep 17 00:00:00 2001 From: Danny Ouellet Date: Wed, 5 Feb 2020 12:57:03 -0500 Subject: [PATCH 2/4] Add suppressWarning support --- src/createBaseForm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/createBaseForm.js b/src/createBaseForm.js index 099b0425..1652faa9 100644 --- a/src/createBaseForm.js +++ b/src/createBaseForm.js @@ -585,6 +585,7 @@ function createBaseForm(option = {}, mixins = []) { }, validateFields(ns, opt, cb) { + const { names, options } = getParams(ns, opt, cb); const pending = new Promise((resolve, reject) => { const { names, options } = getParams(ns, opt, cb); let { callback } = getParams(ns, opt, cb); @@ -635,9 +636,9 @@ function createBaseForm(option = {}, mixins = []) { }); pending.catch(e => { // eslint-disable-next-line no-console - if (console.warning && process.env.NODE_ENV !== 'production') { + if (console.warn && process.env.NODE_ENV !== 'production' && !options.suppressWarning) { // eslint-disable-next-line no-console - console.warning(e); + console.warn(e); } return e; }); From 1a6e27d097c20dee9a7ccc4fb1a02ce78d5212e0 Mon Sep 17 00:00:00 2001 From: Danny Ouellet Date: Wed, 5 Feb 2020 13:01:53 -0500 Subject: [PATCH 3/4] Duplicated line --- src/createBaseForm.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/createBaseForm.js b/src/createBaseForm.js index 1652faa9..a4b49fe7 100644 --- a/src/createBaseForm.js +++ b/src/createBaseForm.js @@ -587,7 +587,6 @@ function createBaseForm(option = {}, mixins = []) { validateFields(ns, opt, cb) { const { names, options } = getParams(ns, opt, cb); const pending = new Promise((resolve, reject) => { - const { names, options } = getParams(ns, opt, cb); let { callback } = getParams(ns, opt, cb); if (!callback || typeof callback === 'function') { const oldCb = callback; From 4dd0b818409027332d5f249b39ded506c9d686a7 Mon Sep 17 00:00:00 2001 From: Danny Ouellet Date: Sun, 20 Sep 2020 08:39:04 -0400 Subject: [PATCH 4/4] Update createBaseForm.js --- src/createBaseForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/createBaseForm.js b/src/createBaseForm.js index a4b49fe7..ad295e73 100644 --- a/src/createBaseForm.js +++ b/src/createBaseForm.js @@ -585,7 +585,7 @@ function createBaseForm(option = {}, mixins = []) { }, validateFields(ns, opt, cb) { - const { names, options } = getParams(ns, opt, cb); + const { names, options } = getParams(ns, opt, cb); const pending = new Promise((resolve, reject) => { let { callback } = getParams(ns, opt, cb); if (!callback || typeof callback === 'function') {