MCPcopy Create free account
hub / github.com/ElemeFE/element-react / markNodeData

Function markNodeData

src/tree/model/util.js:3–11  ·  view source on GitHub ↗
(node, data)

Source from the content-addressed store, hash-verified

1export const NODE_KEY = '$treeNodeId';
2
3export const markNodeData = function(node, data) {
4 if (data[NODE_KEY]) return;
5 Object.defineProperty(data, NODE_KEY, {
6 value: node.id,
7 enumerable: false,
8 configurable: false,
9 writable: false
10 });
11};
12
13export const getNodeKey = function(key, data) {
14 if (!key) return data[NODE_KEY];

Callers 1

setDataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected