Reduce closures

This commit is contained in:
be5invis 2022-03-27 12:36:01 -07:00
parent 1f0be761a2
commit f8a104d550
4 changed files with 148 additions and 108 deletions

View file

@ -63,10 +63,10 @@ exports.Glyph = class Glyph {
include(component, copyAnchors, copyWidth) {
if (!component) {
throw new Error("Unreachable: Attempt to include a Null or Undefined");
} else if (component instanceof Function) {
return component.call(this, copyAnchors, copyWidth);
} else if (component.applyToGlyph instanceof Function) {
return component.applyToGlyph(this, copyAnchors, copyWidth);
} else if (component instanceof Function) {
return component.call(this, copyAnchors, copyWidth);
} else if (component instanceof Transform) {
return this.applyTransform(component, copyAnchors);
} else if (component instanceof Glyph) {