Skip to content

Commit f9633f5

Browse files
committed
fix: simplify object length check in sync method
1 parent 4ed2480 commit f9633f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@
268268
}
269269

270270
response = await indexeddb.send(response);
271+
let objLength = Object.keys(response[type][0]).length
271272
if (
272273
!response[type].length ||
273274
(type === "object" &&
274275
response[type][0] &&
275276
response[type][0]._id &&
276-
Object.keys(response[type][0])
277-
.length === 1)
277+
objLength === 1)
278278
) {
279279
response.method = type + ".create";
280280
response[type] = data[type][i];

0 commit comments

Comments
 (0)