Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Conversation

micahriggan
Copy link

Supporting a common use-case, the cash address without the prefix on it.



Address.prototype.toCashAddress = function() {
Address.prototype.toCashAddress = function(withPrefix) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets validate that withPrefix is a boolean if it exists

lib/address.js Outdated

Address.prototype.toCashAddress = function() {
Address.prototype.toCashAddress = function(withPrefix) {
if(withPrefix === undefined || typeof(withPrefix) !== 'boolean') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to throw if the argument is wrong type. It is better to complain than to silently accept something wrong.

@micahriggan micahriggan force-pushed the feature/cashaddr-no-prefix-option branch 4 times, most recently from dc11dfc to a0bcc06 Compare February 1, 2018 15:43
@micahriggan micahriggan force-pushed the feature/cashaddr-no-prefix-option branch from cbe289b to d134252 Compare February 1, 2018 15:47
@nitsujlangston nitsujlangston merged commit d134252 into bitpay:cash Feb 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants