Function
checkForDuplicate
(list: T[], value: T, index: number)
Source from the content-addressed store, hash-verified
| 65 | const minItems = options?.minItems ?? 1 |
| 66 | |
| 67 | const checkForDuplicate = (list: T[], value: T, index: number): boolean => { |
| 68 | if (!options?.allowDuplicates && list.includes(value) && (index === -1 || list[index] !== value)) { |
| 69 | console.log('Duplicate values are not allowed.') |
| 70 | return false |
| 71 | } |
| 72 | return true |
| 73 | } |
| 74 | |
| 75 | const itemSummary = (item: T): string => { |
| 76 | const summary = itemDef.summarizeForEdit(item) |
Tested by
no test coverage detected