(opts = {})
| 11 | } |
| 12 | |
| 13 | const validate = function(opts = {}) { |
| 14 | |
| 15 | opts = Object.assign({}, opts) |
| 16 | |
| 17 | if (Number.isFinite(opts.index) === false) opts.index = 0 |
| 18 | |
| 19 | if (opts.arrows !== false) opts.arrows = true |
| 20 | if (opts.dots !== false) opts.dots = true |
| 21 | |
| 22 | if (typeof opts.beforeChange !== 'function') opts.beforeChange = () => {} |
| 23 | if (typeof opts.afterChange !== 'function') opts.afterChange = () => {} |
| 24 | |
| 25 | return opts |
| 26 | |
| 27 | } |
| 28 | |
| 29 | const renderSlider = function(elem, refs, opts) { |
| 30 |