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

remix-forms

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remix-forms - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0

5

lib/formAction.server.d.ts

@@ -20,2 +20,3 @@ import { DomainFunction } from 'remix-domains';

mutation: DomainFunction<D>;
environment?: unknown;
};

@@ -27,4 +28,4 @@ export declare type FormActionProps<Schema extends SomeZodObject, D extends unknown> = {

} & PerformMutationProps<Schema, D>;
export declare function performMutation<Schema extends SomeZodObject, D extends unknown>({ request, schema, mutation, }: PerformMutationProps<Schema, D>): Promise<PerformMutation<z.infer<Schema>, D>>;
export declare function formAction<Schema extends SomeZodObject, D extends unknown>({ request, schema, mutation, beforeAction, beforeSuccess, successPath, }: FormActionProps<Schema, D>): Promise<Response>;
export declare function performMutation<Schema extends SomeZodObject, D extends unknown>({ request, schema, mutation, environment, }: PerformMutationProps<Schema, D>): Promise<PerformMutation<z.infer<Schema>, D>>;
export declare function formAction<Schema extends SomeZodObject, D extends unknown>({ request, schema, mutation, environment, beforeAction, beforeSuccess, successPath, }: FormActionProps<Schema, D>): Promise<Response>;
export {};

18

lib/formAction.server.js

@@ -8,7 +8,8 @@ "use strict";

const server_runtime_1 = require("@remix-run/server-runtime");
const fp_1 = require("lodash/fp");
const remix_domains_1 = require("remix-domains");
const getFormValues_1 = __importDefault(require("./getFormValues"));
async function performMutation({ request, schema, mutation, }) {
async function performMutation({ request, schema, mutation, environment, }) {
const values = await (0, getFormValues_1.default)(request, schema);
const result = await mutation(values);
const result = await mutation(values, environment);
if (result.success) {

@@ -22,4 +23,4 @@ return { success: true, data: result.data };

...(0, remix_domains_1.errorMessagesForSchema)(result.inputErrors, schema),
_global: result.errors.length
? result.errors.map((error) => error.message)
_global: result.errors.length || result.environmentErrors.length
? (0, fp_1.concat)(result.errors, result.environmentErrors).map((error) => error.message)
: undefined,

@@ -32,3 +33,3 @@ },

exports.performMutation = performMutation;
async function formAction({ request, schema, mutation, beforeAction, beforeSuccess, successPath, }) {
async function formAction({ request, schema, mutation, environment, beforeAction, beforeSuccess, successPath, }) {
if (beforeAction) {

@@ -39,3 +40,8 @@ const beforeActionResponse = await beforeAction(request);

}
const result = await performMutation({ request, schema, mutation });
const result = await performMutation({
request,
schema,
mutation,
environment,
});
if (result.success) {

@@ -42,0 +48,0 @@ if (beforeSuccess) {

{
"name": "remix-forms",
"version": "0.8.1",
"version": "0.9.0",
"description": "Magically create forms + actions in Remix!",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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