create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
37 lines (31 loc) • 829 B
JavaScript
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
;
const _require = require("stream"),
Writable = _require.Writable;
class JsonReporter {
constructor(stream) {
this._stream = stream;
}
/**
* There is a special case for errors because they have non-enumerable fields.
* (Perhaps we should switch in favor of plain object?)
*/
update(event) {
if (Object.prototype.toString.call(event.error) === "[object Error]") {
event = Object.assign(event, {
message: event.error.message,
stack: event.error.stack
});
}
this._stream.write(JSON.stringify(event) + "\n");
}
}
module.exports = JsonReporter;