2021-01-07 16:41:46 +00:00
|
|
|
// Patching to support node.js extensions.
|
|
|
|
|
2021-03-02 21:43:10 +00:00
|
|
|
import { Annotated } from './annotated';
|
|
|
|
import { Bytes } from './bytes';
|
|
|
|
import { Set, Dictionary } from './dictionary';
|
2022-01-26 13:15:35 +00:00
|
|
|
import { stringify } from './text';
|
2021-03-02 21:43:10 +00:00
|
|
|
|
2021-01-07 16:41:46 +00:00
|
|
|
import * as util from 'util';
|
|
|
|
|
2021-02-25 18:37:22 +00:00
|
|
|
[Bytes, Annotated, Set, Dictionary].forEach((C) => {
|
2021-01-15 13:01:14 +00:00
|
|
|
(C as any).prototype[util.inspect.custom] =
|
|
|
|
function (_depth: any, _options: any) {
|
2022-01-26 13:15:35 +00:00
|
|
|
return stringify(this, { indent: 2 });
|
2021-01-15 13:01:14 +00:00
|
|
|
};
|
2021-01-07 16:41:46 +00:00
|
|
|
});
|