* Convert this to a stringified JSON
()
| 403 | * Convert this to a stringified JSON |
| 404 | */ |
| 405 | toString() { |
| 406 | $.checkState(this.credentials, 'Failed state: this.credentials at <toString()>'); |
| 407 | $.checkArgument(!this.noSign, 'no Sign not supported'); |
| 408 | $.checkArgument(!this.password, 'password not supported'); |
| 409 | |
| 410 | const output = JSON.stringify(this.toObj()); |
| 411 | return output; |
| 412 | } |
| 413 | |
| 414 | fromObj(credentials) { |
| 415 | $.checkArgument(credentials && typeof credentials === 'object' && !Array.isArray(credentials), 'Argument should be an object'); |