MCPcopy
hub / github.com/udecode/plate / processPlugin

Function processPlugin

packages/core/src/internal/plugin/resolvePlugins.ts:465–486  ·  view source on GitHub ↗
(plugin: SlatePlugin)

Source from the content-addressed store, hash-verified

463 const pluginMap = new Map<string, SlatePlugin>();
464
465 const processPlugin = (plugin: SlatePlugin) => {
466 const resolvedPlugin = resolvePlugin(editor, plugin);
467
468 if (resolvedPlugin.key) {
469 const existingPlugin = pluginMap.get(resolvedPlugin.key);
470
471 if (existingPlugin) {
472 pluginMap.set(
473 resolvedPlugin.key,
474 mergePlugins(existingPlugin, resolvedPlugin)
475 );
476 } else {
477 pluginMap.set(resolvedPlugin.key, resolvedPlugin);
478 }
479 } else {
480 // If the plugin has no key, we just just skip it.
481 }
482
483 if (resolvedPlugin.plugins && resolvedPlugin.plugins.length > 0) {
484 resolvedPlugin.plugins.forEach(processPlugin);
485 }
486 };
487
488 plugins.forEach(processPlugin);
489

Callers

nothing calls this directly

Calls 4

resolvePluginFunction · 0.90
mergePluginsFunction · 0.90
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…