ethers.js/docs.wrm/config.js

66 lines
1.7 KiB
JavaScript
Raw Normal View History

import { inspect } from "util";
2022-12-10 02:25:39 +03:00
import * as ethers from "../lib.esm/index.js";
2022-12-03 23:13:51 +03:00
import { version } from "../lib.esm/_version.js";
import { getModifiedTime } from "../lib.esm/_admin/utils/git.js";
2022-12-03 23:13:51 +03:00
const title = "ethers";
const subtitle = (function(version) {
const dash = version.indexOf("-");
if (dash === -1) { return version; }
return version.substring(dash + 1);
})(version);
2022-12-03 06:56:29 +03:00
export default {
2022-12-03 23:13:51 +03:00
title, subtitle,
prefix: "v6-beta",
2022-12-03 06:56:29 +03:00
2022-12-10 02:25:39 +03:00
contextify: function(context) {
Object.assign(context, ethers);
context.provider = new ethers.InfuraProvider();
context.Uint8Array = Uint8Array;
ethers.InfuraProvider.prototype[inspect.custom] = function(depth, options, inspect) {
if (depth > 0) { return `InfuraProvider { ... }`; }
// Does this cause infinite recursion??
return this;
};
ethers.Interface.prototype[inspect.custom] = function(depth, options, inspect) {
if (depth > 0) { return `Interface { ... }`; }
// Does this cause infinite recursion??
return this;
};
ethers.Fragment.prototype[inspect.custom] = function(depth, options, inspect) {
if (depth > 0) { return `${ this.constructor.name } { ... }`; }
// Does this cause infinite recursion??
return this;
};
2022-12-10 02:25:39 +03:00
},
2022-12-03 06:56:29 +03:00
srcBaseUrl: "https:/\/github.com/ethers-io/ethers.js/blob/v6-beta-exports/src.ts/{FILENAME}#L{LINENO}",
getTimestamp: function(path) {
return getModifiedTime(path);
},
2022-12-03 06:56:29 +03:00
2022-12-10 02:25:39 +03:00
docRoot: ".",
2022-12-03 06:56:29 +03:00
codeRoot: "../src.ts/index.ts",
links: [
2022-12-30 19:55:59 +03:00
"./links/javascript.txt",
"./links/npm.txt",
"./links/projects.txt",
"./links/ricmoo.txt",
"./links/specs.txt",
"./links/wiki.txt"
2022-12-03 06:56:29 +03:00
],
2022-12-03 23:25:41 +03:00
staticFiles: [
"logo.svg",
"social.jpg"
]
2022-12-03 06:56:29 +03:00
};