Socket
Socket
Sign inDemoInstall

formact

Package Overview
Dependencies
6
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 2.0.4

13

lib/index.js

@@ -8,4 +8,6 @@ "use strict";

exports.__esModule = true;
exports.default = exports.useField = exports.EMAIL_VALIDATION = exports.EMAIL_REGEX = exports.useForm = void 0;
exports.turnIntoField = exports.default = exports.useField = exports.EMAIL_VALIDATION = exports.EMAIL_REGEX = exports.useForm = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

@@ -400,2 +402,9 @@

var _default = Form;
exports.default = _default;
exports.default = _default;
var turnIntoField = function turnIntoField(props, Component) {
var fieldProps = useField(props);
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, props, fieldProps));
};
exports.turnIntoField = turnIntoField;

2

package.json
{
"name": "formact",
"version": "2.0.3",
"version": "2.0.4",
"description": "Context for React form components with validation",

@@ -5,0 +5,0 @@ "scripts": {

@@ -24,3 +24,3 @@ // @flow

type ValidationFunction = (value: string, values: Object) => ?string
export type ValidationFunction = (value: string, values: Object) => ?string
export type Validation = ValidationFunction | Array<ValidationFunction>

@@ -332,2 +332,7 @@

export type DefaultErrorMessages = {
email?: string,
required?: string,
}
export type FieldProps = {

@@ -339,6 +344,3 @@ name: string,

onBlur?: (event: Object) => any,
defaultErrorMessages?: {
email?: string,
required?: string,
},
defaultErrorMessages?: DefaultErrorMessages,
}

@@ -444,3 +446,3 @@

type FormProps = {
export type FormProps = {
onSubmit: (payload: FormSubmitPayload) => any,

@@ -486,1 +488,6 @@ initialValues?: Object,

export default Form
export const turnIntoField = (props: FieldProps, Component: any) => {
const fieldProps = useField(props)
return <Component {...props} {...fieldProps} />
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc