You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
460 B
22 lines
460 B
3 years ago
|
export function mapResult(originalResult) {
|
||
|
const newResult = {};
|
||
|
if (!originalResult) {
|
||
|
return newResult;
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
newResult.insertId = originalResult.insertId;
|
||
|
} catch (e) {}
|
||
|
|
||
|
newResult.rowsAffected = originalResult.rowsAffected;
|
||
|
|
||
|
if ("rows" in originalResult) {
|
||
|
newResult.rows = [];
|
||
|
|
||
|
for (let i = 0; i < originalResult.rows.length; i++) {
|
||
|
newResult.rows.push(originalResult.rows.item(i));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return newResult;
|
||
|
}
|