From e13cb35e1a5bf9ab577b25886450be1419f22ea4 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 22 Jan 2024 22:50:27 +0100 Subject: [PATCH 1/7] fix(InteractionOutput): don't require schema.type in value function --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 60cd381..b90d395 100644 --- a/index.html +++ b/index.html @@ -976,8 +976,8 @@

The InteractionOutput interface

  • If |this|.|data| is not a {{ReadableStream}} or if - |dataUsed| is `true`, or if |form| is not an {{object}} or if |schema| or its - |type| are `null` or `undefined`, then + |dataUsed| is `true`, or if |form| is not an {{object}} or if |schema| + is `null` or `undefined`, then [=reject=] |promise| with {{NotReadableError}} and stop.
  • From 0f00764cce6f813ba8c168bab682eef1d6791037 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 12 Feb 2024 09:26:49 +0100 Subject: [PATCH 2/7] fix: improve check data schema algorithm --- index.html | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/index.html b/index.html index b90d395..869d75c 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 |payload|, 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|.
    11. From e0d5447a0e461bd016eb6b9b1483c823c24ef121 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 26 Feb 2024 08:15:19 +0100 Subject: [PATCH 3/7] fixup! fix: improve check data schema algorithm --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 869d75c..addb456 100644 --- a/index.html +++ b/index.html @@ -1093,7 +1093,8 @@

      The InteractionOutput interface

      steps on |payload| and |subSchema|.
    12. - If all of these runs throw, throw {{TypeError}} and stop. + If more than two of these runs do not throw, throw {{TypeError}} + and stop.
  • From 7fc27e38f1402dffad8c865c8df5b6fc919f9e2d Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 26 Feb 2024 08:19:10 +0100 Subject: [PATCH 4/7] fixup! fix: improve check data schema algorithm --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index addb456..c03f809 100644 --- a/index.html +++ b/index.html @@ -1093,8 +1093,8 @@

    The InteractionOutput interface

    steps on |payload| and |subSchema|.
  • - If more than two of these runs do not throw, throw {{TypeError}} - and stop. + If none or more than two of these runs do not throw, throw + {{TypeError}} and stop.
  • From 2a3365f0e1e1d1586d289287a1862d2b72bc4dd8 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 26 Feb 2024 08:20:53 +0100 Subject: [PATCH 5/7] fixup! fix: improve check data schema algorithm --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c03f809..aba426a 100644 --- a/index.html +++ b/index.html @@ -1093,7 +1093,7 @@

    The InteractionOutput interface

    steps on |payload| and |subSchema|.
  • - If none or more than two of these runs do not throw, throw + If none or more than one of these runs do not throw, throw {{TypeError}} and stop.
  • From 9a8e2e5200b971bf4f0af65ab6603ecd80edad2c Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Tue, 27 Feb 2024 07:42:35 +0100 Subject: [PATCH 6/7] fixup! fix: improve check data schema algorithm --- index.html | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/index.html b/index.html index aba426a..414cf7e 100644 --- a/index.html +++ b/index.html @@ -1068,17 +1068,7 @@

    The InteractionOutput interface

    let |payload| be the value of |schema|.|default|.
  • - 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. -
    + If |schema|.|const| is not |undefined| and |schema|.|const| does not equal |payload|, throw {{TypeError}} and stop.
  • If |schema|.|enum| is not |undefined| and none of the elements in From b38cf776c5bd41be7bdc81f2ed4ea6701934160a Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Tue, 27 Feb 2024 16:08:13 +0100 Subject: [PATCH 7/7] fixup! fix: improve check data schema algorithm --- index.html | 7 ------- 1 file changed, 7 deletions(-) diff --git a/index.html b/index.html index 414cf7e..b462280 100644 --- a/index.html +++ b/index.html @@ -1060,13 +1060,6 @@

    The InteractionOutput interface

  • If |schema| is `null` or `undefined`, return `undefined`.
  • -
  • - - If |schema|.|default| is not |undefined| and |payload| is undefined, - let |payload| be the value of |schema|.|default|. -
  • If |schema|.|const| is not |undefined| and |schema|.|const| does not equal |payload|, throw {{TypeError}} and stop.