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

lw-sdk

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lw-sdk - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

test/mock/jsonapi-response-duplicate-key.json

2

package.json
{
"name": "lw-sdk",
"version": "1.3.0",
"version": "1.3.1",
"description": "SDK for Laurel & Wolf API",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -32,2 +32,7 @@ import {map, forEach, pick} from 'lodash';

// Don't overwrite key that already exists
if (root[resource.type] && root[resource.type][resource.id]) {
return root;
}
Object.defineProperty(root[resource.type], resource.id, {

@@ -34,0 +39,0 @@ enumerable: true,

@@ -8,2 +8,3 @@ import serialize from '../src/serialize';

import responseDataNoRelationships from './mock/jsonapi-response-no-rel';
import repsonseDuplicateKey from './mock/jsonapi-response-duplicate-key';
import {namespace} from './utils/testing';

@@ -90,2 +91,14 @@

test.response('does not overwrite key if it already exists', ({pass, fail}) => {
try {
let res = serialize.response(repsonseDuplicateKey);
res.data.relationships.documents;
pass('ignored duplicate keys');
}
catch (e) {
fail(e.message);
}
});
test.response('should assign relationships to a key by relationship name, not type name', ({notEqual}) => {

@@ -92,0 +105,0 @@

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