ssbc / ssb-ref

check if a string is a valid ssb-reference
MIT License
14 stars 10 forks source link

Rename internally used deprecated functions #29

Closed stripedpajamas closed 5 years ago

stripedpajamas commented 5 years ago

toLegacyAddress - deprecated export parseMultiServerAddress - undeprecated since it is not exported parseLegacyInvite - nothing changed as only the export is deprecated parseMultiServerInvite - nothing chagned as only the export is deprecated parseInvite - nothing changed, export+function is deprecated and it is not called internally parseAddress - undeprecated function, deprecated export (changed internal call to call function directly)

christianbundy commented 5 years ago

Nice! This looks really great. I've just had another idea, maybe hare-brained, but do we need to prepend _ to these function names? I wonder whether it would be possible to leave the functions as-is and only deprecate when the function is exported:

exports.parseAddress = deprecate('ssb-ref.parseAddress', parseAddress)
exports.parseMultiServerInvite = deprecate('ssb-ref.parseMultiServerInvite', parseMultiServerInvite)

Sorry I've just now thought of this, if you think it's a good idea but don't have the time/energy I'd be happy to pull in your commit and add my above changes. What do you think?

stripedpajamas commented 5 years ago

That's a great idea 😄 I'll take care of it

christianbundy commented 5 years ago

Looks great, thanks! Sorry this took me so long to merge, I really appreciate this change.