MCPcopy Create free account
hub / github.com/parse-community/parse-server / validateDatabaseOptions

Method validateDatabaseOptions

src/Config.js:784–807  ·  view source on GitHub ↗
(databaseOptions)

Source from the content-addressed store, hash-verified

782 }
783
784 static validateDatabaseOptions(databaseOptions) {
785 if (databaseOptions == undefined) {
786 return;
787 }
788 if (Object.prototype.toString.call(databaseOptions) !== '[object Object]') {
789 throw `databaseOptions must be an object`;
790 }
791
792 if (databaseOptions.enableSchemaHooks === undefined) {
793 databaseOptions.enableSchemaHooks = DatabaseOptions.enableSchemaHooks.default;
794 } else if (typeof databaseOptions.enableSchemaHooks !== 'boolean') {
795 throw `databaseOptions.enableSchemaHooks must be a boolean`;
796 }
797 if (databaseOptions.schemaCacheTtl === undefined) {
798 databaseOptions.schemaCacheTtl = DatabaseOptions.schemaCacheTtl.default;
799 } else if (typeof databaseOptions.schemaCacheTtl !== 'number') {
800 throw `databaseOptions.schemaCacheTtl must be a number`;
801 }
802 if (databaseOptions.allowPublicExplain === undefined) {
803 databaseOptions.allowPublicExplain = DatabaseOptions.allowPublicExplain.default;
804 } else if (typeof databaseOptions.allowPublicExplain !== 'boolean') {
805 throw `Parse Server option 'databaseOptions.allowPublicExplain' must be a boolean.`;
806 }
807 }
808
809 static validateLiveQueryOptions(liveQuery) {
810 if (liveQuery == undefined) {

Callers 1

validateOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected