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.27.2 to 0.28.0

2

internal_effect_untraced/logger-circular.js

@@ -17,4 +17,4 @@ "use strict";

/** @internal */
const test = /*#__PURE__*/(0, _Function.dual)(2, (self, input) => self.log(_fiberId.none, core.logLevelInfo, input, Cause.empty, fiberRefs.unsafeMake(new Map()), List.empty(), HashMap.empty()));
const test = /*#__PURE__*/(0, _Function.dual)(2, (self, input) => self.log(_fiberId.none, core.logLevelInfo, input, Cause.empty, fiberRefs.unsafeMake(new Map()), List.empty(), HashMap.empty(), new Date()));
exports.test = test;
//# sourceMappingURL=logger-circular.js.map

@@ -12,6 +12,6 @@ "use strict";

var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option"));
var LogSpan = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Logger/Span"));
var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/cause"));
var Pretty = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/cause-pretty"));
var _fiberId = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/internal_effect_untraced/fiberId"));
var LogSpan = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Logger/Span"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -36,4 +36,45 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

exports.makeLogger = makeLogger;
const stringLogger = /*#__PURE__*/makeLogger((fiberId, logLevel, message, cause, _context, spans, annotations) => {
const now = new Date();
const contramap = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations, date) => self.log(fiberId, logLevel, restore(f)(message), cause, context, spans, annotations, date)));
/** @internal */
exports.contramap = contramap;
const filterLogLevel = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations, date) => restore(f)(logLevel) ? Option.some(self.log(fiberId, logLevel, message, cause, context, spans, annotations, date)) : Option.none()));
/** @internal */
exports.filterLogLevel = filterLogLevel;
const map = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations, date) => restore(f)(self.log(fiberId, logLevel, message, cause, context, spans, annotations, date))));
/** @internal */
exports.map = map;
const none = () => ({
[LoggerTypeId]: loggerVariance,
log: _Function.constVoid
});
/** @internal */
exports.none = none;
const simple = log => ({
[LoggerTypeId]: loggerVariance,
log: (_fiberId, _logLevel, message, _cause, _context, _spans, _annotations) => {
return log(message);
}
});
/** @internal */
exports.simple = simple;
const succeed = value => {
return simple(() => value);
};
/** @internal */
exports.succeed = succeed;
const sync = evaluate => {
return simple(evaluate);
};
/** @internal */
exports.sync = sync;
const zip = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations, date) => [self.log(fiberId, logLevel, message, cause, context, spans, annotations, date), that.log(fiberId, logLevel, message, cause, context, spans, annotations, date)]));
/** @internal */
exports.zip = zip;
const zipLeft = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => map(zip(self, that), tuple => tuple[0]));
/** @internal */
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => map(zip(self, that), tuple => tuple[1]));
/** @internal */
exports.zipRight = zipRight;
const stringLogger = /*#__PURE__*/makeLogger((fiberId, logLevel, message, cause, _context, spans, annotations, now) => {
const nowMillis = now.getTime();

@@ -85,4 +126,3 @@ const outputArray = [`timestamp=${now.toISOString()}`, `level=${logLevel.label}`, `fiber=${_fiberId.threadName(fiberId)}`];

/** @internal */
const logfmtLogger = /*#__PURE__*/makeLogger((fiberId, logLevel, message, cause, _context, spans, annotations) => {
const now = new Date();
const logfmtLogger = /*#__PURE__*/makeLogger((fiberId, logLevel, message, cause, _context, spans, annotations, now) => {
const nowMillis = now.getTime();

@@ -139,44 +179,2 @@ const outputArray = [`timestamp=${now.toISOString()}`, `level=${logLevel.label}`, `fiber=${_fiberId.threadName(fiberId)}`];

};
/** @internal */
const contramap = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations) => self.log(fiberId, logLevel, restore(f)(message), cause, context, spans, annotations)));
/** @internal */
exports.contramap = contramap;
const filterLogLevel = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations) => restore(f)(logLevel) ? Option.some(self.log(fiberId, logLevel, message, cause, context, spans, annotations)) : Option.none()));
/** @internal */
exports.filterLogLevel = filterLogLevel;
const map = /*#__PURE__*/Debug.untracedDual(2, restore => (self, f) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations) => restore(f)(self.log(fiberId, logLevel, message, cause, context, spans, annotations))));
/** @internal */
exports.map = map;
const none = () => ({
[LoggerTypeId]: loggerVariance,
log: _Function.constVoid
});
/** @internal */
exports.none = none;
const simple = log => ({
[LoggerTypeId]: loggerVariance,
log: (_fiberId, _logLevel, message, _cause, _context, _spans, _annotations) => {
return log(message);
}
});
/** @internal */
exports.simple = simple;
const succeed = value => {
return simple(() => value);
};
/** @internal */
exports.succeed = succeed;
const sync = evaluate => {
return simple(evaluate);
};
/** @internal */
exports.sync = sync;
const zip = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => makeLogger((fiberId, logLevel, message, cause, context, spans, annotations) => [self.log(fiberId, logLevel, message, cause, context, spans, annotations), that.log(fiberId, logLevel, message, cause, context, spans, annotations)]));
/** @internal */
exports.zip = zip;
const zipLeft = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => map(zip(self, that), tuple => tuple[0]));
/** @internal */
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => map(zip(self, that), tuple => tuple[1]));
exports.zipRight = zipRight;
//# sourceMappingURL=logger.js.map

