MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / extractRowObject

Function extractRowObject

lib/methods/table.js:159–172  ·  view source on GitHub ↗
(row, output, columnMap, moduleName)

Source from the content-addressed store, hash-verified

157}
158
159function extractRowObject(row, output, columnMap, moduleName) {
160 let count = 0;
161 for (const key of Object.keys(row)) {
162 const index = columnMap.get(key);
163 if (index === undefined) {
164 throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an undeclared column "${key}"`);
165 }
166 output[index] = row[key];
167 count += 1;
168 }
169 if (count !== columnMap.size) {
170 throw new TypeError(`Virtual table module "${moduleName}" yielded a row with missing columns`);
171 }
172}
173
174function inferParameters({ length }) {
175 if (!Number.isInteger(length) || length < 0) {

Callers 1

wrapGeneratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected