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

Function walk

src/plot_api/plot_schema.js:594–609  ·  view source on GitHub ↗
(attr)

Source from the content-addressed store, hash-verified

592// to ensure JSON.stringify(PlotSchema.get()) gives the intended result.
593function stringify(attrs) {
594 function walk(attr) {
595 for(var k in attr) {
596 if(isPlainObject(attr[k])) {
597 walk(attr[k]);
598 } else if(Array.isArray(attr[k])) {
599 for(var i = 0; i < attr[k].length; i++) {
600 walk(attr[k][i]);
601 }
602 } else {
603 // as JSON.stringify(/test/) // => {}
604 if(attr[k] instanceof RegExp) {
605 attr[k] = attr[k].toString();
606 }
607 }
608 }
609 }
610
611 walk(attrs);
612}

Callers 1

stringifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…