@@ -31,3 +31,3 @@ /**

export interface Logger<Message, Output> extends Logger.Variance<Message, Output> {
readonly log: (fiberId: FiberId.FiberId, logLevel: LogLevel.LogLevel, message: Message, cause: Cause.Cause<unknown>, context: FiberRefs.FiberRefs, spans: List.List<LogSpan.LogSpan>, annotations: HashMap.HashMap<string, string>) => Output;
readonly log: (fiberId: FiberId.FiberId, logLevel: LogLevel.LogLevel, message: Message, cause: Cause.Cause<unknown>, context: FiberRefs.FiberRefs, spans: List.List<LogSpan.LogSpan>, annotations: HashMap.HashMap<string, string>, now: Date) => Output;
}

@@ -53,3 +53,3 @@ /**

*/
export declare const make: <Message, Output>(log: (fiberId: FiberId.FiberId, logLevel: LogLevel.LogLevel, message: Message, cause: Cause.Cause<unknown>, context: FiberRefs.FiberRefs, spans: List.List<LogSpan.LogSpan>, annotations: HashMap.HashMap<string, string>) => Output) => Logger<Message, Output>;
export declare const make: <Message, Output>(log: (fiberId: FiberId.FiberId, logLevel: LogLevel.LogLevel, message: Message, cause: Cause.Cause<unknown>, context: FiberRefs.FiberRefs, spans: List.List<LogSpan.LogSpan>, annotations: HashMap.HashMap<string, string>, now: Date) => Output) => Logger<Message, Output>;
/**

@@ -56,0 +56,0 @@ * @since 1.0.0

{
"name": "@effect/io",
"version": "0.27.2",
"version": "0.28.0",
"license": "MIT",

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

@@ -22,3 +22,4 @@ import { dual } from "@effect/data/Function"

List.empty(),
HashMap.empty()
HashMap.empty(),
new Date()
))

@@ -10,5 +10,2 @@ import * as Debug from "@effect/data/Debug"

import type * as FiberRefs from "@effect/io/FiberRefs"
import * as Cause from "@effect/io/internal_effect_untraced/cause"
import * as Pretty from "@effect/io/internal_effect_untraced/cause-pretty"
import * as _fiberId from "@effect/io/internal_effect_untraced/fiberId"
import type * as Logger from "@effect/io/Logger"

@@ -18,2 +15,6 @@ import type * as LogLevel from "@effect/io/Logger/Level"

import * as Cause from "@effect/io/internal_effect_untraced/cause"
import * as Pretty from "@effect/io/internal_effect_untraced/cause-pretty"
import * as _fiberId from "@effect/io/internal_effect_untraced/fiberId"
/** @internal */

