@sitecore/sc-contenthub-webclient-sdk
Version:
Sitecore Content Hub WebClient SDK.
53 lines • 2.41 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var RelationSpecification_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelationSpecification = void 0;
const ta_json_1 = require("ta-json");
let RelationSpecification = RelationSpecification_1 = class RelationSpecification {
constructor(name, role) {
this.role = null;
this.name = name;
this.role = role !== null && role !== void 0 ? role : null;
}
deepClone() {
return new RelationSpecification_1(this.name, this.role);
}
deepEquals(other) {
if (!other)
return false;
return other.name === this.name && ((!other.role && !this.role) || other.role === this.role);
}
onDeserialized() {
var _a;
this.role = (_a = this.role) !== null && _a !== void 0 ? _a : null;
}
};
exports.RelationSpecification = RelationSpecification;
__decorate([
(0, ta_json_1.JsonProperty)("name"),
__metadata("design:type", String)
], RelationSpecification.prototype, "name", void 0);
__decorate([
(0, ta_json_1.JsonProperty)("role"),
__metadata("design:type", Object)
], RelationSpecification.prototype, "role", void 0);
__decorate([
(0, ta_json_1.OnDeserialized)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], RelationSpecification.prototype, "onDeserialized", null);
exports.RelationSpecification = RelationSpecification = RelationSpecification_1 = __decorate([
(0, ta_json_1.JsonObject)(),
__metadata("design:paramtypes", [String, Object])
], RelationSpecification);
//# sourceMappingURL=relation-specification.js.map