* Tests if one or more parameters has been modified. If invoked with no * arguments, returns true if any parameter value has changed. If the first * argument is array, returns trues if any parameter name in the array has * changed. Otherwise, tests if the given name and optional array index
(name, index)
| 107429 | * @param {number} [index=undefined] - The parameter array index to test. |
| 107430 | * @return {boolean} - Returns true if a queried parameter was modified. |
| 107431 | */ modified (name, index) { |
| 107432 | const mod = this[CACHE]; |
| 107433 | if (!arguments.length) { |
| 107434 | for(const k in mod){ |
| 107435 | if (mod[k]) return true; |
| 107436 | } |
| 107437 | return false; |
| 107438 | } else if ((0, _vegaUtil.isArray)(name)) { |
| 107439 | for(let k = 0; k < name.length; ++k){ |
| 107440 | if (mod[name[k]]) return true; |
| 107441 | } |
| 107442 | return false; |
| 107443 | } |
| 107444 | return index != null && index >= 0 ? index + 1 < mod[name] || !!mod[index + ":" + name] : !!mod[name]; |
| 107445 | }, |
| 107446 | /** |
| 107447 | * Clears the modification records. After calling this method, |
| 107448 | * all parameters are considered unmodified. |