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

formula-one

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formula-one - npm Package Compare versions

Comparing version 0.9.0-alpha.2 to 0.9.0-alpha.3

2

CHANGELOG.md

@@ -26,2 +26,4 @@ # Changelog

- Fix flow types for ErrorHelper.
### v0.8.2

@@ -28,0 +30,0 @@

26

dist/ErrorsHelper.js

@@ -7,2 +7,4 @@ "use strict";

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // strict
var _react = require("react");

@@ -12,16 +14,8 @@

require("./Form");
var _Form = require("./Form");
var _withFormContext = require("./withFormContext");
var _withFormContext2 = _interopRequireDefault(_withFormContext);
var _formState = require("./formState");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
// strict
function flattenErrors(errors) {

@@ -53,2 +47,14 @@ var flatErrors = [];

exports.default = (0, _withFormContext2.default)(ErrorsHelper);
// Using a HOC here is not possible due to a Flow bug: https://github.com/facebook/flow/issues/6903
function wrap(props) {
return React.createElement(
_Form.FormContext.Consumer,
null,
function (formContext) {
return React.createElement(ErrorsHelper, _extends({}, props, { formContext: formContext }));
}
);
}
wrap.defaultProps = ErrorsHelper.defaultProps;
exports.default = wrap;
{
"name": "formula-one",
"version": "0.9.0-alpha.2",
"version": "0.9.0-alpha.3",
"description": "Strongly-typed React form state management",

@@ -5,0 +5,0 @@ "author": "Zach Gotsch",

@@ -5,4 +5,3 @@ // @flow strict

import type {FieldLink, ClientErrors, ServerErrors, Err} from "./types";
import {type FormContextPayload} from "./Form";
import withFormContext from "./withFormContext";
import {FormContext, type FormContextPayload} from "./Form";
import {getExtras} from "./formState";

@@ -43,2 +42,12 @@

export default withFormContext(ErrorsHelper);
// Using a HOC here is not possible due to a Flow bug: https://github.com/facebook/flow/issues/6903
function wrap<E>(props: $Diff<Props<E>, {+formContext: FormContextPayload}>) {
return (
<FormContext.Consumer>
{formContext => <ErrorsHelper {...props} formContext={formContext} />}
</FormContext.Consumer>
);
}
wrap.defaultProps = ErrorsHelper.defaultProps;
export default wrap;
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