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

@standard-schema/utils

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@standard-schema/utils - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

8

dist/index.d.ts

@@ -1,2 +0,2 @@

import { v1 } from '@standard-schema/spec';
import { StandardSchemaV1 } from '@standard-schema/spec';

@@ -10,3 +10,3 @@ /**

*/
declare function getDotPath(issue: v1.StandardIssue): string | null;
declare function getDotPath(issue: StandardSchemaV1.Issue): string | null;

@@ -20,3 +20,3 @@ /**

*/
readonly issues: ReadonlyArray<v1.StandardIssue>;
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
/**

@@ -27,5 +27,5 @@ * Creates a schema error with useful information.

*/
constructor(issues: ReadonlyArray<v1.StandardIssue>);
constructor(issues: ReadonlyArray<StandardSchemaV1.Issue>);
}
export { SchemaError, getDotPath };
{
"name": "@standard-schema/utils",
"description": "The official runtime utils for Standard Schema",
"version": "0.2.1",
"version": "0.3.0",
"license": "MIT",

@@ -39,3 +39,3 @@ "author": "Fabian Hiller",

"devDependencies": {
"@standard-schema/spec": "npm:@jsr/standard-schema__spec@1.0.0-beta.2",
"@standard-schema/spec": "npm:@jsr/standard-schema__spec@1.0.0-beta.4",
"@vitest/coverage-v8": "2.1.2",

@@ -42,0 +42,0 @@ "tsup": "^8.3.0",

@@ -18,6 +18,6 @@ # Standard Schema Utils

```ts
import type { v1 } from "@standard-schema/spec";
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { getDotPath } from "@standard-schema/utils";
async function getFormErrors(schema: v1.StandardSchema, data: unknown) {
async function getFormErrors(schema: StandardSchemaV1, data: unknown) {
const result = await schema["~standard"].validate(data);

@@ -49,9 +49,9 @@ const formErrors: string[] = [];

```ts
import type { v1 } from "@standard-schema/spec";
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { SchemaError } from "@standard-schema/utils";
async function validateInput<TSchema extends v1.StandardSchema>(
async function validateInput<TSchema extends StandardSchemaV1>(
schema: TSchema,
data: unknown,
): Promise<v1.InferOutput<TSchema>> {
): Promise<StandardSchemaV1.InferOutput<TSchema>> {
const result = await schema["~standard"].validate(data);

@@ -58,0 +58,0 @@ if (result.issues) {

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