Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 00dcb41

Browse files
jbenetalanshaw
authored andcommitted
added resolve command
1 parent ef5a4a3 commit 00dcb41

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/resolve.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict'
2+
3+
const promisify = require('promisify-es6')
4+
5+
const transform = function (res, callback) {
6+
callback(null, res.Path)
7+
}
8+
9+
module.exports = (send) => {
10+
return promisify((args, opts, callback) => {
11+
if (typeof (opts) === 'function') {
12+
callback = opts
13+
opts = {}
14+
}
15+
16+
send.andTransform({
17+
path: 'resolve',
18+
args: args,
19+
qs: opts
20+
}, transform, callback)
21+
})
22+
}

src/utils/load-commands.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function requireCommands () {
4343
update: require('../update'),
4444
version: require('../version'),
4545
types: require('../types'),
46+
resolve: require('../resolve'),
4647
dns: require('../dns')
4748
}
4849

0 commit comments

Comments
 (0)