parse-community / parse-server
Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -724,15 +724,18 @@
Loading
724 724
        if (opt.required) {
725 725
          requiredParam(key);
726 726
        }
727 -
        if (opt.type) {
728 -
          const type = getType(opt.type);
729 -
          const valType = Array.isArray(val) ? 'array' : typeof val;
730 -
          if (valType !== type) {
731 -
            throw `Validation failed. Invalid type for ${key}. Expected: ${type}`;
727 +
        const optional = !opt.required && val === undefined;
728 +
        if (!optional) {
729 +
          if (opt.type) {
730 +
            const type = getType(opt.type);
731 +
            const valType = Array.isArray(val) ? 'array' : typeof val;
732 +
            if (valType !== type) {
733 +
              throw `Validation failed. Invalid type for ${key}. Expected: ${type}`;
734 +
            }
735 +
          }
736 +
          if (opt.options) {
737 +
            optionPromises.push(validateOptions(opt, key, val));
732 738
          }
733 -
        }
734 -
        if (opt.options) {
735 -
          optionPromises.push(validateOptions(opt, key, val));
736 739
        }
737 740
      }
738 741
    }
Files Coverage
src 93.90%
Project Totals (181 files) 93.90%
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