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