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

@sap/cds-compiler

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds-compiler - npm Package Compare versions

Comparing version 4.4.2 to 4.4.4

6

CHANGELOG.md

@@ -10,2 +10,8 @@ # ChangeLog for cds compiler and backends

## Version 4.4.4 - 2023-11-24
### Fixed
- to.hdi.migration: Changes in only `doc`-comments should not result in a drop-create of the primary key.
## Version 4.4.2 - 2023-11-17

@@ -12,0 +18,0 @@

14

lib/modelCompare/compare.js

@@ -193,3 +193,3 @@ 'use strict';

forEach(changedElements, (_name, change) => {
if((change.old.key || change.new.key) && !change.new.target && !change.old.target) {
if(!change.onlyDoc && (change.old.key || change.new.key) && !change.new.target && !change.old.target) {
// For to.hdi.migration: Just drop-create (commented out), for to.sql.migration: Handle case where we add/remove "key" keyword, no drop-create otherwise

@@ -280,2 +280,4 @@ if(options.sqlDialect === 'hana' && options.src === 'hdi' || (!change.old.key || !change.new.key)) {

changedElementsDict[name] = changedElement(element, otherElement);
} else if(docCommentChanged(element, otherElement)) {
changedElementsDict[name] = { ...changedElement(element, otherElement), onlyDoc: true };
}

@@ -361,2 +363,5 @@

function docCommentChanged(element, otherElement) {
return element.doc && !otherElement.doc || otherElement.doc && !element.doc || element.doc && element.doc !== otherElement.doc;
}

@@ -370,3 +375,4 @@ const relevantProperties = {

/**
* Returns whether any type parameters differ between two given elements. Ignores whether types themselves differ (`type` property).
* Returns whether any type parameters differ between two given elements. Ignores whether types themselves differ (`type` property) and ignores
* diff in doc comments.
* @param element {object} an element

@@ -380,3 +386,3 @@ * @param otherElement {object} another element

if (Object.prototype.hasOwnProperty.call(element, key))
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type') {
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && key !== 'doc') {
checked.add(key);

@@ -390,3 +396,3 @@ if(!deepEqual(element[key], otherElement[key]))

if (Object.prototype.hasOwnProperty.call(otherElement, key))
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && !checked.has(key))
if((!key.startsWith('@') || relevantProperties[key]) && key !== 'type' && key !== 'doc' && !checked.has(key))
return true;

@@ -393,0 +399,0 @@ }

{
"name": "@sap/cds-compiler",
"version": "4.4.2",
"version": "4.4.4",
"description": "CDS (Core Data Services) compiler and backends",

@@ -5,0 +5,0 @@ "homepage": "https://cap.cloud.sap/",

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