docker-host
Advanced tools
Comparing version 2.3.0 to 2.3.1
module.exports = function(remote) { | ||
if (remote && (remote.host || remote.socketPath)) return remote | ||
if (remote && typeof remote === 'object') { | ||
if (remote.socketPath) return {socketPath:remote.socketPath, protocol:'unix:'} | ||
if (remote.host || remote.port) return {host:remote.host || 'localhost', port:remote.port || 2375, protocol:remote.protocol || 'http:'} | ||
remote = null | ||
} | ||
@@ -4,0 +8,0 @@ if (!remote) remote = process.env.DOCKER_HOST || 'unix:///var/run/docker.sock' |
{ | ||
"name": "docker-host", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Tiny module that converts a host to docker (usually $DOCKER_HOST) to a standard http url", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,4 +39,5 @@ var tape = require('tape') | ||
tape('support object shorthand', function(t) { | ||
t.same(host({host:'localhost'}), {host:'localhost', port:2375, protocol:'http:'}) | ||
t.same(host(host(':2375')), {host:'localhost', port:2375, protocol:'http:'}) | ||
t.end() | ||
}) |
3548
53