New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cerebral/forms

Package Overview
Dependencies
Maintainers
5
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerebral/forms - npm Package Compare versions

Comparing version 2.6.0-1510070698645 to 3.0.0-1511080103284

4

lib/form.js

@@ -122,3 +122,3 @@ 'use strict';

function computedField(fieldValueTag) {
return (0, _cerebral.compute)(fieldValueTag, function (fieldValue, get) {
return (0, _cerebral.Compute)(fieldValueTag, function (fieldValue, get) {
if (!fieldValue || (typeof fieldValue === 'undefined' ? 'undefined' : _typeof(fieldValue)) !== 'object') {

@@ -135,3 +135,3 @@ console.warn('Cerebral Forms - Field value: ' + fieldValueTag + ' did not resolve to an object');

function computedForm(formValueTag) {
return (0, _cerebral.compute)(formValueTag, function (formValue, get) {
return (0, _cerebral.Compute)(formValueTag, function (formValue, get) {
if (!formValue || (typeof formValue === 'undefined' ? 'undefined' : _typeof(formValue)) !== 'object') {

@@ -138,0 +138,0 @@ console.warn('Cerebral Forms - Form value: ' + formValueTag + ' did not resolve to an object');

@@ -34,2 +34,4 @@ 'use strict';

var _cerebral = require('cerebral');
var _tags = require('cerebral/tags');

@@ -64,27 +66,19 @@

return function (context) {
context.forms = {
get: function get(path) {
return context.resolve.value((0, _form2.default)((0, _tags.state)(_templateObject, path)));
},
reset: function reset(path) {
context.state.set(path, (0, _resetForm2.default)(context.state.get(path)));
},
toJSON: function toJSON(path) {
return (0, _formToJSON2.default)(context.state.get(path));
},
updateRules: function updateRules(newRules) {
Object.assign(_rules2.default, newRules);
},
updateErrorMessages: function updateErrorMessages(errorMessages) {
Object.assign(_rules2.default._errorMessages, errorMessages);
}
};
if (context.debugger) {
context.debugger.wrapProvider('forms');
return (0, _cerebral.Provider)({
get: function get(path) {
return this.context.resolve.value((0, _form2.default)((0, _tags.state)(_templateObject, path)));
},
reset: function reset(path) {
this.context.state.set(path, (0, _resetForm2.default)(this.context.state.get(path)));
},
toJSON: function toJSON(path) {
return (0, _formToJSON2.default)(this.context.state.get(path));
},
updateRules: function updateRules(newRules) {
Object.assign(_rules2.default, newRules);
},
updateErrorMessages: function updateErrorMessages(errorMessages) {
Object.assign(_rules2.default._errorMessages, errorMessages);
}
return context;
};
});
}

@@ -91,0 +85,0 @@

{
"name": "@cerebral/forms",
"version": "2.6.0-1510070698645",
"version": "3.0.0-1511080103284",
"description": "A computed form",

@@ -29,3 +29,3 @@ "main": "lib/index.js",

"dependencies": {
"cerebral": "^3.6.0-1510070698645"
"cerebral": "^4.0.0-1511080103284"
},

@@ -32,0 +32,0 @@ "nyc": {

Sorry, the diff of this file is not supported yet

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