MCPcopy Create free account
hub / github.com/plotly/plotly.js / parseOption

Function parseOption

stackgl_modules/index.js:11750–11768  ·  view source on GitHub ↗
(nest, cons, name)

Source from the content-addressed store, hash-verified

11748
11749 //Option parsing helper functions
11750 function parseOption(nest, cons, name) {
11751 if(name in options) {
11752 var opt = options[name]
11753 var prev = this[name]
11754 var next
11755 if(nest ? (isArrayOrTypedArray(opt) && isArrayOrTypedArray(opt[0])) :
11756 isArrayOrTypedArray(opt) ) {
11757 this[name] = next = [ cons(opt[0]), cons(opt[1]), cons(opt[2]) ]
11758 } else {
11759 this[name] = next = [ cons(opt), cons(opt), cons(opt) ]
11760 }
11761 for(var i=0; i<3; ++i) {
11762 if(next[i] !== prev[i]) {
11763 return true
11764 }
11765 }
11766 }
11767 return false
11768 }
11769
11770 var NUMBER = parseOption.bind(this, false, Number)
11771 var BOOLEAN = parseOption.bind(this, false, Boolean)

Callers

nothing calls this directly

Calls 1

isArrayOrTypedArrayFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…