MCPcopy Create free account
hub / github.com/apitable/apitable / generateKey

Function generateKey

packages/datasheet/src/pc/utils/flat.ts:22–26  ·  view source on GitHub ↗
(contextItem: IContextMenuItemProps, text2Id: boolean, index: number)

Source from the content-addressed store, hash-verified

20import { IContextMenuItemProps } from '@apitable/components';
21
22const generateKey = (contextItem: IContextMenuItemProps, text2Id: boolean, index: number) => {
23 const { id, text } = contextItem;
24 if (!text2Id) return id;
25 return isValidElement(text) ? index : text;
26};
27
28export const flatContextData = (contextData: Partial<IContextMenuItemProps>[], text2Id = false): IContextMenuItemProps[] => {
29 const dfs = (childList: IContextMenuItemProps[], groupId: string, index = 0) => {

Callers 2

dfsFunction · 0.85
flatContextDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected