eliminate another partial special case

This commit is contained in:
Jeremy Kauffman 2018-09-24 14:58:49 -04:00
parent f352be308b
commit 849d6d3597
2 changed files with 3 additions and 35 deletions

View file

@ -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);
}

View file

@ -145,13 +145,8 @@ 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());
} }