Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (typeof(opts.visibility) === 'undefined') {
opts.visibility = 'visible';
}
if (opts.progress) {
throw new Error("liquid-fire's 'animate' function reserves the use of Velocity's 'progress' option for its own nefarious purposes.");
}
opts.progress = function(){
state.percentComplete = arguments[1];
state.timeRemaining = arguments[2];
state.timeSpent = state.timeRemaining / (1/state.percentComplete - 1);
};
state.promise = Promise.resolve(Velocity.animate(elt[0], props, opts));
if (label) {
state.promise = state.promise.then(function(){
clearLabel(elt, label);
}, function(err) {
clearLabel(elt, label);
throw err;
});
applyLabel(elt, label, state);
}
return state.promise;
}