Skip to content

Commit

Permalink
Merge pull request #6 from wizard04wsu/dev
Browse files Browse the repository at this point in the history
remove URIError class definition
  • Loading branch information
wizard04wsu authored Aug 29, 2021
2 parents fc21b97 + af49464 commit 001f633
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This script does not support:
- obsolete syntaxes
- non-ASCII email addresses

This is a JavaScript module that exports: [`URI`](#uri) (default), [`URIError`](#urierror), [`SegmentedString`](#segmentedstring), [`isDNSDomain`](#isdnsdomain), [`parseMailbox`](#parsemailbox)
This is a JavaScript module that exports: [`URI`](#uri) (default), [`SegmentedString`](#segmentedstring), [`isDNSDomain`](#isdnsdomain), [`parseMailbox`](#parsemailbox)

[Try it on JSFiddle](https://jsfiddle.net/wizard04/896dmhga/)

Expand All @@ -29,10 +29,6 @@ Parameters:
- ***toPrimitive*** - (function) This function is called when the object is being coerced into a primitive. Whatever it returns will be converted to a primitive string value.
- ***initialMembers*** - (object) Optional. The enumerable properties of this object are added to the new instance of SegmentedString.

### URIError

The **URIError** class extends the **Error** class. It is simply used to differentiate an invalid or non-conforming URI from other types of errors.

---

## URI Parsing
Expand All @@ -48,7 +44,7 @@ Parameters:
- ***uri*** - (string) A URI.

Return value:
- A [SegmentedString](#SegmentedString) object representing the normalized URI and its parts. Throws a [URIError](#urierror) if the URI is invalid or does not conform to its scheme's syntax.
- A [SegmentedString](#SegmentedString) object representing the normalized URI and its parts. Throws a URIError if the URI is invalid or does not conform to its scheme's syntax.


### URI.parse()
Expand All @@ -62,7 +58,7 @@ Parameters:
- ***uri*** - (string) A URI.

Return value:
- A [SegmentedString](#SegmentedString) object representing the normalized URI and its parts. Throws a [URIError](#urierror) if the URI is invalid.
- A [SegmentedString](#SegmentedString) object representing the normalized URI and its parts. Throws a URIError if the URI is invalid.

| Property | Type | Description |
| --- | --- | --- |
Expand Down Expand Up @@ -107,7 +103,7 @@ Parameters:
- ***host*** - (string) A registered name or IP address.

Return value:
- A [SegmentedString](#SegmentedString) object representing the normalized host (IP address or registered name) and related representations. Throws a [URIError](#urierror) if it's not a valid host.
- A [SegmentedString](#SegmentedString) object representing the normalized host (IP address or registered name) and related representations. Throws a URIError if it's not a valid host.

| Property | Type | Description |
| --- | --- | --- |
Expand Down Expand Up @@ -158,7 +154,7 @@ Parameters:
- ***parsed*** - ([SegmentedString](#SegmentedString)) The generically parsed URI. This object will be modified.

Return value:
- Nothing is returned. The ***parsed*** parameter is modified, adding the following properties. Throws a [URIError](#urierror) if the URI does not conform to the scheme.
- Nothing is returned. The ***parsed*** parameter is modified, adding the following properties. Throws a URIError if the URI does not conform to the scheme.

| Property | Type | Description |
| --- | --- | --- |
Expand All @@ -175,7 +171,7 @@ Parameters:
- ***parsed*** - ([SegmentedString](#SegmentedString)) The generically parsed *mailto*-schemed URI. This object will be modified.

Return value:
- Nothing is returned. The ***parsed*** parameter is modified, adding the following properties. Throws a [URIError](#urierror) if the URI does not conform to the scheme.
- Nothing is returned. The ***parsed*** parameter is modified, adding the following properties. Throws a URIError if the URI does not conform to the scheme.

| Property | Type | Description |
| --- | --- | --- |
Expand Down
12 changes: 1 addition & 11 deletions src/uri_parsing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
/** @module URI */


/**
* This error type is thrown if a URI is invalid or unsupported.
* @extends Error
*/
class URIError extends Error {
constructor(message, options){
super(message, options);
}
}

/**
* A String object whose properties are substrings.
* @extends String
Expand Down Expand Up @@ -1454,4 +1444,4 @@ function defineNonEnumerableProperty(object, property, value){

/* module export */

export { URI as default, URIError, SegmentedString, isDNSDomain, parseMailbox };
export { URI as default, SegmentedString, isDNSDomain, parseMailbox };

0 comments on commit 001f633

Please sign in to comment.