Socket
Socket
Sign inDemoInstall

redux-orm

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-orm - npm Package Compare versions

Comparing version 0.1.23 to 0.1.24

7

lib/Model.js

@@ -91,8 +91,3 @@ 'use strict';

set: function set(value) {
var _payload;
ModelClass.addUpdate({
type: _constants.UPDATE,
payload: (_payload = {}, _defineProperty(_payload, idAttribute, _this.getId()), _defineProperty(_payload, fieldName, value), _payload)
});
return _this.set(fieldName, value);
}

@@ -99,0 +94,0 @@ });

17

lib/test/testSchema.js

@@ -90,2 +90,19 @@ 'use strict';

});
it('correctly sets field value on assignment', function () {
schema.register(Person, Location);
var session = schema.from(schema.getDefaultState());
Person.create({ id: 0, name: 'Tommi', friend: null });
var nextState = session.reduce();
var nextSession = schema.from(nextState);
var newName = 'NewName';
nextSession.Person.withId(0).name = newName;
var nextNextState = session.reduce();
var nextNextSession = schema.from(nextNextState);
(0, _chai.expect)(nextNextSession.Person.withId(0).name).to.equal(newName);
});
});

@@ -92,0 +109,0 @@

{
"name": "redux-orm",
"version": "0.1.23",
"version": "0.1.24",
"description": "Simple ORM to manage and query your state trees",

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

@@ -57,11 +57,3 @@ import forOwn from 'lodash/object/forOwn';

get: () => fieldValue,
set: (value) => {
ModelClass.addUpdate({
type: UPDATE,
payload: {
[idAttribute]: this.getId(),
[fieldName]: value,
},
});
},
set: (value) => this.set(fieldName, value),
});

@@ -68,0 +60,0 @@ }

@@ -48,2 +48,19 @@ import {expect} from 'chai';

});
it('correctly sets field value on assignment', () => {
schema.register(Person, Location);
const session = schema.from(schema.getDefaultState());
Person.create({id: 0, name: 'Tommi', friend: null});
const nextState = session.reduce();
const nextSession = schema.from(nextState);
const newName = 'NewName';
nextSession.Person.withId(0).name = newName;
const nextNextState = session.reduce();
const nextNextSession = schema.from(nextNextState);
expect(nextNextSession.Person.withId(0).name).to.equal(newName);
});
});

@@ -50,0 +67,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