Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap-ux/annotation-converter

Package Overview
Dependencies
Maintainers
0
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/annotation-converter

SAP Fiori OData - Annotation converter

  • 0.9.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68K
increased by1.43%
Maintainers
0
Weekly downloads
 
Created
Source

@sap-ux/annotation-converter

Provides a way to convert a raw metadata document object into a convenient structure where path are resolved already for you.

The goal of this module is to provide an object that is ready to use and should cover most of the needs one can have when it comes to manipulating an odata service and its annotation.

All the object defined by this will be compatible with the @sap-ux/vocabularies-types providing an easy way to evaluate annotations.

Installation

npm npm install --save-dev @sap-ux/annotation-converter

yarn yarn add @sap-ux/annotation-converter --dev

pnpm pnpm add @sap-ux/annotation-converter --dev

Usage

Import the convert method from the module

import { convert } from '@sap-ux/annotation-converter';

Use it on a raw metadata generated from @sap-ux/edmx-parser or complying to the same structure

const myRawMetadata = ... 

const myConvertedMetadata = convert(myRawMetadata);
const isDraftEnabled = myConvertedMetadata.entityTypes[0].annotations.Common?.DraftRoot || myConvertedMetadata.entityTypes[0].annotations.Common?.DraftNode;
const myLabel = myConvertedMetadata.entityTypes[0].properties[0].annotations?.Common?.Text?.$target?.name // Property name of the text annotation if it exists

Keywords

Annotation Converter

FAQs

Package last updated on 06 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc