UNPKG

angular-odata

Version:

Client side OData typescript library for Angular

33 lines 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CsdlSingleton = void 0; const csdl_annotation_1 = require("./csdl-annotation"); const csdl_navigation_property_binding_1 = require("./csdl-navigation-property-binding"); class CsdlSingleton extends csdl_annotation_1.CsdlAnnotable { constructor(container, { Name, Type, NavigationPropertyBindings, Annotation, }) { super({ Annotation }); this.container = container; this.Name = Name; this.Type = Type; this.NavigationPropertyBindings = NavigationPropertyBindings === null || NavigationPropertyBindings === void 0 ? void 0 : NavigationPropertyBindings.map((n) => new csdl_navigation_property_binding_1.CsdlNavigationPropertyBinding(n)); } toJson() { const json = Object.assign(Object.assign({}, super.toJson()), { Name: this.Name, Type: this.Type }); if (Array.isArray(this.NavigationPropertyBindings) && this.NavigationPropertyBindings.length > 0) { json['NavigationPropertyBindings'] = this.NavigationPropertyBindings.map((n) => n.toJson()); } return json; } name() { return `${this.Name}`; } namespace() { return `${this.container.namespace()}`; } fullName() { return `${this.container.namespace()}.${this.Name}`; } } exports.CsdlSingleton = CsdlSingleton; //# sourceMappingURL=csdl-singleton.js.map