From 1743a2259c40fc363892b25d3a845a850b5dbef7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Mon, 16 May 2022 09:46:04 +0200
Subject: [PATCH] feat: add flag to ParamDefinition.checkValueAgainstDomain()
 to force validation

refs #309
---
 src/param/param-definition.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/param/param-definition.ts b/src/param/param-definition.ts
index 10e50540..b47b066b 100644
--- a/src/param/param-definition.ts
+++ b/src/param/param-definition.ts
@@ -581,8 +581,8 @@ export class ParamDefinition implements INamedIterableValues, IObservable {
      * Validates the given numeric value against the definition domain; throws
      * an error if value is outside the domain
      */
-    public checkValueAgainstDomain(v: number) {
-        if (this._allowInvalidValues) {
+    public checkValueAgainstDomain(v: number, force: boolean = false) {
+        if (!force && this._allowInvalidValues) {
             return;
         }
 
-- 
GitLab