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

@sap-ux/fe-mockserver-core

Package Overview
Dependencies
Maintainers
3
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/fe-mockserver-core - npm Package Compare versions

Comparing version 1.1.38 to 1.1.39

1

dist/mockdata/fileBasedMockData.d.ts

@@ -11,2 +11,3 @@ import type { Action, ComplexType, EntityType, Property, TypeDefinition } from '@sap-ux/vocabularies-types';

constructor(mockData: any[], entityType: EntityType, mockDataEntitySet: EntitySetInterface, contextId: string);
private validateProperties;
addEntry(mockEntry: any, _odataRequest: ODataRequest): Promise<void>;

@@ -13,0 +14,0 @@ updateEntry(keyValues: KeyDefinitions, updatedData: object, _patchData: object, _odataRequest: ODataRequest): Promise<void>;

24

dist/mockdata/fileBasedMockData.js

@@ -9,2 +9,3 @@ "use strict";

const common_1 = require("../data/common");
const annotation_converter_1 = require("@sap-ux/annotation-converter");
function performSimpleComparison(operator, mockValue, targetLiteral) {

@@ -48,13 +49,3 @@ let isValid = true;

// We need to ensure that complex types are at least partially created
this._entityType.entityProperties.forEach((prop) => {
if (prop.targetType && prop.targetType._type === 'ComplexType' && !mockLine[prop.name]) {
mockLine[prop.name] = {};
prop.targetType.properties.forEach((subProp) => {
mockLine[prop.name][subProp.name] = this.getDefaultValueFromType(subProp.type, subProp.targetType, subProp.defaultValue);
});
}
if (!prop.nullable && !mockLine.hasOwnProperty(prop.name)) {
mockLine[prop.name] = this.getDefaultValueFromType(prop.type, prop.targetType, prop.defaultValue);
}
});
this.validateProperties(mockLine, this._entityType.entityProperties);
});

@@ -64,2 +55,13 @@ }

}
validateProperties(mockEntry, properties) {
properties.forEach((prop) => {
if (!prop.nullable && !mockEntry.hasOwnProperty(prop.name)) {
mockEntry[prop.name] = this.getDefaultValueFromType(prop.type, prop.targetType, prop.defaultValue);
}
else if (mockEntry.hasOwnProperty(prop.name) && (0, annotation_converter_1.isComplexTypeDefinition)(prop.targetType)) {
// If the property is defined from a complex type we should validate the property of the complex type
this.validateProperties(mockEntry[prop.name], prop.targetType.properties);
}
});
}
async addEntry(mockEntry, _odataRequest) {

@@ -66,0 +68,0 @@ this._mockData.push(mockEntry);

{
"name": "@sap-ux/fe-mockserver-core",
"version": "1.1.38",
"version": "1.1.39",
"description": "SAP Fiori OData - Fiori elements mock server core",

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

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