@@ -42,3 +43,4 @@ const LoggerSymbolKey = "@effect/io/Logger"

spans: List.List<LogSpan.LogSpan>,
annotations: HashMap.HashMap<string, string>
annotations: HashMap.HashMap<string, string>,
date: Date
) => Output

@@ -51,5 +53,134 @@ ): Logger.Logger<Message, Output> => ({

/** @internal */
export const contramap = Debug.untracedDual<
<Message, Message2>(
f: (message: Message2) => Message
) => <Output>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message2, Output>,
<Output, Message, Message2>(
self: Logger.Logger<Message, Output>,
f: (message: Message2) => Message
) => Logger.Logger<Message2, Output>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations, date) =>
self.log(fiberId, logLevel, restore(f)(message), cause, context, spans, annotations, date)
))
/** @internal */
export const filterLogLevel = Debug.untracedDual<
(
f: (logLevel: LogLevel.LogLevel) => boolean
) => <Message, Output>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message, Option.Option<Output>>,
<Message, Output>(
self: Logger.Logger<Message, Output>,
f: (logLevel: LogLevel.LogLevel) => boolean
) => Logger.Logger<Message, Option.Option<Output>>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations, date) =>
restore(f)(logLevel)
? Option.some(
self.log(
fiberId,
logLevel,
message,
cause,
context,
spans,
annotations,
date
)
)
: Option.none()
))
/** @internal */
export const map = Debug.untracedDual<
<Output, Output2>(
f: (output: Output) => Output2
) => <Message>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message, Output2>,
<Message, Output, Output2>(
self: Logger.Logger<Message, Output>,
f: (output: Output) => Output2
) => Logger.Logger<Message, Output2>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations, date) =>
restore(f)(self.log(fiberId, logLevel, message, cause, context, spans, annotations, date))
))
/** @internal */
export const none = (): Logger.Logger<unknown, void> => ({
[LoggerTypeId]: loggerVariance,
log: constVoid
})
/** @internal */
export const simple = <A, B>(log: (a: A) => B): Logger.Logger<A, B> => ({
[LoggerTypeId]: loggerVariance,
log: (_fiberId, _logLevel, message, _cause, _context, _spans, _annotations) => {
return log(message)
}
})
/** @internal */
export const succeed = <A>(value: A): Logger.Logger<unknown, A> => {
return simple(() => value)
}
/** @internal */
export const sync = <A>(evaluate: LazyArg<A>): Logger.Logger<unknown, A> => {
return simple(evaluate)
}
/** @internal */
export const zip = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, readonly [Output, Output2]>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, readonly [Output, Output2]>
>(2, (self, that) =>
makeLogger((fiberId, logLevel, message, cause, context, spans, annotations, date) =>
[
self.log(fiberId, logLevel, message, cause, context, spans, annotations, date),
that.log(fiberId, logLevel, message, cause, context, spans, annotations, date)
] as const
))
/** @internal */
export const zipLeft = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, Output>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, Output>
>(2, (self, that) => map(zip(self, that), (tuple) => tuple[0]))
/** @internal */
export const zipRight = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, Output2>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, Output2>
>(2, (self, that) => map(zip(self, that), (tuple) => tuple[1]))
/** @internal */
export const stringLogger: Logger.Logger<string, string> = makeLogger<string, string>(
(fiberId, logLevel, message, cause, _context, spans, annotations) => {
const now = new Date()
(fiberId, logLevel, message, cause, _context, spans, annotations, now) => {
const nowMillis = now.getTime()

@@ -120,4 +251,3 @@

export const logfmtLogger = makeLogger<string, string>(
(fiberId, logLevel, message, cause, _context, spans, annotations) => {
const now = new Date()
(fiberId, logLevel, message, cause, _context, spans, annotations, now) => {
const nowMillis = now.getTime()

@@ -193,130 +323,1 @@

}
/** @internal */
export const contramap = Debug.untracedDual<
<Message, Message2>(
f: (message: Message2) => Message
) => <Output>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message2, Output>,
<Output, Message, Message2>(
self: Logger.Logger<Message, Output>,
f: (message: Message2) => Message
) => Logger.Logger<Message2, Output>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations) =>
self.log(fiberId, logLevel, restore(f)(message), cause, context, spans, annotations)
))
/** @internal */
export const filterLogLevel = Debug.untracedDual<
(
f: (logLevel: LogLevel.LogLevel) => boolean
) => <Message, Output>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message, Option.Option<Output>>,
<Message, Output>(
self: Logger.Logger<Message, Output>,
f: (logLevel: LogLevel.LogLevel) => boolean
) => Logger.Logger<Message, Option.Option<Output>>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations) =>
restore(f)(logLevel)
? Option.some(
self.log(
fiberId,
logLevel,
message,
cause,
context,
spans,
annotations
)
)
: Option.none()
))
/** @internal */
export const map = Debug.untracedDual<
<Output, Output2>(
f: (output: Output) => Output2
) => <Message>(self: Logger.Logger<Message, Output>) => Logger.Logger<Message, Output2>,
<Message, Output, Output2>(
self: Logger.Logger<Message, Output>,
f: (output: Output) => Output2
) => Logger.Logger<Message, Output2>
>(2, (restore) =>
(self, f) =>
makeLogger(
(fiberId, logLevel, message, cause, context, spans, annotations) =>
restore(f)(self.log(fiberId, logLevel, message, cause, context, spans, annotations))
))
/** @internal */
export const none = (): Logger.Logger<unknown, void> => ({
[LoggerTypeId]: loggerVariance,
log: constVoid
})
/** @internal */
export const simple = <A, B>(log: (a: A) => B): Logger.Logger<A, B> => ({
[LoggerTypeId]: loggerVariance,
log: (_fiberId, _logLevel, message, _cause, _context, _spans, _annotations) => {
return log(message)
}
})
/** @internal */
export const succeed = <A>(value: A): Logger.Logger<unknown, A> => {
return simple(() => value)
}
/** @internal */
export const sync = <A>(evaluate: LazyArg<A>): Logger.Logger<unknown, A> => {
return simple(evaluate)
}
/** @internal */
export const zip = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, readonly [Output, Output2]>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, readonly [Output, Output2]>
>(2, (self, that) =>
makeLogger((fiberId, logLevel, message, cause, context, spans, annotations) =>
[
self.log(fiberId, logLevel, message, cause, context, spans, annotations),
that.log(fiberId, logLevel, message, cause, context, spans, annotations)
] as const
))
/** @internal */
export const zipLeft = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, Output>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, Output>
>(2, (self, that) => map(zip(self, that), (tuple) => tuple[0]))
/** @internal */
export const zipRight = dual<
<Message2, Output2>(
that: Logger.Logger<Message2, Output2>
) => <Message, Output>(
self: Logger.Logger<Message, Output>
) => Logger.Logger<Message & Message2, Output2>,
<Message, Output, Message2, Output2>(
self: Logger.Logger<Message, Output>,
that: Logger.Logger<Message2, Output2>
) => Logger.Logger<Message & Message2, Output2>
>(2, (self, that) => map(zip(self, that), (tuple) => tuple[1]))

@@ -45,3 +45,4 @@ /**

spans: List.List<LogSpan.LogSpan>,
annotations: HashMap.HashMap<string, string>
annotations: HashMap.HashMap<string, string>,
now: Date
) => Output

@@ -78,3 +79,4 @@ }

spans: List.List<LogSpan.LogSpan>,
annotations: HashMap.HashMap<string, string>
annotations: HashMap.HashMap<string, string>,
now: Date
) => Output

@@ -81,0 +83,0 @@ ) => Logger<Message, Output> = internal.makeLogger

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc