Skip to content
Snippets Groups Projects

Issue #1149078 by vasike, wuinfo - Bill Wu, dww, Gauravvvv, Marios...

Closed Issue #1149078 by vasike, wuinfo - Bill Wu, dww, Gauravvvv, Marios...
All threads resolved!
All threads resolved!
3 files
+ 186
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 10
0
@@ -149,6 +149,7 @@
*
* @prop {function} RegExp
* @prop {function} Function
* @prop {function} Array
* @prop {function} Number
*/
states.Dependent.comparisons = {
@@ -159,6 +160,15 @@
// The "reference" variable is a comparison function.
return reference(value);
},
Array(reference, value) {
// Make sure value is an array.
if (!Array.isArray(value)) {
return false;
}
// The arrays values should match.
return JSON.stringify(reference.sort()) === JSON.stringify(value.sort());
},
Number(reference, value) {
// If "reference" is a number and "value" is a string, then cast
// reference as a string before applying the strict comparison in
Loading