1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = defineToJSON;
|
7 |
|
8 | var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol"));
|
9 |
|
10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | function defineToJSON(classObject) {
|
17 | var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString;
|
18 | classObject.prototype.toJSON = fn;
|
19 | classObject.prototype.inspect = fn;
|
20 |
|
21 | if (_nodejsCustomInspectSymbol.default) {
|
22 | classObject.prototype[_nodejsCustomInspectSymbol.default] = fn;
|
23 | }
|
24 | }
|