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

ampersand-state

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-state - npm Package Compare versions

Comparing version 4.4.2 to 4.4.3

2

ampersand-state.js

@@ -527,3 +527,3 @@ /*$AMPERSAND_VERSION*/

if (desc.setOnce) def.setOnce = true;
if (def.required && _.isUndefined(def.default)) def.default = object._getDefaultForType(type);
if (def.required && _.isUndefined(def.default) && !def.setOnce) def.default = object._getDefaultForType(type);
def.test = desc.test;

@@ -530,0 +530,0 @@ def.values = desc.values;

{
"name": "ampersand-state",
"description": "An observable, extensible state object with derived watchable properties.",
"version": "4.4.2",
"version": "4.4.3",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "browserify": {

@@ -1512,1 +1512,23 @@ var tape = require('tape');

});
test('#114 setOnce allows values to be set once and only once', function (t) {
var Model = State.extend({
props: {
x: {
type: 'string',
setOnce: true,
required: true,
}
}
});
var model = new Model({ x: 'foo' });
t.equal(model.x, 'foo');
t.throws(function () {
model.x = 'bar';
}, /can only be set once/);
t.end();
});
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