DIDUrl
@iota/identity-wasm API documentation
Class: DIDUrl
A method agnostic DID Url.
Methods
toJSON()
Call Signature
toJSON():
Object
- Return copy of self without private attributes.
Returns
Object
Call Signature
toJSON():
any
Serializes this to a JSON object.
Returns
any
toString()
Call Signature
toString():
string
Return stringified version of self.
Returns
string
Call Signature
toString():
string
Returns the DIDUrl as a string.
Returns
string
parse()
staticparse(input):DIDUrl
Parses a DIDUrl from the input string.
Parameters
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
value?
null | 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
value?
null | 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
value?
null | 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
segment
string
Returns
fromJSON()
staticfromJSON(json):DIDUrl
Deserializes an instance from a JSON object.
Parameters
json
any
Returns
clone()
clone():
DIDUrl
Deep clones the object.