scancss
Version:
A robust CSS stylesheet statistics collector and analyzer
26 lines (20 loc) • 695 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isValidFramesFunctionArgs = isValidFramesFunctionArgs;
var _reIntegerString = require('../../constants/reIntegerString');
/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/single-transition-timing-function#Examples_3
*
* 1) The parameter must be an <integer> and cannot be a real value, even if it is equal to one.
* 2) The amount of frames must be non-negative.
* 3) There must be at least two frames.
*/
function isValidFramesFunctionArgs(func) {
const arg = func.slice(7, -1);
if (_reIntegerString.reIntegerString.test(arg) && Number(arg) >= 2) {
return true;
}
return false;
}