cmawhorter / urn-lib

Parse, validate, and format urn:, arn:, or your own custom scheme.
MIT License
4 stars 1 forks source link

protocol should be optional with urn.format #1

Closed cmawhorter closed 7 years ago

cmawhorter commented 7 years ago

if protocol is absent from the object supplied to urn.format it should default to what's configured so it's easier to construct strings.

currently, you can't do

urn.format({  nid: 'blah',  nss: 'blah' });

and must instead

urn.format({  protocol: 'urn',  nid: 'blah',  nss: 'blah' });

or

urn.format(urn.build({ nid: 'blah', nss: 'blah' }));