diff --git a/index.html b/index.html index b90d395..f625e9b 100644 --- a/index.html +++ b/index.html @@ -1057,6 +1057,46 @@

The InteractionOutput interface

The check data schema algorithm

To run the check data schema steps on |payload| and |schema:object|,
    +
  1. + If |schema| is `null` or `undefined`, return `undefined`. +
  2. +
  3. + + If |schema|.|default| is not |undefined| and |payload| is undefined, + let |payload| be the value of |schema|.|default|. +
  4. +
  5. + Let |const| be |schema|.|const|. + If |const| is not |undefined|, +
      +
    1. + + If |const| equals |payload|, return |payload|. +
    2. +
    3. + If |const| does not equal |payload|, throw {{TypeError}} and stop. +
    4. +
    +
  6. +
  7. + If |schema|.|enum| is not |undefined| and none of the elements in + |schema|.|enum| equal value, throw {{TypeError}} and stop. +
  8. +
  9. + Let |oneOf| be |schema|.|oneOf|. + If |oneOf| is not |undefined|, +
      +
    1. + For each |subSchema| in |oneOf|, run the check data schema + steps on |payload| and |subSchema|. +
    2. +
    3. + If all of these runs throw, throw {{TypeError}} and stop. +
    4. +
    +
  10. Let |type| be |schema|.|type|.