🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

to
0.70.1

4

dist/cjs/ParseResult.js

@@ -596,3 +596,5 @@ "use strict";

const parseOptionsAnnotation = AST.getParseOptionsAnnotation(ast);
const parser = Option.isSome(parseOptionsAnnotation) ? (i, options) => raw(i, mergeInternalOptions(options, parseOptionsAnnotation.value)) : raw;
const parserWithOptions = Option.isSome(parseOptionsAnnotation) ? (i, options) => raw(i, mergeInternalOptions(options, parseOptionsAnnotation.value)) : raw;
const decodingFallbackAnnotation = AST.getDecodingFallbackAnnotation(ast);
const parser = isDecoding && Option.isSome(decodingFallbackAnnotation) ? (i, options) => handleForbidden(orElse(parserWithOptions(i, options), decodingFallbackAnnotation.value), ast, i, options) : parserWithOptions;
memoMap.set(ast, parser);

@@ -599,0 +601,0 @@ return parser;

@@ -164,2 +164,12 @@ /**

* @category annotations
* @since 0.70.1
*/
export type DecodingFallbackAnnotation<A> = (issue: ParseIssue) => Effect<A, ParseIssue>;
/**
* @category annotations
* @since 0.70.1
*/
export declare const DecodingFallbackAnnotationId: unique symbol;
/**
* @category annotations
* @since 0.67.0

@@ -256,2 +266,7 @@ */

/**
* @category annotations
* @since 0.70.1
*/
export declare const getDecodingFallbackAnnotation: (annotated: Annotated) => Option.Option<DecodingFallbackAnnotation<unknown>>;
/**
* @category model

@@ -1172,2 +1187,6 @@ * @since 0.67.0

/**
* @since 0.70.1
*/
export declare const getTemplateLiteralCapturingRegExp: (ast: TemplateLiteral) => RegExp;
/**
* @since 0.67.0

@@ -1174,0 +1193,0 @@ */

@@ -89,2 +89,7 @@ /**

export const ParseOptionsAnnotationId = /*#__PURE__*/Symbol.for("@effect/schema/annotation/ParseOptions");
/**
* @category annotations
* @since 0.70.1
*/
export const DecodingFallbackAnnotationId = /*#__PURE__*/Symbol.for("@effect/schema/annotation/DecodingFallback");
/** @internal */

@@ -169,2 +174,7 @@ export const SurrogateAnnotationId = /*#__PURE__*/Symbol.for("@effect/schema/annotation/Surrogate");

export const getParseOptionsAnnotation = /*#__PURE__*/getAnnotation(ParseOptionsAnnotationId);
/**
* @category annotations
* @since 0.70.1
*/
export const getDecodingFallbackAnnotation = /*#__PURE__*/getAnnotation(DecodingFallbackAnnotationId);
/** @internal */

@@ -1635,2 +1645,23 @@ export const getSurrogateAnnotation = /*#__PURE__*/getAnnotation(SurrogateAnnotationId);

/**
* @since 0.70.1
*/
export const getTemplateLiteralCapturingRegExp = ast => {
let pattern = `^`;
if (ast.head !== "") {
pattern += `(${regexp.escape(ast.head)})`;
}
for (const span of ast.spans) {
if (isStringKeyword(span.type)) {
pattern += `(${STRING_KEYWORD_PATTERN})`;
} else if (isNumberKeyword(span.type)) {
pattern += `(${NUMBER_KEYWORD_PATTERN})`;
}
if (span.literal !== "") {
pattern += `(${regexp.escape(span.literal)})`;
}
}
pattern += "$";
return new RegExp(pattern);
};
/**
* @since 0.67.0

@@ -1637,0 +1668,0 @@ */

@@ -562,3 +562,5 @@ /**

const parseOptionsAnnotation = AST.getParseOptionsAnnotation(ast);
const parser = Option.isSome(parseOptionsAnnotation) ? (i, options) => raw(i, mergeInternalOptions(options, parseOptionsAnnotation.value)) : raw;
const parserWithOptions = Option.isSome(parseOptionsAnnotation) ? (i, options) => raw(i, mergeInternalOptions(options, parseOptionsAnnotation.value)) : raw;
const decodingFallbackAnnotation = AST.getDecodingFallbackAnnotation(ast);
const parser = isDecoding && Option.isSome(decodingFallbackAnnotation) ? (i, options) => handleForbidden(orElse(parserWithOptions(i, options), decodingFallbackAnnotation.value), ast, i, options) : parserWithOptions;
memoMap.set(ast, parser);

@@ -565,0 +567,0 @@ return parser;

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

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

@@ -788,5 +788,10 @@ /**

const parseOptionsAnnotation = AST.getParseOptionsAnnotation(ast)
const parser: Parser = Option.isSome(parseOptionsAnnotation)
const parserWithOptions: Parser = Option.isSome(parseOptionsAnnotation)
? (i, options) => raw(i, mergeInternalOptions(options, parseOptionsAnnotation.value))
: raw
const decodingFallbackAnnotation = AST.getDecodingFallbackAnnotation(ast)
const parser: Parser = isDecoding && Option.isSome(decodingFallbackAnnotation)
? (i, options) =>
handleForbidden(orElse(parserWithOptions(i, options), decodingFallbackAnnotation.value), ast, i, options)
: parserWithOptions
memoMap.set(ast, parser)

@@ -1608,3 +1613,3 @@ return parser

const handleForbidden = <R, A>(
const handleForbidden = <A, R>(
effect: Effect.Effect<A, ParseIssue, R>,

@@ -1611,0 +1616,0 @@ ast: AST.AST,

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 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 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 too big to display

Sorry, the diff of this file is not supported yet

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

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

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