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

@effect/schema

Package Overview
Dependencies
Maintainers
3
Versions
335
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/schema - npm Package Compare versions

Comparing version 0.73.2 to 0.73.3

22

dist/cjs/ParseResult.js

@@ -610,6 +610,20 @@ "use strict";

const from = goMemo(ast.from, true);
return (i, options) => handleForbidden(flatMap(mapError(from(i, options), e => new Refinement(ast, i, "From", e)), a => Option.match(ast.filter(a, options ?? AST.defaultParseOption, ast), {
onNone: () => Either.right(a),
onSome: e => Either.left(new Refinement(ast, i, "Predicate", e))
})), ast, i, options);
return (i, options) => {
options = options ?? AST.defaultParseOption;
const allErrors = options?.errors === "all";
const result = flatMap(orElse(from(i, options), ef => {
const issue = new Refinement(ast, i, "From", ef);
if (allErrors && AST.hasStableFilter(ast)) {
return Option.match(ast.filter(i, options, ast), {
onNone: () => Either.left(issue),
onSome: ep => Either.left(new Composite(ast, i, [issue, new Refinement(ast, i, "Predicate", ep)]))
});
}
return Either.left(issue);
}), a => Option.match(ast.filter(a, options, ast), {
onNone: () => Either.right(a),
onSome: ep => Either.left(new Refinement(ast, i, "Predicate", ep))
}));
return handleForbidden(result, ast, i, options);
};
} else {

@@ -616,0 +630,0 @@ const from = goMemo(AST.typeAST(ast), true);

9

dist/esm/AST.js

@@ -181,2 +181,4 @@ /**

const getStableFilterAnnotation = /*#__PURE__*/getAnnotation(StableFilterAnnotationId);
/** @internal */
export const hasStableFilter = annotated => Option.exists(getStableFilterAnnotation(annotated), b => b === true);
const JSONIdentifierAnnotationId = /*#__PURE__*/Symbol.for("@effect/schema/annotation/JSONIdentifier");

@@ -2098,7 +2100,4 @@ /** @internal */

}
if (!isTransformation(ast.from)) {
const annotations = getStableFilterAnnotation(ast);
if (Option.isSome(annotations) && annotations.value === true) {
return new Refinement(from, ast.filter);
}
if (!isTransformation(ast.from) && hasStableFilter(ast)) {
return new Refinement(from, ast.filter);
}

@@ -2105,0 +2104,0 @@ }

@@ -576,6 +576,20 @@ /**

const from = goMemo(ast.from, true);
return (i, options) => handleForbidden(flatMap(mapError(from(i, options), e => new Refinement(ast, i, "From", e)), a => Option.match(ast.filter(a, options ?? AST.defaultParseOption, ast), {
onNone: () => Either.right(a),
onSome: e => Either.left(new Refinement(ast, i, "Predicate", e))
})), ast, i, options);
return (i, options) => {
options = options ?? AST.defaultParseOption;
const allErrors = options?.errors === "all";
const result = flatMap(orElse(from(i, options), ef => {
const issue = new Refinement(ast, i, "From", ef);
if (allErrors && AST.hasStableFilter(ast)) {
return Option.match(ast.filter(i, options, ast), {
onNone: () => Either.left(issue),
onSome: ep => Either.left(new Composite(ast, i, [issue, new Refinement(ast, i, "Predicate", ep)]))
});
}
return Either.left(issue);
}), a => Option.match(ast.filter(a, options, ast), {
onNone: () => Either.right(a),
onSome: ep => Either.left(new Refinement(ast, i, "Predicate", ep))
}));
return handleForbidden(result, ast, i, options);
};
} else {

@@ -582,0 +596,0 @@ const from = goMemo(AST.typeAST(ast), true);

{
"name": "@effect/schema",
"version": "0.73.2",
"version": "0.73.3",
"description": "Modeling the schema of data structures as first-class values",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -811,19 +811,30 @@ /**

const from = goMemo(ast.from, true)
return (i, options) =>
handleForbidden(
flatMap(
mapError(from(i, options), (e) => new Refinement(ast, i, "From", e)),
(a) =>
Option.match(
ast.filter(a, options ?? AST.defaultParseOption, ast),
return (i, options) => {
options = options ?? AST.defaultParseOption
const allErrors = options?.errors === "all"
const result = flatMap(
orElse(from(i, options), (ef) => {
const issue = new Refinement(ast, i, "From", ef)
if (allErrors && AST.hasStableFilter(ast)) {
return Option.match(
ast.filter(i, options, ast),
{
onNone: () => Either.right(a),
onSome: (e) => Either.left(new Refinement(ast, i, "Predicate", e))
onNone: () => Either.left<ParseIssue>(issue),
onSome: (ep) => Either.left(new Composite(ast, i, [issue, new Refinement(ast, i, "Predicate", ep)]))
}
)
),
ast,
i,
options
}
return Either.left(issue)
}),
(a) =>
Option.match(
ast.filter(a, options, ast),
{
onNone: () => Either.right(a),
onSome: (ep) => Either.left(new Refinement(ast, i, "Predicate", ep))
}
)
)
return handleForbidden(result, ast, i, options)
}
} else {

@@ -830,0 +841,0 @@ const from = goMemo(AST.typeAST(ast), true)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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