@shapediver/sdk.sdtf-v1
Version:
Official sdTF SDK for TypeScript
32 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SdtfAttribute = exports.SdtfPartialAttributes = void 0;
const SdtfBasePartialComponent_1 = require("./SdtfBasePartialComponent");
class SdtfPartialAttributes extends SdtfBasePartialComponent_1.SdtfBasePartialComponent {
constructor() {
super(...arguments);
this.entries = {};
}
toJson() {
const json = {};
Object.entries(this.entries).forEach(([name, attribute]) => {
json[name] = attribute.toJson();
});
return json;
}
}
exports.SdtfPartialAttributes = SdtfPartialAttributes;
class SdtfAttribute extends SdtfBasePartialComponent_1.SdtfBasePartialComponent {
toJson() {
const json = {};
if (this.accessor !== undefined)
json.accessor = this.accessor;
if (this.typeHint !== undefined)
json.typeHint = this.typeHint;
if (this.value !== undefined)
json.value = this.value;
return json;
}
}
exports.SdtfAttribute = SdtfAttribute;
//# sourceMappingURL=SdtfPartialAttributes.js.map