Skip to content

Commit 04bc43d

Browse files
committed
Update README.md
1 parent 3011b17 commit 04bc43d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ The following functions check whether a given argument satisfies a certain const
142142
* **`ValueIsListOf (Value:any, ValueList:any[]):boolean`**<br>returns `true` if the given `Value` is a "dense" JavaScript array whose elements all equal (at least) one of the items found in the given `ValueList` - or `false` otherwise<br>&nbsp;<br>
143143
* **`ValueIsColor (Value:any):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically valid CSS color specification (checked case-insensitively) - or `false` otherwise
144144
* **`ValueIsEMailAddress (Value:unknown):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically valid EMail address (checked case-insensitively and against the complete string) - or `false` otherwise
145-
* **`ValueIsURL (Value:any):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically valid URL - or `false` otherwise<br>&nbsp;<br>
145+
* **`ValueIsURL (Value:any):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically valid URL (absolute or relative) - or `false` otherwise
146+
* **`ValueIsAbsoluteURL (Value:any, allowedProtocols?:string[]):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically valid *absolute* URL (i.e., one that includes a scheme) - or `false` otherwise. If given, `allowedProtocols` restricts accepted values to URLs using one of the listed protocols (matched case-insensitively, with or without a trailing colon)<br>&nbsp;<br>
146147
* **`ValueIsPhoneNumber (Value:any):boolean`**<br>returns `true` if the given `Value` is a string containing a syntactically plausible phone number in a common national or international notation (digits with the format characters space, `-`, `.`, `/` and parentheses, optionally led by a `+`). With a leading `+`, the digits must follow E.164 rules (7-15 digits, no leading zero), otherwise 3-16 digits are accepted. Please note: this is a plausibility check only - it does not verify that prefixes or number lengths actually exist
147148
* **`ValueIsE164PhoneNumber (Value:any):boolean`**<br>returns `true` if the given `Value` is a string containing a phone number in the canonical [E.164](https://en.wikipedia.org/wiki/E.164) format (a `+` followed by 7-15 digits without leading zero and without any formatting characters, e.g., `+4972112345`) - or `false` otherwise<br>&nbsp;<br>
148149
* **`ValueIsBigInt (Value:unknown):boolean`**<br>returns `true` if the given `Value` is a primitive `BigInt` value - or `false` otherwise
@@ -214,7 +215,8 @@ For the sake of clarity, however, only the first "flavour" (namely `allowXXX`) i
214215
* **`allowListOf (Description:string, Argument:any, ValueList:any[]):any[]|null|undefined`**<br>checks if the given `Argument` (if it exists) is a "dense" JavaScript array whose elements all equal (at least) one of the items found in the given `ValueList` (see `ValueIsListOf`). If this is the case (or `Argument` is missing), the function returns the given `Argument`, otherwise an error is thrown whose message contains the given `Description`<br>&nbsp;<br>
215216
* **`allowColor (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically valid CSS color specification. If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`
216217
* **`allowEMailAddress (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically valid EMail address. If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`
217-
* **`allowURL (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically valid URL. If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`<br>&nbsp;<br>
218+
* **`allowURL (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically valid URL (absolute or relative). If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`
219+
* **`allowAbsoluteURL (Description:string, Argument:any, allowedProtocols?:string[]):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically valid absolute URL (see `ValueIsAbsoluteURL`). If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`<br>&nbsp;<br>
218220
* **`allowPhoneNumber (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a syntactically plausible phone number in a common national or international notation (see `ValueIsPhoneNumber`). If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`
219221
* **`allowE164PhoneNumber (Description:string, Argument:any):string|null|undefined`**<br>checks if the given `Argument` (if it exists) is a string containing a phone number in the canonical E.164 format (see `ValueIsE164PhoneNumber`). If this is the case (or `Argument` is missing), the function returns the primitive value of the given `Argument`, otherwise an error is thrown whose message contains the given `Description`<br>&nbsp;<br>
220222
* **`allowBigInt`**, **`allowSymbol`**, **`allowMap`**, **`allowSet`**, **`allowTypedArray`**, **`allowArrayBuffer`**<br>validate the given `Argument` using `ValueIsBigInt`, `ValueIsSymbol`, `ValueIsMap`, `ValueIsSet`, `ValueIsTypedArray` or `ValueIsArrayBuffer`, resp., and behave like any other `allowXXX` function described above (incl. their `allowedXXX`, `expectXXX` and `expectedXXX` flavours)

0 commit comments

Comments
 (0)