code: function findTypeForExtend(types, extend) {
    var orig = types.find(ea => ea.name === extend.name && ea.type !== "extend");
    if (!orig) throw new Error("Cannot find original for extension " + JSON.stringify(extend, null, 2));
    return orig;
  }
docs: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-