Socket
Socket
Sign inDemoInstall

@effect/io

Package Overview
Dependencies
Maintainers
3
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/io - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

11

Cause.d.ts

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

import type * as FiberId from "@effect/io/Fiber/Id";
import type { Continuation } from "@effect/io/internal/core";
import type { Stack } from "@effect/io/internal/stack";
import type * as Chunk from "@fp-ts/data/Chunk";

@@ -147,4 +145,4 @@ import type * as Either from "@fp-ts/data/Either";

readonly [StackAnnotationTypeId]: StackAnnotationTypeId;
readonly stack: Stack<Continuation> | undefined;
readonly execution: Chunk.Chunk<string> | undefined;
readonly stack: Chunk.Chunk<string>;
readonly execution: Chunk.Chunk<string>;
}

@@ -186,7 +184,2 @@ /**

readonly ribbonFraction: number;
readonly renderSpan: boolean;
readonly renderExecution: boolean;
readonly renderStack: boolean;
readonly renderExecutionDepth: number;
readonly renderStackDepth: number;
readonly renderError: (error: E) => ReadonlyArray<string>;

@@ -193,0 +186,0 @@ readonly renderUnknown: (error: unknown) => ReadonlyArray<string>;

67

internal/cause.js

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

exports.unannotate = exports.stripSomeDefects = exports.stripFailures = exports.squashWith = exports.squash = exports.size = exports.sequential = exports.reduceWithContext = exports.reduce = exports.pretty = exports.parallel = exports.match = exports.map = exports.linearize = exports.keepDefects = exports.isStackAnnotation = exports.isSpanAnnotation = exports.isSequentialType = exports.isRuntimeException = exports.isParallelType = exports.isNoSuchElementException = exports.isInvalidCapacityError = exports.isInterruptedOnly = exports.isInterruptedException = exports.isInterrupted = exports.isInterruptType = exports.isIllegalArgumentException = exports.isFailure = exports.isFailType = exports.isEmptyType = exports.isEmpty = exports.isDieType = exports.isDie = exports.isCause = exports.isAnnotatedType = exports.interruptors = exports.interruptOption = exports.interrupt = exports.flatten = exports.flatMap = exports.find = exports.filter = exports.failures = exports.failureOrCause = exports.failureOption = exports.fail = exports.empty = exports.dieOption = exports.die = exports.defects = exports.defaultRenderer = exports.contains = exports.as = exports.annotated = exports.StackAnnotationTypeId = exports.StackAnnotation = exports.SpanAnnotationTypeId = exports.SpanAnnotation = exports.RuntimeExceptionTypeId = exports.RuntimeException = exports.NoSuchElementExceptionTypeId = exports.NoSuchElementException = exports.InvalidHubCapacityExceptionTypeId = exports.InvalidHubCapacityException = exports.InterruptedExceptionTypeId = exports.InterruptedException = exports.IllegalArgumentExceptionTypeId = exports.IllegalArgumentException = exports.CauseTypeId = void 0;
var Debug = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Debug"));
var FiberId = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Fiber/Id"));
var OpCodes = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal/opCodes/effect"));
var _stack = /*#__PURE__*/require("@effect/io/internal/stack");

@@ -452,3 +450,3 @@ var Doc = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/printer/Doc"));

{
stack = new _stack.Stack(stack.value.left, new _stack.Stack(stack.value.right, stack));
stack = new _stack.Stack(stack.value.left, new _stack.Stack(stack.value.right, stack.previous));
break;

@@ -996,26 +994,4 @@ }

