MCPcopy Create free account
hub / github.com/dashnowords/imfe / validateLoop

Function validateLoop

chapter17/velocity.js:692–708  ·  view source on GitHub ↗

* Validate a loop option.

(value)

Source from the content-addressed store, hash-verified

690 * Validate a <code>loop</code> option.
691 */
692 function validateLoop(value) {
693 switch (value) {
694 case false:
695 return 0;
696 case true:
697 return true;
698 default:
699 var parsed = parseInt(value, 10);
700 if (!isNaN(parsed) && parsed >= 0) {
701 return parsed;
702 }
703 break;
704 }
705 if (value != null) {
706 console.warn("VelocityJS: Trying to set 'loop' to an invalid value:", value);
707 }
708 }
709 /**
710 * Validate a <code>progress</code> option.
711 */

Callers 3

velocity.jsFile · 0.85
optionFunction · 0.85
Velocity$1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected