From d32e4287e7c8b57ef0242b8d20c5e8e4143e906d Mon Sep 17 00:00:00 2001 From: Kurtis Mash <24705116+kurtismash@users.noreply.github.com> Date: Fri, 31 May 2024 10:20:15 +0100 Subject: [PATCH] Fix typos in "Switch Case Expression" example --- csv-schema-1.1.html | 4 ++-- csv-schema-1.2.html | 4 ++-- csv-schema.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/csv-schema-1.1.html b/csv-schema-1.1.html index 1e30a14..9b83509 100644 --- a/csv-schema-1.1.html +++ b/csv-schema-1.1.html @@ -1943,12 +1943,12 @@
a_column: any("true","false","unknown") another_column: if($a_column\is("true"),is("some string"),if($a_column\is("false"),is("some other string"),is("some third string"))) - /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a another_column is "false), + /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a_column is "false), if so another_column must be "some other string", otherwise another_column is "some third string". Nesting if statments like this can quickly get very difficult to read, so instead we can use the switch statement*/ third_column: switch(($a_column\is("true"),is("some string")),($a_column\is("false"),is("some other string")),is("some third string")) //this switch statement for third_column is functionally identical to the nested if statement demonstrated on another_column, and is much easier to extend - //is there were additional options available for a_column, each bracketed pair such of test and column validation expression, + //if there were additional options available for a_column, each bracketed pair such of test and column validation expression, //such as ($a_column\is("true"),is("some string")), is called a Switch Case Expression, as many as required are then followed by a final column validation expression, //used if none of the Switch Case Expressions evaluate to true.diff --git a/csv-schema-1.2.html b/csv-schema-1.2.html index a5d5f57..3bf0ec0 100644 --- a/csv-schema-1.2.html +++ b/csv-schema-1.2.html @@ -1964,12 +1964,12 @@
a_column: any("true","false","unknown") another_column: if($a_column\is("true"),is("some string"),if($a_column\is("false"),is("some other string"),is("some third string"))) - /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a another_column is "false), + /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a_column is "false), if so another_column must be "some other string", otherwise another_column is "some third string". Nesting if statments like this can quickly get very difficult to read, so instead we can use the switch statement*/ third_column: switch(($a_column\is("true"),is("some string")),($a_column\is("false"),is("some other string")),is("some third string")) //this switch statement for third_column is functionally identical to the nested if statement demonstrated on another_column, and is much easier to extend - //is there were additional options available for a_column, each bracketed pair such of test and column validation expression, + //if there were additional options available for a_column, each bracketed pair such of test and column validation expression, //such as ($a_column\is("true"),is("some string")), is called a Switch Case Expression, as many as required are then followed by a final column validation expression, //used if none of the Switch Case Expressions evaluate to true.diff --git a/csv-schema.html b/csv-schema.html index 0b165cd..fabc399 100644 --- a/csv-schema.html +++ b/csv-schema.html @@ -1964,12 +1964,12 @@
a_column: any("true","false","unknown") another_column: if($a_column\is("true"),is("some string"),if($a_column\is("false"),is("some other string"),is("some third string"))) - /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a another_column is "false), + /*here we look to the value of a_column, if it is "true", another_column must be "some string" otherwise, check if a_column is "false), if so another_column must be "some other string", otherwise another_column is "some third string". Nesting if statments like this can quickly get very difficult to read, so instead we can use the switch statement*/ third_column: switch(($a_column\is("true"),is("some string")),($a_column\is("false"),is("some other string")),is("some third string")) //this switch statement for third_column is functionally identical to the nested if statement demonstrated on another_column, and is much easier to extend - //is there were additional options available for a_column, each bracketed pair such of test and column validation expression, + //if there were additional options available for a_column, each bracketed pair such of test and column validation expression, //such as ($a_column\is("true"),is("some string")), is called a Switch Case Expression, as many as required are then followed by a final column validation expression, //used if none of the Switch Case Expressions evaluate to true.