mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-27 21:06:09 +00:00
8b22c1edd5
Summary: This was changed in the v4.0.0 release of `better-sqlite3`: <https://github.com/JoshuaWise/better-sqlite3/pull/61> Test Plan: Create the following test file, and note that it fails to typecheck before this change (on two counts) but passes after: ```js // @flow import Database from "better-sqlite3"; const db = new Database(":memory:"); db.prepare("CREATE TABLE foo (id)").run(); const insert = db.prepare("INSERT INTO foo (id) VALUES (?)"); insert.run(1); insert.run(2); const retrieve = db.prepare("SELECT id FROM foo").pluck(); console.log("Old way:"); try { // $ExpectFlowError retrieve.each((x) => void console.log(x)); } catch (e) { console.log("Failed (good):", String(e)); } console.log(); console.log("New way:"); for (const value of retrieve.iterate()) { console.log(value); } ``` Also, run the test with `NODE_ENV=development babel-node src/test.js`, and note that it outputs: ``` $ NODE_ENV=development babel-node src/test.js Old way: Failed (good): TypeError: retrieve.each is not a function New way: 1 2 ``` wchargin-branch: flow-better-sqlite3-iterator