Skip to content

Commit d27439b

Browse files
committed
Fixes to the export functions
1 parent dc3b94a commit d27439b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/service-obj.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,20 @@ export default class ServiceObj {
117117
});
118118
}
119119

120+
get [Symbol.toStringTag]() {
121+
return 'Service';
122+
}
123+
124+
toString() {
125+
return this.fqdn + ' => ' + this.target + ':' + this.port + ' => ' + this.addresses.join(',');
126+
}
127+
128+
toObject() {
129+
return {fqdn: this.fqdn, ...this.#props, host: this.host};
130+
}
131+
120132
toJSON() {
121-
return JSON.stringify({fqdn: this.fqdn, ...this.#props, host: this.host});
133+
return {fqdn: this.fqdn, ...this.#props, host: this.host};
122134
}
123135

124136
[util.inspect.custom] (depth, options, inspect) {

0 commit comments

Comments
 (0)