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
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/annotation-converter - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

6

CHANGELOG.md
# @sap-ux/annotation-converter
## 0.6.6
### Patch Changes
- 9be80ce: Consider the alias when converting annotations
## 0.6.5

@@ -4,0 +10,0 @@

32

dist/converter.js

@@ -318,8 +318,7 @@ "use strict";

case 'EnumMember':
const aliasedEnum = converter.alias(propertyValue.EnumMember);
const splitEnum = aliasedEnum.split(' ');
if (splitEnum[0] && utils_1.EnumIsFlag[(0, utils_1.substringBeforeFirst)(splitEnum[0], '/')]) {
const splitEnum = propertyValue.EnumMember.split(' ').map((enumValue) => converter.toDefaultAlias(enumValue));
if (splitEnum[0] !== undefined && utils_1.EnumIsFlag[(0, utils_1.substringBeforeFirst)(splitEnum[0], '/')]) {
return splitEnum;
}
return aliasedEnum;
return splitEnum[0];
case 'PropertyPath':

@@ -606,12 +605,2 @@ return {

}
/**
* Split the alias from the term value.
*
* @param references the current set of references
* @param termValue the value of the term
* @returns the term alias and the actual term value
*/
function splitTerm(references, termValue) {
return (0, utils_1.splitAtLast)((0, utils_1.alias)(references, termValue), '.');
}
function convertAnnotation(converter, target, rawAnnotation) {

@@ -807,7 +796,16 @@ var _a;

}
/**
* Split the alias from the term value.
*
* @param term the value of the term
* @returns the term alias and the actual term value
*/
splitTerm(term) {
return splitTerm(this.rawMetadata.references, term);
const aliased = (0, utils_1.alias)(VocabularyReferences_1.VocabularyReferences, term);
return (0, utils_1.splitAtLast)(aliased, '.');
}
alias(value) {
return (0, utils_1.alias)(this.rawMetadata.references, value);
toDefaultAlias(value) {
var _a;
const unaliased = (_a = (0, utils_1.unalias)(this.rawMetadata.references, value)) !== null && _a !== void 0 ? _a : '';
return (0, utils_1.alias)(VocabularyReferences_1.VocabularyReferences, unaliased);
}

@@ -814,0 +812,0 @@ unalias(value) {

{
"name": "@sap-ux/annotation-converter",
"version": "0.6.5",
"version": "0.6.6",
"description": "SAP Fiori OData - Annotation converter",

@@ -5,0 +5,0 @@ "repository": {

@@ -40,3 +40,2 @@ import type {

} from '@sap-ux/vocabularies-types';
import type { ReferencesWithMap } from './utils';
import {

@@ -442,8 +441,9 @@ addGetByValue,

case 'EnumMember':
const aliasedEnum = converter.alias(propertyValue.EnumMember);
const splitEnum = aliasedEnum.split(' ');
if (splitEnum[0] && EnumIsFlag[substringBeforeFirst(splitEnum[0], '/')]) {
const splitEnum = propertyValue.EnumMember.split(' ').map((enumValue) =>
converter.toDefaultAlias(enumValue)
);
if (splitEnum[0] !== undefined && EnumIsFlag[substringBeforeFirst(splitEnum[0], '/')]) {
return splitEnum;
}
return aliasedEnum;
return splitEnum[0];

@@ -856,13 +856,2 @@ case 'PropertyPath':

/**
* Split the alias from the term value.
*
* @param references the current set of references
* @param termValue the value of the term
* @returns the term alias and the actual term value
*/
function splitTerm(references: ReferencesWithMap, termValue: string) {
return splitAtLast(alias(references, termValue), '.');
}
function convertAnnotation(converter: Converter, target: any, rawAnnotation: RawAnnotation): Annotation {

@@ -1139,8 +1128,16 @@ let annotation: any;

/**
* Split the alias from the term value.
*
* @param term the value of the term
* @returns the term alias and the actual term value
*/
splitTerm(term: string) {
return splitTerm(this.rawMetadata.references, term);
const aliased = alias(VocabularyReferences, term);
return splitAtLast(aliased, '.');
}
alias(value: string) {
return alias(this.rawMetadata.references, value);
toDefaultAlias(value: string) {
const unaliased = unalias(this.rawMetadata.references, value) ?? '';
return alias(VocabularyReferences, unaliased);
}

@@ -1147,0 +1144,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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