(db: Low<BsDB>)
| 88 | } |
| 89 | |
| 90 | function nextId(db: Low<BsDB>): string { |
| 91 | const current = Number(db.data?.seq ?? "0"); |
| 92 | const next = Number.isFinite(current) ? current + 1 : 1; |
| 93 | db.data!.seq = String(next); |
| 94 | return String(next); |
| 95 | } |
| 96 | |
| 97 | function toInt(value: any): number | undefined { |
| 98 | const n = Number(value); |