pretty print enhancements + comparison of generic functions
This commit is contained in:
parent
bbac7858ae
commit
9e1f679dba
15 changed files with 93 additions and 45 deletions
|
|
@ -1,8 +1,13 @@
|
|||
import { getHumanReadableName } from "../primitives/symbol.js";
|
||||
import { inspect } from "util";
|
||||
import { prettyT } from "../util/pretty.js";
|
||||
|
||||
const __makeTypeConstructor = (symbol, nAry, params) => {
|
||||
if (nAry === 0) {
|
||||
return { symbol, params };
|
||||
return {
|
||||
symbol, params,
|
||||
[inspect.custom](depth, options, inspect){ return options.stylize(prettyT(this), 'null'); },
|
||||
};
|
||||
}
|
||||
// only for debugging, do we give the function a name
|
||||
const fName = `${getHumanReadableName(symbol).toLowerCase()}Type${params.length>0?params.length:''}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue