MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / map

Method map

packages/shell/src/model/node-children.ts:145–149  ·  view source on GitHub ↗

* 类似数组的 map * @param fn

(fn: (node: IPublicModelNode, index: number) => T)

Source from the content-addressed store, hash-verified

143 * @param fn
144 */
145 map<T = any>(fn: (node: IPublicModelNode, index: number) => T): T[] | null {
146 return this[nodeChildrenSymbol].map<T>((item: InnerNode, index: number): T => {
147 return fn(ShellNode.create(item)!, index);
148 });
149 }
150
151 /**
152 * 类似数组的 every

Callers

nothing calls this directly

Calls 2

mapMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected