UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

24 lines 1.06 kB
/*--------------------------------------------------------------------------------------------- * 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 */ /** @internal */ export 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