MCPcopy
hub / github.com/xaboy/form-create / component

Function component

packages/core/src/frame/index.js:135–155  ·  view source on GitHub ↗
(id, component)

Source from the content-addressed store, hash-verified

133 }
134
135 function component(id, component) {
136 let name;
137 if (is.String(id)) {
138 name = id;
139 if (component === undefined) {
140 return components[name];
141 }
142 } else {
143 name = id.displayName || id.name;
144 component = id;
145 }
146 if (!name || !component) return;
147 const nameAlias = toCase(name);
148 components[name] = component;
149 components[nameAlias] = component;
150 delete CreateNode.aliasMap[name];
151 delete CreateNode.aliasMap[nameAlias];
152 delete parsers[name];
153 delete parsers[nameAlias];
154 if (component.formCreateParser) parser(name, component.formCreateParser);
155 }
156
157 function $form() {
158 return $FormCreate(FormCreate, components, directives);

Callers

nothing calls this directly

Calls 2

toCaseFunction · 0.85
parserFunction · 0.85

Tested by

no test coverage detected