MCPcopy
hub / github.com/toeverything/AFFiNE / getRecordKey

Function getRecordKey

tools/doc-diff/src/table.ts:14–23  ·  view source on GitHub ↗
(record: YMap<any>, keyField: string)

Source from the content-addressed store, hash-verified

12};
13
14function getRecordKey(record: YMap<any>, keyField: string): string | null {
15 const keyRaw = record.get(keyField);
16 if (typeof keyRaw === 'string') {
17 return keyRaw;
18 }
19 if (typeof keyRaw?.toString === 'function') {
20 return keyRaw.toString();
21 }
22 return null;
23}
24
25function isDeletedRecord(record: YMap<any>): boolean {
26 return record.get(DELETE_FLAG_KEY) === true || record.size === 0;

Callers 1

extractYjsTableFunction · 0.85

Calls 2

getMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected