Socket
Socket
Sign inDemoInstall

ampersand-state

Package Overview
Dependencies
Maintainers
7
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.8.0 to 4.8.1

10

ampersand-state.js

@@ -194,2 +194,3 @@ 'use strict';

// If we have a defined type and the new type doesn't match, and we are not null, throw error.
// If we require specific value and new one is not one of them, throw error (unless it has default value or we're unsetting it with undefined).

@@ -206,3 +207,8 @@ if (newVal === undefined && def.required) {

if (def.values && !includes(def.values, newVal)) {
throw new TypeError('Property \'' + attr + '\' must be one of values: ' + def.values.join(', ') + '. Tried to set ' + newVal);
var defaultValue = result(def, 'default');
if (unset && defaultValue !== undefined) {
newVal = defaultValue;
} else if (!unset || (unset && newVal !== undefined)) {
throw new TypeError('Property \'' + attr + '\' must be one of values: ' + def.values.join(', ') + '. Tried to set ' + newVal);
}
}

@@ -620,3 +626,3 @@

set: function () {
throw new TypeError('"' + name + '" is a derived property, it can\'t be set directly.');
throw new TypeError("`" + name + "` is a derived property, it can't be set directly.");
}

@@ -623,0 +629,0 @@ });

2

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

@@ -6,0 +6,0 @@ "files": [

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