MCPcopy Index your code
hub / github.com/parse-community/parse-server / validateFileDownloadOptions

Method validateFileDownloadOptions

src/Config.js:599–625  ·  view source on GitHub ↗
(fileDownload)

Source from the content-addressed store, hash-verified

597 }
598
599 static validateFileDownloadOptions(fileDownload) {
600 try {
601 if (fileDownload == null || typeof fileDownload !== 'object' || Array.isArray(fileDownload)) {
602 throw 'fileDownload must be an object value.';
603 }
604 } catch (e) {
605 if (e instanceof ReferenceError) {
606 return;
607 }
608 throw e;
609 }
610 if (fileDownload.enableForAnonymousUser === undefined) {
611 fileDownload.enableForAnonymousUser = FileDownloadOptions.enableForAnonymousUser.default;
612 } else if (typeof fileDownload.enableForAnonymousUser !== 'boolean') {
613 throw 'fileDownload.enableForAnonymousUser must be a boolean value.';
614 }
615 if (fileDownload.enableForPublic === undefined) {
616 fileDownload.enableForPublic = FileDownloadOptions.enableForPublic.default;
617 } else if (typeof fileDownload.enableForPublic !== 'boolean') {
618 throw 'fileDownload.enableForPublic must be a boolean value.';
619 }
620 if (fileDownload.enableForAuthenticatedUser === undefined) {
621 fileDownload.enableForAuthenticatedUser = FileDownloadOptions.enableForAuthenticatedUser.default;
622 } else if (typeof fileDownload.enableForAuthenticatedUser !== 'boolean') {
623 throw 'fileDownload.enableForAuthenticatedUser must be a boolean value.';
624 }
625 }
626
627 static validateIps(field, masterKeyIps) {
628 for (let ip of masterKeyIps) {

Callers 1

validateOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected