Files
panel/resources/js/plugins/fake-api/utils/genId.js

9 lines
183 B
JavaScript
Raw Normal View History

2025-08-04 16:33:07 +03:30
export const genId = array => {
const { length } = array
let lastIndex = 0
if (length)
lastIndex = Number(array[length - 1]?.id) + 1
return lastIndex || (length + 1)
}