UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

27 lines 1.2 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module Metadata */ Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeCustomAttributes = serializeCustomAttributes; /** @internal */ function serializeCustomAttributes(customAttributes) { if (undefined !== customAttributes) { // custom attributes is optional const attributes = []; for (const [, customAttribute] of customAttributes) { const attribute = {}; Object.keys(customAttribute).map((property) => { const propertyName = property.toString(); attribute[propertyName] = customAttribute[property]; }); attributes.push(attribute); } return (attributes.length > 0) ? attributes : undefined; } return undefined; } //# sourceMappingURL=CustomAttribute.js.map