MCPcopy
hub / github.com/baidu/amis / getSchemaTpl

Function getSchemaTpl

packages/amis-editor-core/src/tpl.tsx:11–31  ·  view source on GitHub ↗
(
  name: string,
  patch?: object,
  options?: object
)

Source from the content-addressed store, hash-verified

9} = {};
10
11export function getSchemaTpl(
12 name: string,
13 patch?: object,
14 options?: object
15): any {
16 const tpl = tpls[name] || {};
17 let schema = null;
18
19 if (typeof tpl === 'function') {
20 schema = tpl(patch, options);
21 } else {
22 schema = patch
23 ? {
24 ...tpl,
25 ...patch
26 }
27 : tpl;
28 }
29
30 return schema;
31}
32
33export function setSchemaTpl(name: string, value: any) {
34 tpls[name] = value;

Callers 15

LogPluginClass · 0.90
DrawerPluginClass · 0.90
StatusPluginClass · 0.90
Table2.tsxFile · 0.90
Table2PluginClass · 0.90
NavPluginClass · 0.90
MarkdownPluginClass · 0.90
AnchorNavPluginClass · 0.90
PlainPluginClass · 0.90
ButtonPluginClass · 0.90
CollapsePluginClass · 0.90
AlertPluginClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected