@wocker/core
Advanced tools
Comparing version 1.0.17-dev.4 to 1.0.17-dev.5
@@ -18,2 +18,3 @@ import { PickProperties, EnvConfig } from "../types"; | ||
volumes?: string[]; | ||
extraHosts?: EnvConfig; | ||
metadata?: EnvConfig; | ||
@@ -41,2 +42,4 @@ protected constructor(data: ProjectProperties); | ||
volumeUnmount(...volumes: string[]): void; | ||
addExtraHost(host: string, domain: string): void; | ||
removeExtraHost(host: string): void; | ||
abstract save(): Promise<void>; | ||
@@ -43,0 +46,0 @@ toJSON(): ProjectProperties; |
@@ -20,2 +20,3 @@ "use strict"; | ||
this.volumes = data.volumes; | ||
this.extraHosts = data.extraHosts; | ||
this.metadata = data.metadata; | ||
@@ -175,2 +176,17 @@ Object.assign(this, data); | ||
} | ||
addExtraHost(host, domain) { | ||
if (!this.extraHosts) { | ||
this.extraHosts = {}; | ||
} | ||
this.extraHosts[host] = domain; | ||
} | ||
removeExtraHost(host) { | ||
if (!this.extraHosts || !this.extraHosts[host]) { | ||
return; | ||
} | ||
delete this.extraHosts[host]; | ||
if (Object.keys(this.extraHosts).length === 0) { | ||
delete this.extraHosts; | ||
} | ||
} | ||
toJSON() { | ||
@@ -191,2 +207,3 @@ return { | ||
volumes: this.volumes, | ||
extraHosts: this.extraHosts, | ||
metadata: this.metadata | ||
@@ -193,0 +210,0 @@ }; |
{ | ||
"name": "@wocker/core", | ||
"version": "1.0.17-dev.4", | ||
"version": "1.0.17-dev.5", | ||
"author": "Kris Papercut <krispcut@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Core of the Wocker", |
100449
2533