From 83fa7205bc39681ca209b3d1c1f4ef390434d24a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 11 Nov 2021 19:06:30 +0100 Subject: [PATCH] Add hasValue method to Property --- src/style_manager/model/Property.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index d008ec34f..78dd71eaf 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -84,7 +84,16 @@ export default class Property extends Model { */ getValue() { const val = this.get('value'); - return isUndefined(val) || val === '' ? this.getDefaultValue() : val; + return !this.hasValue() ? this.getDefaultValue() : val; + } + + /** + * Check if the property has value + * @returns {Boolean} + */ + hasValue() { + const val = this.get('value'); + return !isUndefined(val) && val !== ''; } /**