MCPcopy
hub / github.com/parse-community/parse-server / validateIdempotencyOptions

Method validateIdempotencyOptions

src/Config.js:377–393  ·  view source on GitHub ↗
(idempotencyOptions)

Source from the content-addressed store, hash-verified

375 }
376
377 static validateIdempotencyOptions(idempotencyOptions) {
378 if (!idempotencyOptions) {
379 return;
380 }
381 if (idempotencyOptions.ttl === undefined) {
382 idempotencyOptions.ttl = IdempotencyOptions.ttl.default;
383 } else if (!isNaN(idempotencyOptions.ttl) && idempotencyOptions.ttl <= 0) {
384 throw 'idempotency TTL value must be greater than 0 seconds';
385 } else if (isNaN(idempotencyOptions.ttl)) {
386 throw 'idempotency TTL value must be a number';
387 }
388 if (!idempotencyOptions.paths) {
389 idempotencyOptions.paths = IdempotencyOptions.paths.default;
390 } else if (!Array.isArray(idempotencyOptions.paths)) {
391 throw 'idempotency paths must be of an array of strings';
392 }
393 }
394
395 static validateAccountLockoutPolicy(accountLockout) {
396 if (accountLockout) {

Callers 1

validateOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected