Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Return key, path and version from given URL #6

@millette

Description

@millette

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions