'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.dataToArray = dataToArray; exports.addEventListener = addEventListener; exports.removeEventListener = removeEventListener; exports.transformArguments = transformArguments; function dataToArray(vars) { if (Array.isArray(vars)) { return vars; } return [vars]; } var transitionEndObject = { transition: 'transitionend', WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend' }; var transitionStr = exports.transitionStr = Object.keys(transitionEndObject).filter(function (key) { if (typeof document === 'undefined') { return false; } var html = document.getElementsByTagName('html')[0]; return key in (html ? html.style : {}); })[0]; var transitionEnd = exports.transitionEnd = transitionEndObject[transitionStr]; function addEventListener(target, eventType, callback, options) { if (target.addEventListener) { target.addEventListener(eventType, callback, options); } else if (target.attachEvent) { target.attachEvent('on' + eventType, callback); } } function removeEventListener(target, eventType, callback, options) { if (target.removeEventListener) { target.removeEventListener(eventType, callback, options); } else if (target.attachEvent) { target.detachEvent('on' + eventType, callback); } } function transformArguments(arg, cb) { var result = void 0; if (typeof arg === 'function') { result = arg(cb); } else { result = arg; } if (Array.isArray(result)) { if (result.length === 2) { return result; } return [result[0], result[1]]; } return [result]; } var isNumeric = exports.isNumeric = function isNumeric(value) { return !isNaN(parseFloat(value)) && isFinite(value); // eslint-disable-line };