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

@conform-to/yup

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@conform-to/yup - npm Package Compare versions

Comparing version 0.7.4 to 0.8.0-pre.0

10

index.d.ts

@@ -6,7 +6,2 @@ import { type FieldsetConstraint, type Submission } from '@conform-to/dom';

schema: Schema | ((intent: string) => Schema);
acceptMultipleErrors?: ({ name, intent, payload, }: {
name: string;
intent: string;
payload: Record<string, any>;
}) => boolean;
async?: false;

@@ -16,8 +11,3 @@ }): Submission<yup.InferType<Schema>>;

schema: Schema | ((intent: string) => Schema);
acceptMultipleErrors?: ({ name, intent, payload, }: {
name: string;
intent: string;
payload: Record<string, any>;
}) => boolean;
async: true;
}): Promise<Submission<yup.InferType<Schema>>>;

12

index.js

@@ -102,13 +102,5 @@ 'use strict';

error: error.inner.reduce((result, e) => {
var _e$path, _config$acceptMultipl;
var _e$path, _result$name;
var name = (_e$path = e.path) !== null && _e$path !== void 0 ? _e$path : '';
if (typeof result[name] === 'undefined') {
result[name] = e.message;
} else if ((_config$acceptMultipl = config.acceptMultipleErrors) !== null && _config$acceptMultipl !== void 0 && _config$acceptMultipl.call(config, {
name,
intent,
payload
})) {
result[name] = [].concat(result[name], e.message);
}
result[name] = [...((_result$name = result[name]) !== null && _result$name !== void 0 ? _result$name : []), e.message];
return result;

@@ -115,0 +107,0 @@ }, {})

4

package.json

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "0.7.4",
"version": "0.8.0-pre.0",
"main": "index.js",

@@ -29,3 +29,3 @@ "module": "index.mjs",

"peerDependencies": {
"@conform-to/dom": "0.7.4",
"@conform-to/dom": "0.8.0-pre.0",
"yup": ">=0.32.0"

@@ -32,0 +32,0 @@ },

@@ -68,3 +68,3 @@ # @conform-to/yup

```tsx
import { useForm } from '@conform-to/react';
import { useForm, report } from '@conform-to/react';
import { parse } from '@conform-to/yup';

@@ -88,3 +88,3 @@ import * as yup from 'yup';

if (!submission.value || submission.intent !== 'submit') {
return submission;
return report(submission);
}

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

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