Break down large glyph source files into smaller pieces

This commit is contained in:
be5invis 2021-01-04 18:23:01 -08:00
parent c4871864de
commit 7192dd65d1
105 changed files with 10915 additions and 10159 deletions

View file

@ -0,0 +1,31 @@
"use strict";
class GlyphBlock {
constructor(capture, blockName, body) {
this.capture = capture;
this.blockName = blockName;
this.body = body;
this.resolved = false;
this.exports = {};
}
resolve() {
if (this.resolved) return this.exports;
this.resolved = true;
const pendingApplications = [];
const ExportCapture = fnObj => {
pendingApplications.push(() => {
for (const [k, v] of Object.entries(fnObj())) {
this.exports[k] = v;
}
});
};
this.body(this.capture, ExportCapture);
for (const f of pendingApplications) f();
return this.exports;
}
}
module.exports = GlyphBlock;