A given URL can include a path and version. It will always have a key (or hostname/url to resolve).
Currently, the callback provides the key. It would be helpful if it could also return version and path, when appropriate.
I'm suggesting it here instead of another module, since it will help to have internal knowledge of the resolution for the various cases and to avoid any ambiguity.
We could retain the current interface:
datResolve(link, function (err, key) {
console.log('found key', key)
})
If we add an argument, like verbose = true. In which case:
datResolve(link, true, function (err, obj) {
console.log('found key', obj.key)
console.log('found path', obj.path)
console.log('found version', obj.version)
})
Returning obj instead of 3 arguments will make it easier to promisify.