diff --git a/readme.md b/readme.md index 74b975cc..338e8f41 100644 --- a/readme.md +++ b/readme.md @@ -1325,7 +1325,7 @@ const B = Value.Encode(Type.String(), 42) // throw ### Parse -Use the Parse function to process a value. The Parse function will call a specific sequence of Value functions (operations) to process the value. +Use the Parse function to parse a value. This function calls the Value functions `Clone` `Clean`, `Default`, `Convert`, `Assert` and `Decode` in this order to process a value. ```typescript const R = Value.Parse(Type.String(), 'hello') // const R: string = "hello" @@ -1333,18 +1333,21 @@ const R = Value.Parse(Type.String(), 'hello') // const R: string = "hello" const E = Value.Parse(Type.String(), undefined) // throws AssertError ``` -The specific sequence of Value operations is `Clone` `Clean`, `Default`, `Convert`, `Assert` and `Decode`. You can specify user defined sequences in the following way. +You can override the order in which functions are are run, or omit function calls entirely in the following way. ```typescript -// Same as calling the Assert() function +// Runs no functions. + +const R = Value.Parse([], Type.String(), 12345) + +// Runs the Assert() function. const E = Value.Parse(['Assert'], Type.String(), 12345) -// Same as calling the Convert() then Assert() functions. +// Runs the Convert() function followed by the Assert() function. const S = Value.Parse(['Convert', 'Assert'], Type.String(), 12345) ``` -When specifying user defined sequences, the return type of Parse will be unknown.