diff --git a/HISTORY.md b/HISTORY.md index 52570e75..e45af375 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,10 @@ http://visjs.org - Improved function `fit()` to take into account the actual width of items. +### Graph2D + +- Fixed #892, addressed any case in validator. + ## 2015-05-28, version 4.1.0 diff --git a/lib/shared/Validator.js b/lib/shared/Validator.js index cd9d8339..2af6889b 100644 --- a/lib/shared/Validator.js +++ b/lib/shared/Validator.js @@ -109,8 +109,8 @@ class Validator { else if (refOptionObj['fn'] !== undefined && optionType === 'function') { // item is a function, which is allowed } - else { - // type of the field is incorrect + else if (refOptionObj['any'] === undefined) { + // type of the field is incorrect and the field cannot be any console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle); errorFound = true; }