MCPcopy Index your code
hub / github.com/electerious/basicSlider / validate

Function validate

src/scripts/main.js:13–27  ·  view source on GitHub ↗
(opts = {})

Source from the content-addressed store, hash-verified

11}
12
13const 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
29const renderSlider = function(elem, refs, opts) {
30

Callers 1

createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected