parse-community / Parse-SDK-JS

Compare 094fbe2 ... +23 ... 7362468

Showing 1 of 4 files from the diff.

@@ -2399,12 +2399,6 @@
Loading
2399 2399
        if (el instanceof ParseFile) {
2400 2400
          filesSaved.push(el.save(options));
2401 2401
        } else if (el instanceof ParseObject) {
2402 -
          if (allowCustomObjectId && !el.id) {
2403 -
            throw new ParseError(
2404 -
              ParseError.MISSING_OBJECT_ID,
2405 -
              'objectId must not be empty, null or undefined'
2406 -
            );
2407 -
          }
2408 2402
          pending.push(el);
2409 2403
        }
2410 2404
      });
@@ -2419,6 +2413,13 @@
Loading
2419 2413
            const batch = [];
2420 2414
            const nextPending = [];
2421 2415
            pending.forEach(el => {
2416 +
              if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) {
2417 +
                throw new ParseError(
2418 +
                  ParseError.MISSING_OBJECT_ID,
2419 +
                  'objectId must not be empty or null'
2420 +
                );
2421 +
              }
2422 +
2422 2423
              if (batch.length < batchSize && canBeSerialized(el)) {
2423 2424
                batch.push(el);
2424 2425
              } else {
@@ -2498,11 +2499,8 @@
Loading
2498 2499
        });
2499 2500
      });
2500 2501
    } else if (target instanceof ParseObject) {
2501 -
      if (allowCustomObjectId && !target.id) {
2502 -
        throw new ParseError(
2503 -
          ParseError.MISSING_OBJECT_ID,
2504 -
          'objectId must not be empty, null or undefined'
2505 -
        );
2502 +
      if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(target, 'id') && !target.id) {
2503 +
        throw new ParseError(ParseError.MISSING_OBJECT_ID, 'objectId must not be empty or null');
2506 2504
      }
2507 2505
      // generate _localId in case if cascadeSave=false
2508 2506
      target._getId();

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.

25 Commits

Hiding 2 contexual commits Hiding 1 contexual commits Hiding 1 contexual commits
Hiding 12 contexual commits
-4
-4
Hiding 2 contexual commits
+4
+4
Files Coverage
src 99.95%
Project Totals (61 files) 99.95%
Loading