(id)
| 53 | } |
| 54 | |
| 55 | async function getItem(id) { |
| 56 | return new Promise((acc, rej) => { |
| 57 | db.all('SELECT * FROM todo_items WHERE id=?', [id], (err, rows) => { |
| 58 | if (err) return rej(err); |
| 59 | acc( |
| 60 | rows.map(item => |
| 61 | Object.assign({}, item, { |
| 62 | completed: item.completed === 1, |
| 63 | }), |
| 64 | )[0], |
| 65 | ); |
| 66 | }); |
| 67 | }); |
| 68 | } |
| 69 | |
| 70 | async function storeItem(item) { |
| 71 | return new Promise((acc, rej) => { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…