zapupenec/diary_app

View on GitHub
src/lib/genNoteId.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { TNote } from 'types';

export const genNoteId = (col: TNote[]) => {
  const ids = col.map(({ id }) => id);
  return Math.max(0, ...ids) + 1;
};