eliminate another partial special case
This commit is contained in:
parent
f352be308b
commit
849d6d3597
2 changed files with 3 additions and 35 deletions
|
@ -1,11 +1,5 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// P A C K A G E
|
|
||||||
|
|
||||||
import Component from "choo/component";
|
|
||||||
|
|
||||||
// V A R I A B L E S
|
// V A R I A B L E S
|
||||||
|
|
||||||
const APPLICATIONS = require("./ecosystem/module-applications");
|
const APPLICATIONS = require("./ecosystem/module-applications");
|
||||||
|
@ -16,13 +10,7 @@ const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse");
|
||||||
const REFLECTOR = require("./ecosystem/submodule-reflector");
|
const REFLECTOR = require("./ecosystem/submodule-reflector");
|
||||||
const WALLET = require("./ecosystem/submodule-wallet");
|
const WALLET = require("./ecosystem/submodule-wallet");
|
||||||
|
|
||||||
|
export default function () {
|
||||||
|
|
||||||
// P R O G R A M
|
|
||||||
|
|
||||||
Ecosystem.prototype = Object.create(Component.prototype);
|
|
||||||
|
|
||||||
Ecosystem.prototype.createElement = () => {
|
|
||||||
return `
|
return `
|
||||||
<section class="ecosystem">
|
<section class="ecosystem">
|
||||||
<aside class="ecosystem__submodules">
|
<aside class="ecosystem__submodules">
|
||||||
|
@ -43,18 +31,3 @@ Ecosystem.prototype.createElement = () => {
|
||||||
</section>
|
</section>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// E X P O R T
|
|
||||||
|
|
||||||
module.exports = exports = Ecosystem;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// H E L P E R S
|
|
||||||
|
|
||||||
function Ecosystem() {
|
|
||||||
if (!(this instanceof Ecosystem)) return new Ecosystem();
|
|
||||||
Component.call(this);
|
|
||||||
}
|
|
||||||
|
|
|
@ -146,12 +146,7 @@ function partialFinder(markdownBody) {
|
||||||
if (fileExistsTest) {
|
if (fileExistsTest) {
|
||||||
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
|
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
|
||||||
|
|
||||||
if (filename === "ecosystem") {
|
if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction);
|
||||||
const neatPartial = new partialFunction;
|
|
||||||
markdownBody = markdownBody.replace(partial, neatPartial.render());
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction);
|
|
||||||
|
|
||||||
else markdownBody = markdownBody.replace(partial, partialFunction.default());
|
else markdownBody = markdownBody.replace(partial, partialFunction.default());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue