@defra/forms-engine-plugin 0.1.28 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -463,9 +463,7 @@ export class FormModel {
463
463
  }
464
464
 
465
465
  if (isInvalid) {
466
- if (!context.errors) {
467
- context.errors = []
468
- }
466
+ context.errors ??= []
469
467
 
470
468
  const text =
471
469
  'Options are different because you changed a previous answer'
@@ -44,7 +44,7 @@ export class CacheService {
44
44
  ): Promise<FormSubmissionState> {
45
45
  const cached = await this.cache.get(this.Key(request))
46
46
 
47
- return cached || {}
47
+ return cached ?? {}
48
48
  }
49
49
 
50
50
  async setState(
@@ -64,7 +64,7 @@ export class CacheService {
64
64
  const key = this.Key(request, ADDITIONAL_IDENTIFIER.Confirmation)
65
65
  const value = await this.cache.get(key)
66
66
 
67
- return value || {}
67
+ return value ?? {}
68
68
  }
69
69
 
70
70
  async setConfirmationState(