Class: DIDUrl
identity_wasm.DIDUrl
A method agnostic DID Url.
Table of contents
Methods
Methods
toJSON
▸ toJSON(): Object
- Return copy of self without private attributes.
Returns
Object
▸ toJSON(): any
Serializes this to a JSON object.
Returns
any
toString
▸ toString(): string
Return stringified version of self.
Returns
string
▸ toString(): string
Returns the DIDUrl as a string.
Returns
string
parse
▸ Static parse(input): DIDUrl
Parses a DIDUrl from the input string.
Parameters
| Name | Type |
|---|---|
input | string |
Returns
did
▸ did(): CoreDID
Return a copy of the CoreDID section of the DIDUrl.
Returns
urlStr
▸ urlStr(): string
Return a copy of the relative DID Url as a string, including only the path, query, and fragment.
Returns
string
fragment
▸ fragment(): undefined | string
Returns a copy of the DIDUrl method fragment, if any. Excludes the leading '#'.
Returns
undefined | string
setFragment
▸ setFragment(value?): void
Sets the fragment component of the DIDUrl.
Parameters
| Name | Type |
|---|---|
value? | string |
Returns
void
path
▸ path(): undefined | string
Returns a copy of the DIDUrl path.
Returns
undefined | string
setPath
▸ setPath(value?): void
Sets the path component of the DIDUrl.
Parameters
| Name | Type |
|---|---|
value? | string |
Returns
void
query
▸ query(): undefined | string
Returns a copy of the DIDUrl method query, if any. Excludes the leading '?'.
Returns
undefined | string
setQuery
▸ setQuery(value?): void
Sets the query component of the DIDUrl.
Parameters
| Name | Type |
|---|---|
value? | string |
Returns
void
join
▸ join(segment): DIDUrl
Append a string representing a path, query, and/or fragment, returning a new DIDUrl.
Must begin with a valid delimiter character: '/', '?', '#'. Overwrites the existing URL segment and any following segments in order of path, query, then fragment.
I.e.
- joining a path will clear the query and fragment.
- joining a query will clear the fragment.
- joining a fragment will only overwrite the fragment.
Parameters
| Name | Type |
|---|---|
segment | string |
Returns
fromJSON
▸ Static fromJSON(json): DIDUrl
Deserializes an instance from a JSON object.
Parameters
| Name | Type |
|---|---|
json | any |
Returns
clone
▸ clone(): DIDUrl
Deep clones the object.