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

jsona

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsona - npm Package Compare versions

Comparing version 1.1.13 to 1.1.14

19

lib/builders/ModelsSerializer.js

@@ -90,18 +90,13 @@ "use strict";

var relationLength = relation.length;
var uniqueRelationKeys = [];
for (var i = 0; i < relationLength; i++) {
var id = _this.propertiesMapper.getId(relation[i]);
var type = _this.propertiesMapper.getType(relation[i]);
var itemKey = type + id;
var item = { id: id, type: type };
if (uniqueRelationKeys.indexOf(itemKey) !== -1) {
console.warn("Duplicate relation model found", { model: model, relations: relations });
var item = {
id: _this.propertiesMapper.getId(relation[i]),
type: _this.propertiesMapper.getType(relation[i])
};
if (item.id && item.type) {
relationshipData.push(item);
}
else if (!item.id || !item.type) {
else {
console.error("Can't create data item[" + i + "] for relationship " + k + ",\n it doesn't have 'id' or 'type', it was skipped", relation[i]);
}
else {
uniqueRelationKeys.push(itemKey);
relationshipData.push(item);
}
}

@@ -108,0 +103,0 @@ relationships[k] = {

{
"name": "jsona",
"description": "Provide data formatters (data model builder & json builder) to work with JSON API specification v1.0 in your JavaScript / TypeScript code",
"version": "1.1.13",
"version": "1.1.14",
"keywords": [

@@ -6,0 +6,0 @@ "json-api",

@@ -133,13 +133,12 @@ import {

const relationLength = relation.length;
const uniqueRelationKeys = [];
for (let i = 0; i < relationLength; i++) {
const id = this.propertiesMapper.getId(relation[i]);
const type = this.propertiesMapper.getType(relation[i]);
const itemKey = type + id;
const item = {id, type};
const item = {
id: this.propertiesMapper.getId(relation[i]),
type: this.propertiesMapper.getType(relation[i])
};
if (uniqueRelationKeys.indexOf(itemKey) !== -1) {
console.warn(`Duplicate relation model found`, { model, relations });
} else if (!item.id || !item.type) {
if (item.id && item.type) {
relationshipData.push(item);
} else {
console.error(

@@ -150,5 +149,2 @@ `Can't create data item[${i}] for relationship ${k},

);
} else {
uniqueRelationKeys.push(itemKey);
relationshipData.push(item);
}

@@ -155,0 +151,0 @@ }

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