@superhero/http-server 4.2.5 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/view.js +23 -0
package/package.json
CHANGED
package/view.js
CHANGED
|
@@ -285,4 +285,27 @@ export default class View
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
+
|
|
289
|
+
toJSON()
|
|
290
|
+
{
|
|
291
|
+
const
|
|
292
|
+
descriptors = Object.getOwnPropertyDescriptors(this),
|
|
293
|
+
output = {}
|
|
294
|
+
|
|
295
|
+
for(const property in descriptors)
|
|
296
|
+
{
|
|
297
|
+
if(descriptors[property].enumerable)
|
|
298
|
+
{
|
|
299
|
+
output[property] = this[property]
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return Object(output)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// It's useful for debugging and logging to provide a more readable output.
|
|
307
|
+
[Symbol.for('nodejs.util.inspect.custom')]()
|
|
308
|
+
{
|
|
309
|
+
return this.toJSON()
|
|
310
|
+
}
|
|
288
311
|
}
|