/** @internal */
const stackToLines = (stack, renderer) => {
const lines = [];
let current = stack.stack;
let last = undefined;
while (current !== undefined && lines.length < renderer.renderStackDepth) {
switch (current.value.op) {
case OpCodes.OP_ON_FAILURE:
case OpCodes.OP_ON_SUCCESS:
case OpCodes.OP_ON_SUCCESS_AND_FAILURE:
{
if (current.value.trace && current.value.trace !== last) {
last = current.value.trace;
lines.push(Doc.text(current.value.trace));
}
break;
}
}
current = current.previous;
}
return lines;
};
/** @internal */
const renderSpan = (span, renderer) => {
if (!renderer.renderSpan || Option.isNone(span)) {
const renderSpan = span => {
if (Option.isNone(span)) {
return [];

@@ -1027,16 +1003,16 @@ }

/** @internal */
const renderStack = (span, renderer) => {
if (!renderer.renderStack || Option.isNone(span)) {
const renderStack = span => {
if (Option.isNone(span)) {
return [];
}
const lines = stackToLines(span.value, renderer);
const lines = Chunk.map(Doc.text)(span.value.stack);
return lines.length === 0 ? [] : [Doc.text("Stack:"), Doc.empty, ...lines, Doc.empty];
};
/** @internal */
const renderExecution = (span, renderer) => {
if (!renderer.renderExecution || Option.isNone(span)) {
const renderExecution = span => {
if (Option.isNone(span)) {
return [];
}
if (span.value.execution && Chunk.isNonEmpty(span.value.execution)) {
return [Doc.text("Execution:"), Doc.empty, ...Chunk.map(line => Doc.text(line))(Chunk.take(renderer.renderExecutionDepth)(span.value.execution)), Doc.empty];
if (Chunk.isNonEmpty(span.value.execution)) {
return [Doc.text("Execution:"), Doc.empty, ...Chunk.map(Doc.text)(span.value.execution), Doc.empty];
}

@@ -1046,13 +1022,13 @@ return [];

/** @internal */
const renderFail = (error, span, stack, renderer) => {
return SequentialSegment([FailureSegment([Doc.text("A checked error was not handled."), Doc.empty, ...error, Doc.empty, ...renderSpan(span, renderer), ...renderStack(stack, renderer), ...renderExecution(stack, renderer)])]);
const renderFail = (error, span, stack) => {
return SequentialSegment([FailureSegment([Doc.text("A checked error was not handled."), Doc.empty, ...error, Doc.empty, ...renderSpan(span), ...renderStack(stack), ...renderExecution(stack)])]);
};
/** @internal */
const renderDie = (error, span, stack, renderer) => {
return SequentialSegment([FailureSegment([Doc.text("An unchecked error was produced."), Doc.empty, ...error, Doc.empty, ...renderSpan(span, renderer), ...renderStack(stack, renderer), ...renderExecution(stack, renderer)])]);
const renderDie = (error, span, stack) => {
return SequentialSegment([FailureSegment([Doc.text("An unchecked error was produced."), Doc.empty, ...error, Doc.empty, ...renderSpan(span), ...renderStack(stack), ...renderExecution(stack)])]);
};
/** @internal */
const renderInterrupt = (fiberId, span, stack, renderer) => {
const renderInterrupt = (fiberId, span, stack) => {
const ids = Array.from(FiberId.ids(fiberId)).map(id => `#${id}`).join(", ");
return SequentialSegment([FailureSegment([Doc.text(`An interrupt was produced by ${ids}.`), Doc.empty, ...renderSpan(span, renderer), ...renderStack(stack, renderer), ...renderExecution(stack, renderer)])]);
return SequentialSegment([FailureSegment([Doc.text(`An interrupt was produced by ${ids}.`), Doc.empty, ...renderSpan(span), ...renderStack(stack), ...renderExecution(stack)])]);
};

@@ -1133,11 +1109,11 @@ /** @internal */

{
return SafeEval.succeed(renderFail(renderer.renderError(cause.error).map(line => Doc.text(line)), span, stack, renderer));
return SafeEval.succeed(renderFail(renderer.renderError(cause.error).map(line => Doc.text(line)), span, stack));
}
case "Die":
{
return SafeEval.succeed(renderDie(renderer.renderUnknown(cause.defect).map(line => Doc.text(line)), span, stack, renderer));
return SafeEval.succeed(renderDie(renderer.renderUnknown(cause.defect).map(line => Doc.text(line)), span, stack));
}
case "Interrupt":
{
return SafeEval.succeed(renderInterrupt(cause.fiberId, span, stack, renderer));
return SafeEval.succeed(renderInterrupt(cause.fiberId, span, stack));
}

@@ -1173,7 +1149,2 @@ case "Sequential":

ribbonFraction: 1,
renderSpan: Debug.runtimeDebug.traceSpanEnabledInCause,
renderStack: Debug.runtimeDebug.traceStackEnabledInCause,
renderExecution: Debug.runtimeDebug.traceExecutionEnabledInCause,
renderStackDepth: Debug.runtimeDebug.traceStackLimit,
renderExecutionDepth: Debug.runtimeDebug.traceExecutionLimit,
renderError: defaultErrorToLines,

@@ -1180,0 +1151,0 @@ renderUnknown: defaultErrorToLines

{
"name": "@effect/io",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": {

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 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 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 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

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