parse-community / Parse-SDK-JS
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();
Files Coverage
src 99.95%
Project Totals (61 files) 99.95%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading