MCPcopy Index your code
hub / github.com/plotly/dash / validateMap

Function validateMap

dash/dash-renderer/src/actions/dependencies.js:611–647  ·  view source on GitHub ↗
(map, cls, doState)

Source from the content-addressed store, hash-verified

609 }
610
611 function validateMap(map, cls, doState) {
612 for (const id in map) {
613 const idProps = map[id];
614 const fcb = flatten(values(idProps));
615 const optional = fcb.reduce((acc, cb) => {
616 if (acc === false || cb.optional) {
617 return acc;
618 }
619 const deps = concat(cb.outputs, cb.inputs, cb.states).filter(
620 dep => dep.id === id
621 );
622 return (
623 !deps.length ||
624 all(({allow_optional}) => allow_optional, deps)
625 );
626 }, true);
627 if (optional) {
628 continue;
629 }
630 const idPath = getPath(paths, id);
631 if (!idPath) {
632 if (validateIds) {
633 missingId(id, cls, fcb);
634 }
635 } else {
636 for (const property in idProps) {
637 const callbacks = idProps[property];
638 validateProp(id, idPath, property, cls, callbacks);
639 if (doState) {
640 // It would be redundant to check state on both inputs
641 // and outputs - so only set doState for outputs.
642 callbacks.forEach(validateState);
643 }
644 }
645 }
646 }
647 }
648
649 validateMap(outputMap, 'Output', true);
650 validateMap(inputMap, 'Input');

Callers 1

Calls 6

getPathFunction · 0.90
valuesFunction · 0.85
missingIdFunction · 0.85
validatePropFunction · 0.85
reduceMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…