Erster Docker-Stand

This commit is contained in:
Ali
2026-02-20 16:06:40 +09:00
commit f31e2e8ed3
8818 changed files with 1605323 additions and 0 deletions

798
_node_modules/effect/dist/esm/Arbitrary.js generated vendored Normal file
View File

@@ -0,0 +1,798 @@
/**
* @since 3.10.0
*/
import * as Arr from "./Array.js";
import * as FastCheck from "./FastCheck.js";
import { globalValue } from "./GlobalValue.js";
import * as errors_ from "./internal/schema/errors.js";
import * as schemaId_ from "./internal/schema/schemaId.js";
import * as util_ from "./internal/schema/util.js";
import * as Option from "./Option.js";
import * as Predicate from "./Predicate.js";
import * as SchemaAST from "./SchemaAST.js";
/**
* Returns a LazyArbitrary for the `A` type of the provided schema.
*
* @category arbitrary
* @since 3.10.0
*/
export const makeLazy = schema => {
const description = getDescription(schema.ast, []);
return go(description, {
maxDepth: 2
});
};
/**
* Returns a fast-check Arbitrary for the `A` type of the provided schema.
*
* @category arbitrary
* @since 3.10.0
*/
export const make = schema => makeLazy(schema)(FastCheck);
/** @internal */
export const makeStringConstraints = options => {
const out = {
_tag: "StringConstraints",
constraints: {}
};
if (Predicate.isNumber(options.minLength)) {
out.constraints.minLength = options.minLength;
}
if (Predicate.isNumber(options.maxLength)) {
out.constraints.maxLength = options.maxLength;
}
if (Predicate.isString(options.pattern)) {
out.pattern = options.pattern;
}
return out;
};
/** @internal */
export const makeNumberConstraints = options => {
const out = {
_tag: "NumberConstraints",
constraints: {},
isInteger: options.isInteger ?? false
};
if (Predicate.isNumber(options.min)) {
out.constraints.min = Math.fround(options.min);
}
if (Predicate.isBoolean(options.minExcluded)) {
out.constraints.minExcluded = options.minExcluded;
}
if (Predicate.isNumber(options.max)) {
out.constraints.max = Math.fround(options.max);
}
if (Predicate.isBoolean(options.maxExcluded)) {
out.constraints.maxExcluded = options.maxExcluded;
}
if (Predicate.isBoolean(options.noNaN)) {
out.constraints.noNaN = options.noNaN;
}
if (Predicate.isBoolean(options.noDefaultInfinity)) {
out.constraints.noDefaultInfinity = options.noDefaultInfinity;
}
return out;
};
/** @internal */
export const makeBigIntConstraints = options => {
const out = {
_tag: "BigIntConstraints",
constraints: {}
};
if (Predicate.isBigInt(options.min)) {
out.constraints.min = options.min;
}
if (Predicate.isBigInt(options.max)) {
out.constraints.max = options.max;
}
return out;
};
/** @internal */
export const makeArrayConstraints = options => {
const out = {
_tag: "ArrayConstraints",
constraints: {}
};
if (Predicate.isNumber(options.minLength)) {
out.constraints.minLength = options.minLength;
}
if (Predicate.isNumber(options.maxLength)) {
out.constraints.maxLength = options.maxLength;
}
return out;
};
/** @internal */
export const makeDateConstraints = options => {
const out = {
_tag: "DateConstraints",
constraints: {}
};
if (Predicate.isDate(options.min)) {
out.constraints.min = options.min;
}
if (Predicate.isDate(options.max)) {
out.constraints.max = options.max;
}
if (Predicate.isBoolean(options.noInvalidDate)) {
out.constraints.noInvalidDate = options.noInvalidDate;
}
return out;
};
const getArbitraryAnnotation = /*#__PURE__*/SchemaAST.getAnnotation(SchemaAST.ArbitraryAnnotationId);
const getASTConstraints = ast => {
const TypeAnnotationId = ast.annotations[SchemaAST.SchemaIdAnnotationId];
if (Predicate.isPropertyKey(TypeAnnotationId)) {
const out = ast.annotations[TypeAnnotationId];
if (Predicate.isReadonlyRecord(out)) {
return out;
}
}
};
const idMemoMap = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Arbitrary/IdMemoMap"), () => new Map());
let counter = 0;
function wrapGetDescription(f, g) {
return (ast, path) => f(ast, g(ast, path));
}
function parseMeta(ast) {
const jsonSchema = SchemaAST.getJSONSchemaAnnotation(ast).pipe(Option.filter(Predicate.isReadonlyRecord), Option.getOrUndefined);
const schemaId = Option.getOrElse(SchemaAST.getSchemaIdAnnotation(ast), () => undefined);
const schemaParams = Option.fromNullable(schemaId).pipe(Option.map(id => ast.annotations[id]), Option.filter(Predicate.isReadonlyRecord), Option.getOrUndefined);
return [schemaId, {
...schemaParams,
...jsonSchema
}];
}
/** @internal */
export const getDescription = /*#__PURE__*/wrapGetDescription((ast, description) => {
const annotation = getArbitraryAnnotation(ast);
if (Option.isSome(annotation)) {
return {
...description,
annotations: [...description.annotations, annotation.value]
};
}
return description;
}, (ast, path) => {
const [schemaId, meta] = parseMeta(ast);
switch (ast._tag) {
case "Refinement":
{
const from = getDescription(ast.from, path);
switch (from._tag) {
case "StringKeyword":
return {
...from,
constraints: [...from.constraints, makeStringConstraints(meta)],
refinements: [...from.refinements, ast]
};
case "NumberKeyword":
{
const c = schemaId === schemaId_.NonNaNSchemaId ? makeNumberConstraints({
noNaN: true
}) : schemaId === schemaId_.FiniteSchemaId || schemaId === schemaId_.JsonNumberSchemaId ? makeNumberConstraints({
noDefaultInfinity: true,
noNaN: true
}) : makeNumberConstraints({
isInteger: "type" in meta && meta.type === "integer",
noNaN: undefined,
noDefaultInfinity: undefined,
min: meta.exclusiveMinimum ?? meta.minimum,
minExcluded: "exclusiveMinimum" in meta ? true : undefined,
max: meta.exclusiveMaximum ?? meta.maximum,
maxExcluded: "exclusiveMaximum" in meta ? true : undefined
});
return {
...from,
constraints: [...from.constraints, c],
refinements: [...from.refinements, ast]
};
}
case "BigIntKeyword":
{
const c = getASTConstraints(ast);
return {
...from,
constraints: c !== undefined ? [...from.constraints, makeBigIntConstraints(c)] : from.constraints,
refinements: [...from.refinements, ast]
};
}
case "TupleType":
return {
...from,
constraints: [...from.constraints, makeArrayConstraints({
minLength: meta.minItems,
maxLength: meta.maxItems
})],
refinements: [...from.refinements, ast]
};
case "DateFromSelf":
return {
...from,
constraints: [...from.constraints, makeDateConstraints(meta)],
refinements: [...from.refinements, ast]
};
default:
return {
...from,
refinements: [...from.refinements, ast]
};
}
}
case "Declaration":
{
if (schemaId === schemaId_.DateFromSelfSchemaId) {
return {
_tag: "DateFromSelf",
constraints: [makeDateConstraints(meta)],
path,
refinements: [],
annotations: []
};
}
return {
_tag: "Declaration",
typeParameters: ast.typeParameters.map(ast => getDescription(ast, path)),
path,
refinements: [],
annotations: [],
ast
};
}
case "Literal":
{
return {
_tag: "Literal",
literal: ast.literal,
path,
refinements: [],
annotations: []
};
}
case "UniqueSymbol":
{
return {
_tag: "UniqueSymbol",
symbol: ast.symbol,
path,
refinements: [],
annotations: []
};
}
case "Enums":
{
return {
_tag: "Enums",
enums: ast.enums,
path,
refinements: [],
annotations: [],
ast
};
}
case "TemplateLiteral":
{
return {
_tag: "TemplateLiteral",
head: ast.head,
spans: ast.spans.map(span => ({
description: getDescription(span.type, path),
literal: span.literal
})),
path,
refinements: [],
annotations: []
};
}
case "StringKeyword":
return {
_tag: "StringKeyword",
constraints: [],
path,
refinements: [],
annotations: []
};
case "NumberKeyword":
return {
_tag: "NumberKeyword",
constraints: [],
path,
refinements: [],
annotations: []
};
case "BigIntKeyword":
return {
_tag: "BigIntKeyword",
constraints: [],
path,
refinements: [],
annotations: []
};
case "TupleType":
return {
_tag: "TupleType",
constraints: [],
elements: ast.elements.map((element, i) => ({
isOptional: element.isOptional,
description: getDescription(element.type, [...path, i])
})),
rest: ast.rest.map((element, i) => getDescription(element.type, [...path, i])),
path,
refinements: [],
annotations: []
};
case "TypeLiteral":
return {
_tag: "TypeLiteral",
propertySignatures: ast.propertySignatures.map(ps => ({
isOptional: ps.isOptional,
name: ps.name,
value: getDescription(ps.type, [...path, ps.name])
})),
indexSignatures: ast.indexSignatures.map(is => ({
parameter: getDescription(is.parameter, path),
value: getDescription(is.type, path)
})),
path,
refinements: [],
annotations: []
};
case "Union":
return {
_tag: "Union",
members: ast.types.map((member, i) => getDescription(member, [...path, i])),
path,
refinements: [],
annotations: []
};
case "Suspend":
{
const memoId = idMemoMap.get(ast);
if (memoId !== undefined) {
return {
_tag: "Ref",
id: memoId,
ast,
path,
refinements: [],
annotations: []
};
}
counter++;
const id = `__id-${counter}__`;
idMemoMap.set(ast, id);
return {
_tag: "Suspend",
id,
ast,
description: () => getDescription(ast.f(), path),
path,
refinements: [],
annotations: []
};
}
case "Transformation":
return getDescription(ast.to, path);
case "NeverKeyword":
return {
_tag: "NeverKeyword",
path,
refinements: [],
annotations: [],
ast
};
default:
{
return {
_tag: "Keyword",
value: ast._tag,
path,
refinements: [],
annotations: []
};
}
}
});
function getMax(n1, n2) {
return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n2 : n1;
}
function getMin(n1, n2) {
return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n1 : n2;
}
const getOr = (a, b) => {
return a === undefined ? b : b === undefined ? a : a || b;
};
function mergePattern(pattern1, pattern2) {
if (pattern1 === undefined) {
return pattern2;
}
if (pattern2 === undefined) {
return pattern1;
}
return `(?:${pattern1})|(?:${pattern2})`;
}
function mergeStringConstraints(c1, c2) {
return makeStringConstraints({
minLength: getMax(c1.constraints.minLength, c2.constraints.minLength),
maxLength: getMin(c1.constraints.maxLength, c2.constraints.maxLength),
pattern: mergePattern(c1.pattern, c2.pattern)
});
}
function buildStringConstraints(description) {
return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeStringConstraints);
}
function mergeNumberConstraints(c1, c2) {
return makeNumberConstraints({
isInteger: c1.isInteger || c2.isInteger,
min: getMax(c1.constraints.min, c2.constraints.min),
minExcluded: getOr(c1.constraints.minExcluded, c2.constraints.minExcluded),
max: getMin(c1.constraints.max, c2.constraints.max),
maxExcluded: getOr(c1.constraints.maxExcluded, c2.constraints.maxExcluded),
noNaN: getOr(c1.constraints.noNaN, c2.constraints.noNaN),
noDefaultInfinity: getOr(c1.constraints.noDefaultInfinity, c2.constraints.noDefaultInfinity)
});
}
function buildNumberConstraints(description) {
return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeNumberConstraints);
}
function mergeBigIntConstraints(c1, c2) {
return makeBigIntConstraints({
min: getMax(c1.constraints.min, c2.constraints.min),
max: getMin(c1.constraints.max, c2.constraints.max)
});
}
function buildBigIntConstraints(description) {
return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeBigIntConstraints);
}
function mergeDateConstraints(c1, c2) {
return makeDateConstraints({
min: getMax(c1.constraints.min, c2.constraints.min),
max: getMin(c1.constraints.max, c2.constraints.max),
noInvalidDate: getOr(c1.constraints.noInvalidDate, c2.constraints.noInvalidDate)
});
}
function buildDateConstraints(description) {
return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeDateConstraints);
}
const constArrayConstraints = /*#__PURE__*/makeArrayConstraints({});
function mergeArrayConstraints(c1, c2) {
return makeArrayConstraints({
minLength: getMax(c1.constraints.minLength, c2.constraints.minLength),
maxLength: getMin(c1.constraints.maxLength, c2.constraints.maxLength)
});
}
function buildArrayConstraints(description) {
return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeArrayConstraints);
}
const arbitraryMemoMap = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Arbitrary/arbitraryMemoMap"), () => new WeakMap());
function applyFilters(filters, arb) {
return fc => filters.reduce((arb, filter) => arb.filter(filter), arb(fc));
}
function absurd(message) {
return () => {
throw new Error(message);
};
}
function getContextConstraints(description) {
switch (description._tag) {
case "StringKeyword":
return buildStringConstraints(description);
case "NumberKeyword":
return buildNumberConstraints(description);
case "BigIntKeyword":
return buildBigIntConstraints(description);
case "DateFromSelf":
return buildDateConstraints(description);
case "TupleType":
return buildArrayConstraints(description);
}
}
function wrapGo(f, g) {
return (description, ctx) => f(description, ctx, g(description, ctx));
}
const go = /*#__PURE__*/wrapGo((description, ctx, lazyArb) => {
const annotation = description.annotations[description.annotations.length - 1];
// error handling
if (annotation === undefined) {
switch (description._tag) {
case "Declaration":
case "NeverKeyword":
throw new Error(errors_.getArbitraryMissingAnnotationErrorMessage(description.path, description.ast));
case "Enums":
if (description.enums.length === 0) {
throw new Error(errors_.getArbitraryEmptyEnumErrorMessage(description.path));
}
}
}
const filters = description.refinements.map(ast => a => Option.isNone(ast.filter(a, SchemaAST.defaultParseOption, ast)));
if (annotation === undefined) {
return applyFilters(filters, lazyArb);
}
const constraints = getContextConstraints(description);
if (constraints !== undefined) {
ctx = {
...ctx,
constraints
};
}
if (description._tag === "Declaration") {
return applyFilters(filters, annotation(...description.typeParameters.map(p => go(p, ctx)), ctx));
}
if (description.refinements.length > 0) {
// TODO(4.0): remove the `lazyArb` parameter
return applyFilters(filters, annotation(lazyArb, ctx));
}
return annotation(ctx);
}, (description, ctx) => {
switch (description._tag) {
case "DateFromSelf":
{
const constraints = buildDateConstraints(description);
return fc => fc.date(constraints?.constraints);
}
case "Declaration":
case "NeverKeyword":
return absurd(`BUG: cannot generate an arbitrary for ${description._tag}`);
case "Literal":
return fc => fc.constant(description.literal);
case "UniqueSymbol":
return fc => fc.constant(description.symbol);
case "Keyword":
{
switch (description.value) {
case "UndefinedKeyword":
return fc => fc.constant(undefined);
case "VoidKeyword":
case "UnknownKeyword":
case "AnyKeyword":
return fc => fc.anything();
case "BooleanKeyword":
return fc => fc.boolean();
case "SymbolKeyword":
return fc => fc.string().map(s => Symbol.for(s));
case "ObjectKeyword":
return fc => fc.oneof(fc.object(), fc.array(fc.anything()));
}
}
case "Enums":
return fc => fc.oneof(...description.enums.map(([_, value]) => fc.constant(value)));
case "TemplateLiteral":
{
return fc => {
const string = fc.string({
maxLength: 5
});
const number = fc.float({
noDefaultInfinity: true,
noNaN: true
});
const getTemplateLiteralArb = description => {
const components = description.head !== "" ? [fc.constant(description.head)] : [];
const getTemplateLiteralSpanTypeArb = description => {
switch (description._tag) {
case "StringKeyword":
return string;
case "NumberKeyword":
return number;
case "Literal":
return fc.constant(String(description.literal));
case "Union":
return fc.oneof(...description.members.map(getTemplateLiteralSpanTypeArb));
case "TemplateLiteral":
return getTemplateLiteralArb(description);
default:
return fc.constant("");
}
};
description.spans.forEach(span => {
components.push(getTemplateLiteralSpanTypeArb(span.description));
if (span.literal !== "") {
components.push(fc.constant(span.literal));
}
});
return fc.tuple(...components).map(spans => spans.join(""));
};
return getTemplateLiteralArb(description);
};
}
case "StringKeyword":
{
const constraints = buildStringConstraints(description);
const pattern = constraints?.pattern;
return pattern !== undefined ? fc => fc.stringMatching(new RegExp(pattern)) : fc => fc.string(constraints?.constraints);
}
case "NumberKeyword":
{
const constraints = buildNumberConstraints(description);
return constraints?.isInteger ? fc => fc.integer(constraints.constraints) : fc => fc.float(constraints?.constraints);
}
case "BigIntKeyword":
{
const constraints = buildBigIntConstraints(description);
return fc => fc.bigInt(constraints?.constraints ?? {});
}
case "TupleType":
{
const elements = [];
let hasOptionals = false;
for (const element of description.elements) {
elements.push(go(element.description, ctx));
if (element.isOptional) {
hasOptionals = true;
}
}
const rest = description.rest.map(d => go(d, ctx));
return fc => {
// ---------------------------------------------
// handle elements
// ---------------------------------------------
let output = fc.tuple(...elements.map(arb => arb(fc)));
if (hasOptionals) {
const indexes = fc.tuple(...description.elements.map(element => element.isOptional ? fc.boolean() : fc.constant(true)));
output = output.chain(tuple => indexes.map(booleans => {
for (const [i, b] of booleans.reverse().entries()) {
if (!b) {
tuple.splice(booleans.length - i, 1);
}
}
return tuple;
}));
}
// ---------------------------------------------
// handle rest element
// ---------------------------------------------
if (Arr.isNonEmptyReadonlyArray(rest)) {
const constraints = buildArrayConstraints(description) ?? constArrayConstraints;
const [head, ...tail] = rest;
const item = head(fc);
output = output.chain(as => {
const len = as.length;
// We must adjust the constraints for the rest element
// because the elements might have generated some values
const restArrayConstraints = subtractElementsLength(constraints.constraints, len);
if (restArrayConstraints.maxLength === 0) {
return fc.constant(as);
}
/*
`getSuspendedArray` is used to generate less values in
the context of a recursive schema. Without it, the following schema
would generate an big amount of values possibly leading to a stack
overflow:
```ts
type A = ReadonlyArray<A | null>
const schema = S.Array(
S.NullOr(S.suspend((): S.Schema<A> => schema))
)
```
*/
const arr = ctx.depthIdentifier !== undefined ? getSuspendedArray(fc, ctx.depthIdentifier, ctx.maxDepth, item, restArrayConstraints) : fc.array(item, restArrayConstraints);
if (len === 0) {
return arr;
}
return arr.map(rest => [...as, ...rest]);
});
// ---------------------------------------------
// handle post rest elements
// ---------------------------------------------
for (let j = 0; j < tail.length; j++) {
output = output.chain(as => tail[j](fc).map(a => [...as, a]));
}
}
return output;
};
}
case "TypeLiteral":
{
const propertySignatures = [];
const requiredKeys = [];
for (const ps of description.propertySignatures) {
if (!ps.isOptional) {
requiredKeys.push(ps.name);
}
propertySignatures.push(go(ps.value, ctx));
}
const indexSignatures = description.indexSignatures.map(is => [go(is.parameter, ctx), go(is.value, ctx)]);
return fc => {
const pps = {};
for (let i = 0; i < propertySignatures.length; i++) {
const ps = description.propertySignatures[i];
pps[ps.name] = propertySignatures[i](fc);
}
let output = fc.record(pps, {
requiredKeys
});
// ---------------------------------------------
// handle index signatures
// ---------------------------------------------
for (let i = 0; i < indexSignatures.length; i++) {
const key = indexSignatures[i][0](fc);
const value = indexSignatures[i][1](fc);
output = output.chain(o => {
const item = fc.tuple(key, value);
/*
`getSuspendedArray` is used to generate less key/value pairs in
the context of a recursive schema. Without it, the following schema
would generate an big amount of values possibly leading to a stack
overflow:
```ts
type A = { [_: string]: A }
const schema = S.Record({ key: S.String, value: S.suspend((): S.Schema<A> => schema) })
```
*/
const arr = ctx.depthIdentifier !== undefined ? getSuspendedArray(fc, ctx.depthIdentifier, ctx.maxDepth, item, {
maxLength: 2
}) : fc.array(item);
return arr.map(tuples => ({
...Object.fromEntries(tuples),
...o
}));
});
}
return output;
};
}
case "Union":
{
const members = description.members.map(member => go(member, ctx));
return fc => fc.oneof(...members.map(arb => arb(fc)));
}
case "Suspend":
{
const memo = arbitraryMemoMap.get(description.ast);
if (memo) {
return memo;
}
if (ctx.depthIdentifier === undefined) {
ctx = {
...ctx,
depthIdentifier: description.id
};
}
const get = util_.memoizeThunk(() => {
return go(description.description(), ctx);
});
const out = fc => fc.constant(null).chain(() => get()(fc));
arbitraryMemoMap.set(description.ast, out);
return out;
}
case "Ref":
{
const memo = arbitraryMemoMap.get(description.ast);
if (memo) {
return memo;
}
throw new Error(`BUG: Ref ${JSON.stringify(description.id)} not found`);
}
}
});
function subtractElementsLength(constraints, len) {
if (len === 0 || constraints.minLength === undefined && constraints.maxLength === undefined) {
return constraints;
}
const out = {
...constraints
};
if (out.minLength !== undefined) {
out.minLength = Math.max(out.minLength - len, 0);
}
if (out.maxLength !== undefined) {
out.maxLength = Math.max(out.maxLength - len, 0);
}
return out;
}
const getSuspendedArray = (fc, depthIdentifier, maxDepth, item, constraints) => {
// In the context of a recursive schema, we don't want a `maxLength` greater than 2.
// The only exception is when `minLength` is also set, in which case we set
// `maxLength` to the minimum value, which is `minLength`.
const maxLengthLimit = Math.max(2, constraints.minLength ?? 0);
if (constraints.maxLength !== undefined && constraints.maxLength > maxLengthLimit) {
constraints = {
...constraints,
maxLength: maxLengthLimit
};
}
return fc.oneof({
maxDepth,
depthIdentifier
}, fc.constant([]), fc.array(item, constraints));
};
//# sourceMappingURL=Arbitrary.js.map

1
_node_modules/effect/dist/esm/Arbitrary.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2697
_node_modules/effect/dist/esm/Array.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/Array.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1087
_node_modules/effect/dist/esm/BigDecimal.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/BigDecimal.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

548
_node_modules/effect/dist/esm/BigInt.js generated vendored Normal file
View File

@@ -0,0 +1,548 @@
/**
* This module provides utility functions and type class instances for working with the `bigint` type in TypeScript.
* It includes functions for basic arithmetic operations, as well as type class instances for
* `Equivalence` and `Order`.
*
* @module BigInt
* @since 2.0.0
* @see {@link module:BigDecimal} for more similar operations on `BigDecimal` types
* @see {@link module:Number} for more similar operations on `number` types
*/
import * as equivalence from "./Equivalence.js";
import { dual } from "./Function.js";
import * as Option from "./Option.js";
import * as order from "./Order.js";
import * as predicate from "./Predicate.js";
const bigint0 = /*#__PURE__*/BigInt(0);
const bigint1 = /*#__PURE__*/BigInt(1);
const bigint2 = /*#__PURE__*/BigInt(2);
/**
* Tests if a value is a `bigint`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { isBigInt } from "effect/BigInt"
*
* assert.deepStrictEqual(isBigInt(1n), true)
* assert.deepStrictEqual(isBigInt(1), false)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isBigInt = predicate.isBigInt;
/**
* Provides an addition operation on `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { sum } from "effect/BigInt"
*
* assert.deepStrictEqual(sum(2n, 3n), 5n)
* ```
*
* @category math
* @since 2.0.0
*/
export const sum = /*#__PURE__*/dual(2, (self, that) => self + that);
/**
* Provides a multiplication operation on `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { multiply } from "effect/BigInt"
*
* assert.deepStrictEqual(multiply(2n, 3n), 6n)
* ```
*
* @category math
* @since 2.0.0
*/
export const multiply = /*#__PURE__*/dual(2, (self, that) => self * that);
/**
* Provides a subtraction operation on `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { subtract } from "effect/BigInt"
*
* assert.deepStrictEqual(subtract(2n, 3n), -1n)
* ```
*
* @category math
* @since 2.0.0
*/
export const subtract = /*#__PURE__*/dual(2, (self, that) => self - that);
/**
* Provides a division operation on `bigint`s.
*
* If the dividend is not a multiple of the divisor the result will be a `bigint` value
* which represents the integer division rounded down to the nearest integer.
*
* Returns `None` if the divisor is `0n`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt, Option } from "effect"
*
* assert.deepStrictEqual(BigInt.divide(6n, 3n), Option.some(2n))
* assert.deepStrictEqual(BigInt.divide(6n, 0n), Option.none())
* ```
*
* @category math
* @since 2.0.0
*/
export const divide = /*#__PURE__*/dual(2, (self, that) => that === bigint0 ? Option.none() : Option.some(self / that));
/**
* Provides a division operation on `bigint`s.
*
* If the dividend is not a multiple of the divisor the result will be a `bigint` value
* which represents the integer division rounded down to the nearest integer.
*
* Throws a `RangeError` if the divisor is `0n`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { unsafeDivide } from "effect/BigInt"
*
* assert.deepStrictEqual(unsafeDivide(6n, 3n), 2n)
* assert.deepStrictEqual(unsafeDivide(6n, 4n), 1n)
* ```
*
* @category math
* @since 2.0.0
*/
export const unsafeDivide = /*#__PURE__*/dual(2, (self, that) => self / that);
/**
* Returns the result of adding `1n` to a given number.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { increment } from "effect/BigInt"
*
* assert.deepStrictEqual(increment(2n), 3n)
* ```
*
* @category math
* @since 2.0.0
*/
export const increment = n => n + bigint1;
/**
* Decrements a number by `1n`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { decrement } from "effect/BigInt"
*
* assert.deepStrictEqual(decrement(3n), 2n)
* ```
*
* @category math
* @since 2.0.0
*/
export const decrement = n => n - bigint1;
/**
* @category instances
* @since 2.0.0
*/
export const Equivalence = equivalence.bigint;
/**
* @category instances
* @since 2.0.0
*/
export const Order = order.bigint;
/**
* Returns `true` if the first argument is less than the second, otherwise `false`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { lessThan } from "effect/BigInt"
*
* assert.deepStrictEqual(lessThan(2n, 3n), true)
* assert.deepStrictEqual(lessThan(3n, 3n), false)
* assert.deepStrictEqual(lessThan(4n, 3n), false)
* ```
*
* @category predicates
* @since 2.0.0
*/
export const lessThan = /*#__PURE__*/order.lessThan(Order);
/**
* Returns a function that checks if a given `bigint` is less than or equal to the provided one.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { lessThanOrEqualTo } from "effect/BigInt"
*
* assert.deepStrictEqual(lessThanOrEqualTo(2n, 3n), true)
* assert.deepStrictEqual(lessThanOrEqualTo(3n, 3n), true)
* assert.deepStrictEqual(lessThanOrEqualTo(4n, 3n), false)
* ```
*
* @category predicates
* @since 2.0.0
*/
export const lessThanOrEqualTo = /*#__PURE__*/order.lessThanOrEqualTo(Order);
/**
* Returns `true` if the first argument is greater than the second, otherwise `false`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { greaterThan } from "effect/BigInt"
*
* assert.deepStrictEqual(greaterThan(2n, 3n), false)
* assert.deepStrictEqual(greaterThan(3n, 3n), false)
* assert.deepStrictEqual(greaterThan(4n, 3n), true)
* ```
*
* @category predicates
* @since 2.0.0
*/
export const greaterThan = /*#__PURE__*/order.greaterThan(Order);
/**
* Returns a function that checks if a given `bigint` is greater than or equal to the provided one.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { greaterThanOrEqualTo } from "effect/BigInt"
*
* assert.deepStrictEqual(greaterThanOrEqualTo(2n, 3n), false)
* assert.deepStrictEqual(greaterThanOrEqualTo(3n, 3n), true)
* assert.deepStrictEqual(greaterThanOrEqualTo(4n, 3n), true)
* ```
*
* @category predicates
* @since 2.0.0
*/
export const greaterThanOrEqualTo = /*#__PURE__*/order.greaterThanOrEqualTo(Order);
/**
* Checks if a `bigint` is between a `minimum` and `maximum` value (inclusive).
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt } from "effect"
*
* const between = BigInt.between({ minimum: 0n, maximum: 5n })
*
* assert.deepStrictEqual(between(3n), true)
* assert.deepStrictEqual(between(-1n), false)
* assert.deepStrictEqual(between(6n), false)
* ```
*
* @category predicates
* @since 2.0.0
*/
export const between = /*#__PURE__*/order.between(Order);
/**
* Restricts the given `bigint` to be within the range specified by the `minimum` and `maximum` values.
*
* - If the `bigint` is less than the `minimum` value, the function returns the `minimum` value.
* - If the `bigint` is greater than the `maximum` value, the function returns the `maximum` value.
* - Otherwise, it returns the original `bigint`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt } from "effect"
*
* const clamp = BigInt.clamp({ minimum: 1n, maximum: 5n })
*
* assert.equal(clamp(3n), 3n)
* assert.equal(clamp(0n), 1n)
* assert.equal(clamp(6n), 5n)
* ```
*
* @since 2.0.0
*/
export const clamp = /*#__PURE__*/order.clamp(Order);
/**
* Returns the minimum between two `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { min } from "effect/BigInt"
*
* assert.deepStrictEqual(min(2n, 3n), 2n)
* ```
*
* @since 2.0.0
*/
export const min = /*#__PURE__*/order.min(Order);
/**
* Returns the maximum between two `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { max } from "effect/BigInt"
*
* assert.deepStrictEqual(max(2n, 3n), 3n)
* ```
*
* @since 2.0.0
*/
export const max = /*#__PURE__*/order.max(Order);
/**
* Determines the sign of a given `bigint`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { sign } from "effect/BigInt"
*
* assert.deepStrictEqual(sign(-5n), -1)
* assert.deepStrictEqual(sign(0n), 0)
* assert.deepStrictEqual(sign(5n), 1)
* ```
*
* @category math
* @since 2.0.0
*/
export const sign = n => Order(n, bigint0);
/**
* Determines the absolute value of a given `bigint`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { abs } from "effect/BigInt"
*
* assert.deepStrictEqual(abs(-5n), 5n)
* assert.deepStrictEqual(abs(0n), 0n)
* assert.deepStrictEqual(abs(5n), 5n)
* ```
*
* @category math
* @since 2.0.0
*/
export const abs = n => n < bigint0 ? -n : n;
/**
* Determines the greatest common divisor of two `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { gcd } from "effect/BigInt"
*
* assert.deepStrictEqual(gcd(2n, 3n), 1n)
* assert.deepStrictEqual(gcd(2n, 4n), 2n)
* assert.deepStrictEqual(gcd(16n, 24n), 8n)
* ```
*
* @category math
* @since 2.0.0
*/
export const gcd = /*#__PURE__*/dual(2, (self, that) => {
while (that !== bigint0) {
const t = that;
that = self % that;
self = t;
}
return self;
});
/**
* Determines the least common multiple of two `bigint`s.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { lcm } from "effect/BigInt"
*
* assert.deepStrictEqual(lcm(2n, 3n), 6n)
* assert.deepStrictEqual(lcm(2n, 4n), 4n)
* assert.deepStrictEqual(lcm(16n, 24n), 48n)
* ```
*
* @category math
* @since 2.0.0
*/
export const lcm = /*#__PURE__*/dual(2, (self, that) => self * that / gcd(self, that));
/**
* Determines the square root of a given `bigint` unsafely. Throws if the given `bigint` is negative.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { unsafeSqrt } from "effect/BigInt"
*
* assert.deepStrictEqual(unsafeSqrt(4n), 2n)
* assert.deepStrictEqual(unsafeSqrt(9n), 3n)
* assert.deepStrictEqual(unsafeSqrt(16n), 4n)
* ```
*
* @category math
* @since 2.0.0
*/
export const unsafeSqrt = n => {
if (n < bigint0) {
throw new RangeError("Cannot take the square root of a negative number");
}
if (n < bigint2) {
return n;
}
let x = n / bigint2;
while (x * x > n) {
x = (n / x + x) / bigint2;
}
return x;
};
/**
* Determines the square root of a given `bigint` safely. Returns `none` if the given `bigint` is negative.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt, Option } from "effect"
*
* assert.deepStrictEqual(BigInt.sqrt(4n), Option.some(2n))
* assert.deepStrictEqual(BigInt.sqrt(9n), Option.some(3n))
* assert.deepStrictEqual(BigInt.sqrt(16n), Option.some(4n))
* assert.deepStrictEqual(BigInt.sqrt(-1n), Option.none())
* ```
*
* @category math
* @since 2.0.0
*/
export const sqrt = n => greaterThanOrEqualTo(n, bigint0) ? Option.some(unsafeSqrt(n)) : Option.none();
/**
* Takes an `Iterable` of `bigint`s and returns their sum as a single `bigint
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { sumAll } from "effect/BigInt"
*
* assert.deepStrictEqual(sumAll([2n, 3n, 4n]), 9n)
* ```
*
* @category math
* @since 2.0.0
*/
export const sumAll = collection => {
let out = bigint0;
for (const n of collection) {
out += n;
}
return out;
};
/**
* Takes an `Iterable` of `bigint`s and returns their multiplication as a single `number`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { multiplyAll } from "effect/BigInt"
*
* assert.deepStrictEqual(multiplyAll([2n, 3n, 4n]), 24n)
* ```
*
* @category math
* @since 2.0.0
*/
export const multiplyAll = collection => {
let out = bigint1;
for (const n of collection) {
if (n === bigint0) {
return bigint0;
}
out *= n;
}
return out;
};
/**
* Takes a `bigint` and returns an `Option` of `number`.
*
* If the `bigint` is outside the safe integer range for JavaScript (`Number.MAX_SAFE_INTEGER`
* and `Number.MIN_SAFE_INTEGER`), it returns `Option.none()`. Otherwise, it converts the `bigint`
* to a number and returns `Option.some(number)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt as BI, Option } from "effect"
*
* assert.deepStrictEqual(BI.toNumber(BigInt(42)), Option.some(42))
* assert.deepStrictEqual(BI.toNumber(BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1)), Option.none())
* assert.deepStrictEqual(BI.toNumber(BigInt(Number.MIN_SAFE_INTEGER) - BigInt(1)), Option.none())
* ```
*
* @category conversions
* @since 2.0.0
*/
export const toNumber = b => {
if (b > BigInt(Number.MAX_SAFE_INTEGER) || b < BigInt(Number.MIN_SAFE_INTEGER)) {
return Option.none();
}
return Option.some(Number(b));
};
/**
* Takes a string and returns an `Option` of `bigint`.
*
* If the string is empty or contains characters that cannot be converted into a `bigint`,
* it returns `Option.none()`, otherwise, it returns `Option.some(bigint)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt as BI, Option } from "effect"
*
* assert.deepStrictEqual(BI.fromString("42"), Option.some(BigInt(42)))
* assert.deepStrictEqual(BI.fromString(" "), Option.none())
* assert.deepStrictEqual(BI.fromString("a"), Option.none())
* ```
*
* @category conversions
* @since 2.4.12
*/
export const fromString = s => {
try {
return s.trim() === "" ? Option.none() : Option.some(BigInt(s));
} catch {
return Option.none();
}
};
/**
* Takes a number and returns an `Option` of `bigint`.
*
* If the number is outside the safe integer range for JavaScript (`Number.MAX_SAFE_INTEGER`
* and `Number.MIN_SAFE_INTEGER`), it returns `Option.none()`. Otherwise, it attempts to
* convert the number to a `bigint` and returns `Option.some(bigint)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { BigInt as BI, Option } from "effect"
*
* assert.deepStrictEqual(BI.fromNumber(42), Option.some(BigInt(42)))
* assert.deepStrictEqual(BI.fromNumber(Number.MAX_SAFE_INTEGER + 1), Option.none())
* assert.deepStrictEqual(BI.fromNumber(Number.MIN_SAFE_INTEGER - 1), Option.none())
* ```
*
* @category conversions
* @since 2.4.12
*/
export const fromNumber = n => {
if (n > Number.MAX_SAFE_INTEGER || n < Number.MIN_SAFE_INTEGER) {
return Option.none();
}
try {
return Option.some(BigInt(n));
} catch {
return Option.none();
}
};
//# sourceMappingURL=BigInt.js.map

1
_node_modules/effect/dist/esm/BigInt.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

240
_node_modules/effect/dist/esm/Boolean.js generated vendored Normal file
View File

@@ -0,0 +1,240 @@
/**
* This module provides utility functions and type class instances for working with the `boolean` type in TypeScript.
* It includes functions for basic boolean operations, as well as type class instances for
* `Equivalence` and `Order`.
*
* @since 2.0.0
*/
import * as equivalence from "./Equivalence.js";
import { dual } from "./Function.js";
import * as order from "./Order.js";
import * as predicate from "./Predicate.js";
/**
* Tests if a value is a `boolean`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { isBoolean } from "effect/Boolean"
*
* assert.deepStrictEqual(isBoolean(true), true)
* assert.deepStrictEqual(isBoolean("true"), false)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isBoolean = predicate.isBoolean;
/**
* This function returns the result of either of the given functions depending on the value of the boolean parameter.
* It is useful when you have to run one of two functions depending on the boolean value.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Boolean } from "effect"
*
* assert.deepStrictEqual(Boolean.match(true, { onFalse: () => "It's false!", onTrue: () => "It's true!" }), "It's true!")
* ```
*
* @category pattern matching
* @since 2.0.0
*/
export const match = /*#__PURE__*/dual(2, (value, options) => value ? options.onTrue() : options.onFalse());
/**
* @category instances
* @since 2.0.0
*/
export const Equivalence = equivalence.boolean;
/**
* @category instances
* @since 2.0.0
*/
export const Order = order.boolean;
/**
* Negates the given boolean: `!self`
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { not } from "effect/Boolean"
*
* assert.deepStrictEqual(not(true), false)
* assert.deepStrictEqual(not(false), true)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const not = self => !self;
/**
* Combines two boolean using AND: `self && that`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { and } from "effect/Boolean"
*
* assert.deepStrictEqual(and(true, true), true)
* assert.deepStrictEqual(and(true, false), false)
* assert.deepStrictEqual(and(false, true), false)
* assert.deepStrictEqual(and(false, false), false)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const and = /*#__PURE__*/dual(2, (self, that) => self && that);
/**
* Combines two boolean using NAND: `!(self && that)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { nand } from "effect/Boolean"
*
* assert.deepStrictEqual(nand(true, true), false)
* assert.deepStrictEqual(nand(true, false), true)
* assert.deepStrictEqual(nand(false, true), true)
* assert.deepStrictEqual(nand(false, false), true)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const nand = /*#__PURE__*/dual(2, (self, that) => !(self && that));
/**
* Combines two boolean using OR: `self || that`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { or } from "effect/Boolean"
*
* assert.deepStrictEqual(or(true, true), true)
* assert.deepStrictEqual(or(true, false), true)
* assert.deepStrictEqual(or(false, true), true)
* assert.deepStrictEqual(or(false, false), false)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const or = /*#__PURE__*/dual(2, (self, that) => self || that);
/**
* Combines two booleans using NOR: `!(self || that)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { nor } from "effect/Boolean"
*
* assert.deepStrictEqual(nor(true, true), false)
* assert.deepStrictEqual(nor(true, false), false)
* assert.deepStrictEqual(nor(false, true), false)
* assert.deepStrictEqual(nor(false, false), true)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const nor = /*#__PURE__*/dual(2, (self, that) => !(self || that));
/**
* Combines two booleans using XOR: `(!self && that) || (self && !that)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { xor } from "effect/Boolean"
*
* assert.deepStrictEqual(xor(true, true), false)
* assert.deepStrictEqual(xor(true, false), true)
* assert.deepStrictEqual(xor(false, true), true)
* assert.deepStrictEqual(xor(false, false), false)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const xor = /*#__PURE__*/dual(2, (self, that) => !self && that || self && !that);
/**
* Combines two booleans using EQV (aka XNOR): `!xor(self, that)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { eqv } from "effect/Boolean"
*
* assert.deepStrictEqual(eqv(true, true), true)
* assert.deepStrictEqual(eqv(true, false), false)
* assert.deepStrictEqual(eqv(false, true), false)
* assert.deepStrictEqual(eqv(false, false), true)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const eqv = /*#__PURE__*/dual(2, (self, that) => !xor(self, that));
/**
* Combines two booleans using an implication: `(!self || that)`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { implies } from "effect/Boolean"
*
* assert.deepStrictEqual(implies(true, true), true)
* assert.deepStrictEqual(implies(true, false), false)
* assert.deepStrictEqual(implies(false, true), true)
* assert.deepStrictEqual(implies(false, false), true)
* ```
*
* @category combinators
* @since 2.0.0
*/
export const implies = /*#__PURE__*/dual(2, (self, that) => self ? that : true);
/**
* This utility function is used to check if all the elements in a collection of boolean values are `true`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { every } from "effect/Boolean"
*
* assert.deepStrictEqual(every([true, true, true]), true)
* assert.deepStrictEqual(every([true, false, true]), false)
* ```
*
* @since 2.0.0
*/
export const every = collection => {
for (const b of collection) {
if (!b) {
return false;
}
}
return true;
};
/**
* This utility function is used to check if at least one of the elements in a collection of boolean values is `true`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { some } from "effect/Boolean"
*
* assert.deepStrictEqual(some([true, false, true]), true)
* assert.deepStrictEqual(some([false, false, false]), false)
* ```
*
* @since 2.0.0
*/
export const some = collection => {
for (const b of collection) {
if (b) {
return true;
}
}
return false;
};
//# sourceMappingURL=Boolean.js.map

1
_node_modules/effect/dist/esm/Boolean.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Boolean.js","names":["equivalence","dual","order","predicate","isBoolean","match","value","options","onTrue","onFalse","Equivalence","boolean","Order","not","self","and","that","nand","or","nor","xor","eqv","implies","every","collection","b","some"],"sources":["../../src/Boolean.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;AAOA,OAAO,KAAKA,WAAW,MAAM,kBAAkB;AAE/C,SAASC,IAAI,QAAQ,eAAe;AACpC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;;;;;;;;;;;AAeA,OAAO,MAAMC,SAAS,GAAyCD,SAAS,CAACC,SAAS;AAElF;;;;;;;;;;;;;;;AAeA,OAAO,MAAMC,KAAK,gBA4CdJ,IAAI,CAAC,CAAC,EAAE,CAAOK,KAAc,EAAEC,OAGlC,KAAYD,KAAK,GAAGC,OAAO,CAACC,MAAM,EAAE,GAAGD,OAAO,CAACE,OAAO,EAAE,CAAC;AAE1D;;;;AAIA,OAAO,MAAMC,WAAW,GAAqCV,WAAW,CAACW,OAAO;AAEhF;;;;AAIA,OAAO,MAAMC,KAAK,GAAyBV,KAAK,CAACS,OAAO;AAExD;;;;;;;;;;;;;;;AAeA,OAAO,MAAME,GAAG,GAAIC,IAAa,IAAc,CAACA,IAAI;AAEpD;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,GAAG,gBAqCZd,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAcF,IAAI,IAAIE,IAAI,CAAC;AAEpE;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,IAAI,gBAqCbhB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAc,EAAEF,IAAI,IAAIE,IAAI,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAME,EAAE,gBAqCXjB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAcF,IAAI,IAAIE,IAAI,CAAC;AAEpE;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMG,GAAG,gBAqCZlB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAc,EAAEF,IAAI,IAAIE,IAAI,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMI,GAAG,gBAqCZnB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAe,CAACF,IAAI,IAAIE,IAAI,IAAMF,IAAI,IAAI,CAACE,IAAK,CAAC;AAE1F;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMK,GAAG,gBAqCZpB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAa,EAAEE,IAAa,KAAc,CAACI,GAAG,CAACN,IAAI,EAAEE,IAAI,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMM,OAAO,gBAqChBrB,IAAI,CAAC,CAAC,EAAE,CAACa,IAAI,EAAEE,IAAI,KAAKF,IAAI,GAAGE,IAAI,GAAG,IAAI,CAAC;AAE/C;;;;;;;;;;;;;;AAcA,OAAO,MAAMO,KAAK,GAAIC,UAA6B,IAAa;EAC9D,KAAK,MAAMC,CAAC,IAAID,UAAU,EAAE;IAC1B,IAAI,CAACC,CAAC,EAAE;MACN,OAAO,KAAK;IACd;EACF;EACA,OAAO,IAAI;AACb,CAAC;AAED;;;;;;;;;;;;;;AAcA,OAAO,MAAMC,IAAI,GAAIF,UAA6B,IAAa;EAC7D,KAAK,MAAMC,CAAC,IAAID,UAAU,EAAE;IAC1B,IAAIC,CAAC,EAAE;MACL,OAAO,IAAI;IACb;EACF;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}

161
_node_modules/effect/dist/esm/Brand.js generated vendored Normal file
View File

@@ -0,0 +1,161 @@
/**
* This module provides types and utility functions to create and work with branded types,
* which are TypeScript types with an added type tag to prevent accidental usage of a value in the wrong context.
*
* The `refined` and `nominal` functions are both used to create branded types in TypeScript.
* The main difference between them is that `refined` allows for validation of the data, while `nominal` does not.
*
* The `nominal` function is used to create a new branded type that has the same underlying type as the input, but with a different name.
* This is useful when you want to distinguish between two values of the same type that have different meanings.
* The `nominal` function does not perform any validation of the input data.
*
* On the other hand, the `refined` function is used to create a new branded type that has the same underlying type as the input,
* but with a different name, and it also allows for validation of the input data.
* The `refined` function takes a predicate that is used to validate the input data.
* If the input data fails the validation, a `BrandErrors` is returned, which provides information about the specific validation failure.
*
* @since 2.0.0
*/
import * as Arr from "./Array.js";
import * as Either from "./Either.js";
import { identity, unsafeCoerce } from "./Function.js";
import * as Option from "./Option.js";
/**
* @since 2.0.0
* @category symbols
*/
export const BrandTypeId = /*#__PURE__*/Symbol.for("effect/Brand");
/**
* @since 2.0.0
* @category symbols
*/
export const RefinedConstructorsTypeId = /*#__PURE__*/Symbol.for("effect/Brand/Refined");
/**
* Returns a `BrandErrors` that contains a single `RefinementError`.
*
* @since 2.0.0
* @category constructors
*/
export const error = (message, meta) => [{
message,
meta
}];
/**
* Takes a variable number of `BrandErrors` and returns a single `BrandErrors` that contains all refinement errors.
*
* @since 2.0.0
* @category constructors
*/
export const errors = (...errors) => Arr.flatten(errors);
export function refined(...args) {
const either = args.length === 2 ? unbranded => args[0](unbranded) ? Either.right(unbranded) : Either.left(args[1](unbranded)) : unbranded => {
return Option.match(args[0](unbranded), {
onNone: () => Either.right(unbranded),
onSome: Either.left
});
};
return Object.assign(unbranded => Either.getOrThrowWith(either(unbranded), identity), {
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
option: args => Option.getRight(either(args)),
either,
is: args => Either.isRight(either(args))
});
}
/**
* This function returns a `Brand.Constructor` that **does not apply any runtime checks**, it just returns the provided value.
* It can be used to create nominal types that allow distinguishing between two values of the same type but with different meanings.
*
* If you also want to perform some validation, see {@link refined}.
*
* **Example**
*
* ```ts
* import * as assert from "node:assert"
* import { Brand } from "effect"
*
* type UserId = number & Brand.Brand<"UserId">
*
* const UserId = Brand.nominal<UserId>()
*
* console.log(UserId(1))
* // 1
* ```
*
* @since 2.0.0
* @category constructors
*/
export const nominal = () => {
// @ts-expect-error
return Object.assign(args => args, {
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
option: args => Option.some(args),
either: args => Either.right(args),
is: _args => true
});
};
/**
* Combines two or more brands together to form a single branded type.
* This API is useful when you want to validate that the input data passes multiple brand validators.
*
* **Example**
*
* ```ts
* import * as assert from "node:assert"
* import { Brand } from "effect"
*
* type Int = number & Brand.Brand<"Int">
* const Int = Brand.refined<Int>(
* (n) => Number.isInteger(n),
* (n) => Brand.error(`Expected ${n} to be an integer`)
* )
* type Positive = number & Brand.Brand<"Positive">
* const Positive = Brand.refined<Positive>(
* (n) => n > 0,
* (n) => Brand.error(`Expected ${n} to be positive`)
* )
*
* const PositiveInt = Brand.all(Int, Positive)
*
* console.log(PositiveInt(1))
* // 1
*
* assert.throws(() => PositiveInt(1.1))
* ```
*
* @since 2.0.0
* @category combining
*/
export const all = (...brands) => {
const either = args => {
let result = Either.right(args);
for (const brand of brands) {
const nextResult = brand.either(args);
if (Either.isLeft(result) && Either.isLeft(nextResult)) {
result = Either.left([...result.left, ...nextResult.left]);
} else {
result = Either.isLeft(result) ? result : nextResult;
}
}
return result;
};
// @ts-expect-error
return Object.assign(args => Either.match(either(args), {
onLeft: e => {
throw e;
},
onRight: identity
}), {
[RefinedConstructorsTypeId]: RefinedConstructorsTypeId,
option: args => Option.getRight(either(args)),
either,
is: args => Either.isRight(either(args))
});
};
/**
* Retrieves the unbranded value from a `Brand` instance.
*
* @since 3.15.0
* @category getters
*/
export const unbranded = unsafeCoerce;
//# sourceMappingURL=Brand.js.map

1
_node_modules/effect/dist/esm/Brand.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Brand.js","names":["Arr","Either","identity","unsafeCoerce","Option","BrandTypeId","Symbol","for","RefinedConstructorsTypeId","error","message","meta","errors","flatten","refined","args","either","length","unbranded","right","left","match","onNone","onSome","Object","assign","getOrThrowWith","option","getRight","is","isRight","nominal","some","_args","all","brands","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GkB,UAAU,CAAClB,IAAI,CAAC,CAAC;MAC5D,CAAC,MAAM;QACLgB,MAAM,GAAGnC,MAAM,CAACsC,MAAM,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAGE,UAAU;MACtD;IACF;IACA,OAAOF,MAAM;EACf,CAAC;EACD;EACA,OAAOZ,MAAM,CAACC,MAAM,CAAEV,IAAI,IACxBd,MAAM,CAACoB,KAAK,CAACL,MAAM,CAACD,IAAI,CAAC,EAAE;IACzByB,MAAM,EAAGC,CAAC,IAAI;MACZ,MAAMA,CAAC;IACT,CAAC;IACDC,OAAO,EAAExC;GACV,CAAC,EAAE;IACJ,CAACM,yBAAyB,GAAGA,yBAAyB;IACtDmB,MAAM,EAAGZ,IAAS,IAAKX,MAAM,CAACwB,QAAQ,CAACZ,MAAM,CAACD,IAAI,CAAC,CAAC;IACpDC,MAAM;IACNa,EAAE,EAAGd,IAAS,IAAkBd,MAAM,CAAC6B,OAAO,CAACd,MAAM,CAACD,IAAI,CAAC;GAC5D,CAAC;AACJ,CAAC;AAED;;;;;;AAMA,OAAO,MAAMG,SAAS,GAA6Df,YAAY","ignoreList":[]}

43
_node_modules/effect/dist/esm/Cache.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
import * as internal from "./internal/cache.js";
/**
* @since 2.0.0
* @category symbols
*/
export const CacheTypeId = internal.CacheTypeId;
/**
* @since 3.6.4
* @category symbols
*/
export const ConsumerCacheTypeId = internal.ConsumerCacheTypeId;
/**
* Constructs a new cache with the specified capacity, time to live, and
* lookup function.
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* Constructs a new cache with the specified capacity, time to live, and
* lookup function, where the time to live can depend on the `Exit` value
* returned by the lookup function.
*
* @since 2.0.0
* @category constructors
*/
export const makeWith = internal.makeWith;
/**
* Constructs a new `CacheStats` from the specified values.
*
* @since 2.0.0
* @category constructors
*/
export const makeCacheStats = internal.makeCacheStats;
/**
* Constructs a new `EntryStats` from the specified values.
*
* @since 2.0.0
* @category constructors
*/
export const makeEntryStats = internal.makeEntryStats;
//# sourceMappingURL=Cache.js.map

1
_node_modules/effect/dist/esm/Cache.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Cache.js","names":["internal","CacheTypeId","ConsumerCacheTypeId","make","makeWith","makeCacheStats","makeEntryStats"],"sources":["../../src/Cache.ts"],"sourcesContent":[null],"mappings":"AAOA,OAAO,KAAKA,QAAQ,MAAM,qBAAqB;AAK/C;;;;AAIA,OAAO,MAAMC,WAAW,GAAkBD,QAAQ,CAACC,WAAW;AAQ9D;;;;AAIA,OAAO,MAAMC,mBAAmB,GAAkBF,QAAQ,CAACE,mBAAmB;AAsK9E;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAMkDH,QAAQ,CAACG,IAAI;AAEhF;;;;;;;;AAQA,OAAO,MAAMC,QAAQ,GAM8CJ,QAAQ,CAACI,QAAQ;AAepF;;;;;;AAMA,OAAO,MAAMC,cAAc,GAMTL,QAAQ,CAACK,cAAc;AAYzC;;;;;;AAMA,OAAO,MAAMC,cAAc,GAAyCN,QAAQ,CAACM,cAAc","ignoreList":[]}

1004
_node_modules/effect/dist/esm/Cause.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/Cause.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

887
_node_modules/effect/dist/esm/Channel.js generated vendored Normal file
View File

@@ -0,0 +1,887 @@
import * as channel from "./internal/channel.js";
import * as core from "./internal/core-stream.js";
import * as sink from "./internal/sink.js";
import * as stream from "./internal/stream.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ChannelTypeId = core.ChannelTypeId;
/**
* @since 2.0.0
* @category symbols
*/
export const ChannelExceptionTypeId = channel.ChannelExceptionTypeId;
/**
* @since 3.5.4
* @category refinements
*/
export const isChannel = core.isChannel;
/**
* @since 2.0.0
* @category constructors
*/
export const acquireUseRelease = channel.acquireUseRelease;
/**
* @since 2.0.0
* @category constructors
*/
export const acquireReleaseOut = core.acquireReleaseOut;
/**
* Returns a new channel that is the same as this one, except the terminal
* value of the channel is the specified constant value.
*
* This method produces the same result as mapping this channel to the
* specified constant value.
*
* @since 2.0.0
* @category mapping
*/
export const as = channel.as;
/**
* @since 2.0.0
* @category mapping
*/
export const asVoid = channel.asVoid;
/**
* Creates a channel backed by a buffer. When the buffer is empty, the channel
* will simply passthrough its input as output. However, when the buffer is
* non-empty, the value inside the buffer will be passed along as output.
*
* @since 2.0.0
* @category constructors
*/
export const buffer = channel.buffer;
/**
* @since 2.0.0
* @category constructors
*/
export const bufferChunk = channel.bufferChunk;
/**
* Returns a new channel that is the same as this one, except if this channel
* errors for any typed error, then the returned channel will switch over to
* using the fallback channel returned by the specified error handler.
*
* @since 2.0.0
* @category error handling
*/
export const catchAll = channel.catchAll;
/**
* Returns a new channel that is the same as this one, except if this channel
* errors for any typed error, then the returned channel will switch over to
* using the fallback channel returned by the specified error handler.
*
* @since 2.0.0
* @category error handling
*/
export const catchAllCause = core.catchAllCause;
/**
* Concat sequentially a channel of channels.
*
* @since 2.0.0
* @category constructors
*/
export const concatAll = core.concatAll;
/**
* Concat sequentially a channel of channels.
*
* @since 2.0.0
* @category constructors
*/
export const concatAllWith = core.concatAllWith;
/**
* Returns a new channel whose outputs are fed to the specified factory
* function, which creates new channels in response. These new channels are
* sequentially concatenated together, and all their outputs appear as outputs
* of the newly returned channel.
*
* @since 2.0.0
* @category utils
*/
export const concatMap = channel.concatMap;
/**
* Returns a new channel whose outputs are fed to the specified factory
* function, which creates new channels in response. These new channels are
* sequentially concatenated together, and all their outputs appear as outputs
* of the newly returned channel. The provided merging function is used to
* merge the terminal values of all channels into the single terminal value of
* the returned channel.
*
* @since 2.0.0
* @category utils
*/
export const concatMapWith = core.concatMapWith;
/**
* Returns a new channel whose outputs are fed to the specified factory
* function, which creates new channels in response. These new channels are
* sequentially concatenated together, and all their outputs appear as outputs
* of the newly returned channel. The provided merging function is used to
* merge the terminal values of all channels into the single terminal value of
* the returned channel.
*
* @since 2.0.0
* @category utils
*/
export const concatMapWithCustom = core.concatMapWithCustom;
/**
* Returns a new channel, which is the same as this one, except its outputs
* are filtered and transformed by the specified partial function.
*
* @since 2.0.0
* @category utils
*/
export const collect = channel.collect;
/**
* Returns a new channel, which is the concatenation of all the channels that
* are written out by this channel. This method may only be called on channels
* that output other channels.
*
* @since 2.0.0
* @category utils
*/
export const concatOut = channel.concatOut;
/**
* Returns a new channel which is the same as this one but applies the given
* function to the input channel's done value.
*
* @since 2.0.0
* @category utils
*/
export const mapInput = channel.mapInput;
/**
* Returns a new channel which is the same as this one but applies the given
* effectual function to the input channel's done value.
*
* @since 2.0.0
* @category utils
*/
export const mapInputEffect = channel.mapInputEffect;
/**
* Returns a new channel which is the same as this one but applies the given
* function to the input channel's error value.
*
* @since 2.0.0
* @category utils
*/
export const mapInputError = channel.mapInputError;
/**
* Returns a new channel which is the same as this one but applies the given
* effectual function to the input channel's error value.
*
* @since 2.0.0
* @category utils
*/
export const mapInputErrorEffect = channel.mapInputErrorEffect;
/**
* Returns a new channel which is the same as this one but applies the given
* function to the input channel's output elements.
*
* @since 2.0.0
* @category utils
*/
export const mapInputIn = channel.mapInputIn;
/**
* Returns a new channel which is the same as this one but applies the given
* effectual function to the input channel's output elements.
*
* @since 2.0.0
* @category utils
*/
export const mapInputInEffect = channel.mapInputInEffect;
/**
* Returns a new channel, which is the same as this one, except that all the
* outputs are collected and bundled into a tuple together with the terminal
* value of this channel.
*
* As the channel returned from this channel collects all of this channel's
* output into an in- memory chunk, it is not safe to call this method on
* channels that output a large or unbounded number of values.
*
* @since 2.0.0
* @category utils
*/
export const doneCollect = channel.doneCollect;
/**
* Returns a new channel which reads all the elements from upstream's output
* channel and ignores them, then terminates with the upstream result value.
*
* @since 2.0.0
* @category utils
*/
export const drain = channel.drain;
/**
* Returns a new channel which connects the given `AsyncInputProducer` as
* this channel's input.
*
* @since 2.0.0
* @category utils
*/
export const embedInput = core.embedInput;
/**
* Returns a new channel that collects the output and terminal value of this
* channel, which it then writes as output of the returned channel.
*
* @since 2.0.0
* @category utils
*/
export const emitCollect = channel.emitCollect;
/**
* Returns a new channel with an attached finalizer. The finalizer is
* guaranteed to be executed so long as the channel begins execution (and
* regardless of whether or not it completes).
*
* @since 2.0.0
* @category utils
*/
export const ensuring = channel.ensuring;
/**
* Returns a new channel with an attached finalizer. The finalizer is
* guaranteed to be executed so long as the channel begins execution (and
* regardless of whether or not it completes).
*
* @since 2.0.0
* @category utils
*/
export const ensuringWith = core.ensuringWith;
/**
* Accesses the whole context of the channel.
*
* @since 2.0.0
* @category context
*/
export const context = channel.context;
/**
* Accesses the context of the channel with the specified function.
*
* @since 2.0.0
* @category context
*/
export const contextWith = channel.contextWith;
/**
* Accesses the context of the channel in the context of a channel.
*
* @since 2.0.0
* @category context
*/
export const contextWithChannel = channel.contextWithChannel;
/**
* Accesses the context of the channel in the context of an effect.
*
* @since 2.0.0
* @category context
*/
export const contextWithEffect = channel.contextWithEffect;
/**
* Constructs a channel that fails immediately with the specified error.
*
* @since 2.0.0
* @category constructors
*/
export const fail = core.fail;
/**
* Constructs a channel that succeeds immediately with the specified lazily
* evaluated value.
*
* @since 2.0.0
* @category constructors
*/
export const failSync = core.failSync;
/**
* Constructs a channel that fails immediately with the specified `Cause`.
*
* @since 2.0.0
* @category constructors
*/
export const failCause = core.failCause;
/**
* Constructs a channel that succeeds immediately with the specified lazily
* evaluated `Cause`.
*
* @since 2.0.0
* @category constructors
*/
export const failCauseSync = core.failCauseSync;
/**
* Returns a new channel, which sequentially combines this channel, together
* with the provided factory function, which creates a second channel based on
* the terminal value of this channel. The result is a channel that will first
* perform the functions of this channel, before performing the functions of
* the created channel (including yielding its terminal value).
*
* @since 2.0.0
* @category sequencing
*/
export const flatMap = core.flatMap;
/**
* Returns a new channel, which flattens the terminal value of this channel.
* This function may only be called if the terminal value of this channel is
* another channel of compatible types.
*
* @since 2.0.0
* @category sequencing
*/
export const flatten = channel.flatten;
/**
* Folds over the result of this channel.
*
* @since 2.0.0
* @category utils
*/
export const foldChannel = channel.foldChannel;
/**
* Folds over the result of this channel including any cause of termination.
*
* @since 2.0.0
* @category utils
*/
export const foldCauseChannel = core.foldCauseChannel;
/**
* Use an effect to end a channel.
*
* @since 2.0.0
* @category constructors
*/
export const fromEffect = core.fromEffect;
/**
* Constructs a channel from an `Either`.
*
* @since 2.0.0
* @category constructors
*/
export const fromEither = channel.fromEither;
/**
* Construct a `Channel` from an `AsyncInputConsumer`.
*
* @since 2.0.0
* @category constructors
*/
export const fromInput = channel.fromInput;
/**
* Construct a `Channel` from a `PubSub`.
*
* @since 2.0.0
* @category constructors
*/
export const fromPubSub = channel.fromPubSub;
/**
* Construct a `Channel` from a `PubSub` within a scoped effect.
*
* @since 2.0.0
* @category constructors
*/
export const fromPubSubScoped = channel.fromPubSubScoped;
/**
* Construct a `Channel` from an `Option`.
*
* @since 2.0.0
* @category constructors
*/
export const fromOption = channel.fromOption;
/**
* Construct a `Channel` from a `Queue`.
*
* @since 2.0.0
* @category constructors
*/
export const fromQueue = channel.fromQueue;
/**
* @since 2.0.0
* @category constructors
*/
export const identity = channel.identityChannel;
/**
* Returns a new channel, which is the same as this one, except it will be
* interrupted when the specified effect completes. If the effect completes
* successfully before the underlying channel is done, then the returned
* channel will yield the success value of the effect as its terminal value.
* On the other hand, if the underlying channel finishes first, then the
* returned channel will yield the success value of the underlying channel as
* its terminal value.
*
* @since 2.0.0
* @category utils
*/
export const interruptWhen = channel.interruptWhen;
/**
* Returns a new channel, which is the same as this one, except it will be
* interrupted when the specified deferred is completed. If the deferred is
* completed before the underlying channel is done, then the returned channel
* will yield the value of the deferred. Otherwise, if the underlying channel
* finishes first, then the returned channel will yield the value of the
* underlying channel.
*
* @since 2.0.0
* @category utils
*/
export const interruptWhenDeferred = channel.interruptWhenDeferred;
/**
* Returns a new channel, which is the same as this one, except the terminal
* value of the returned channel is created by applying the specified function
* to the terminal value of this channel.
*
* @since 2.0.0
* @category mapping
*/
export const map = channel.map;
/**
* Returns a new channel, which is the same as this one, except the terminal
* value of the returned channel is created by applying the specified
* effectful function to the terminal value of this channel.
*
* @since 2.0.0
* @category mapping
*/
export const mapEffect = channel.mapEffect;
/**
* Returns a new channel, which is the same as this one, except the failure
* value of the returned channel is created by applying the specified function
* to the failure value of this channel.
*
* @since 2.0.0
* @category mapping
*/
export const mapError = channel.mapError;
/**
* A more powerful version of `mapError` which also surfaces the `Cause`
* of the channel failure.
*
* @since 2.0.0
* @category mapping
*/
export const mapErrorCause = channel.mapErrorCause;
/**
* Maps the output of this channel using the specified function.
*
* @since 2.0.0
* @category mapping
*/
export const mapOut = channel.mapOut;
/**
* Creates a channel that is like this channel but the given effectful function
* gets applied to each emitted output element.
*
* @since 2.0.0
* @category mapping
*/
export const mapOutEffect = channel.mapOutEffect;
/**
* Creates a channel that is like this channel but the given ZIO function gets
* applied to each emitted output element, taking `n` elements at once and
* mapping them in parallel.
*
* @since 2.0.0
* @category mapping
*/
export const mapOutEffectPar = channel.mapOutEffectPar;
/**
* @since 2.0.0
* @category utils
*/
export const mergeAll = channel.mergeAll;
/**
* @since 2.0.0
* @category utils
*/
export const mergeAllUnbounded = channel.mergeAllUnbounded;
/**
* @since 2.0.0
* @category utils
*/
export const mergeAllUnboundedWith = channel.mergeAllUnboundedWith;
/**
* @since 2.0.0
* @category utils
*/
export const mergeAllWith = channel.mergeAllWith;
/**
* Returns a new channel which creates a new channel for each emitted element
* and merges some of them together. Different merge strategies control what
* happens if there are more than the given maximum number of channels gets
* created. See `Channel.mergeAll`.
*
* @since 2.0.0
* @category mapping
*/
export const mergeMap = channel.mergeMap;
/**
* Returns a new channel which merges a number of channels emitted by this
* channel using the back pressuring merge strategy. See `Channel.mergeAll`.
*
* @since 2.0.0
* @category utils
*/
export const mergeOut = channel.mergeOut;
/**
* Returns a new channel which merges a number of channels emitted by this
* channel using the back pressuring merge strategy and uses a given function
* to merge each completed subchannel's result value. See
* `Channel.mergeAll`.
*
* @since 2.0.0
* @category utils
*/
export const mergeOutWith = channel.mergeOutWith;
/**
* Returns a new channel, which is the merge of this channel and the specified
* channel, where the behavior of the returned channel on left or right early
* termination is decided by the specified `leftDone` and `rightDone` merge
* decisions.
*
* @since 2.0.0
* @category utils
*/
export const mergeWith = channel.mergeWith;
/**
* Returns a channel that never completes
*
* @since 2.0.0
* @category constructors
*/
export const never = channel.never;
/**
* Translates channel failure into death of the fiber, making all failures
* unchecked and not a part of the type of the channel.
*
* @since 2.0.0
* @category error handling
*/
export const orDie = channel.orDie;
/**
* Keeps none of the errors, and terminates the fiber with them, using the
* specified function to convert the `OutErr` into a defect.
*
* @since 2.0.0
* @category error handling
*/
export const orDieWith = channel.orDieWith;
/**
* Returns a new channel that will perform the operations of this one, until
* failure, and then it will switch over to the operations of the specified
* fallback channel.
*
* @since 2.0.0
* @category error handling
*/
export const orElse = channel.orElse;
/**
* Returns a new channel that pipes the output of this channel into the
* specified channel. The returned channel has the input type of this channel,
* and the output type of the specified channel, terminating with the value of
* the specified channel.
*
* @since 2.0.0
* @category utils
*/
export const pipeTo = core.pipeTo;
/**
* Returns a new channel that pipes the output of this channel into the
* specified channel and preserves this channel's failures without providing
* them to the other channel for observation.
*
* @since 2.0.0
* @category utils
*/
export const pipeToOrFail = channel.pipeToOrFail;
/**
* Provides the channel with its required context, which eliminates its
* dependency on `Env`.
*
* @since 2.0.0
* @category context
*/
export const provideContext = core.provideContext;
/**
* Provides a layer to the channel, which translates it to another level.
*
* @since 2.0.0
* @category context
*/
export const provideLayer = channel.provideLayer;
/**
* Transforms the context being provided to the channel with the specified
* function.
*
* @since 2.0.0
* @category context
*/
export const mapInputContext = channel.mapInputContext;
/**
* Splits the context into two parts, providing one part using the
* specified layer and leaving the remainder `Env0`.
*
* @since 2.0.0
* @category context
*/
export const provideSomeLayer = channel.provideSomeLayer;
/**
* Provides the effect with the single service it requires. If the effect
* requires more than one service use `provideContext` instead.
*
* @since 2.0.0
* @category context
*/
export const provideService = channel.provideService;
/**
* @since 2.0.0
* @category constructors
*/
export const read = channel.read;
/**
* @since 2.0.0
* @category constructors
*/
export const readOrFail = core.readOrFail;
/**
* @since 2.0.0
* @category constructors
*/
export const readWith = core.readWith;
/**
* @since 2.0.0
* @category constructors
*/
export const readWithCause = core.readWithCause;
/**
* Creates a channel which repeatedly runs this channel.
*
* @since 2.0.0
* @category utils
*/
export const repeated = channel.repeated;
/**
* Runs a channel until the end is received.
*
* @since 2.0.0
* @category destructors
*/
export const run = channel.run;
/**
* Run the channel until it finishes with a done value or fails with an error
* and collects its emitted output elements.
*
* The channel must not read any input.
*
* @since 2.0.0
* @category destructors
*/
export const runCollect = channel.runCollect;
/**
* Runs a channel until the end is received.
*
* @since 2.0.0
* @category destructors
*/
export const runDrain = channel.runDrain;
/**
* Run the channel until it finishes with a done value or fails with an error.
* The channel must not read any input or write any output.
*
* Closing the channel, which includes execution of all the finalizers
* attached to the channel will be added to the current scope as a finalizer.
*
* @since 3.11.0
* @category destructors
*/
export const runScoped = channel.runScoped;
/**
* Use a scoped effect to emit an output element.
*
* @since 2.0.0
* @category constructors
*/
export const scoped = channel.scoped;
/**
* Use a function that receives a scope and returns an effect to emit an output
* element. The output element will be the result of the returned effect, if
* successful.
*
* @since 3.11.0
* @category constructors
*/
export const scopedWith = channel.scopedWith;
/**
* Splits strings on newlines. Handles both Windows newlines (`\r\n`) and UNIX
* newlines (`\n`).
*
* @since 2.0.0
* @category combinators
*/
export const splitLines = channel.splitLines;
/**
* Constructs a channel that succeeds immediately with the specified value.
*
* @since 2.0.0
* @category constructors
*/
export const succeed = core.succeed;
/**
* Lazily constructs a channel from the given side effect.
*
* @since 2.0.0
* @category constructors
*/
export const suspend = core.suspend;
/**
* Constructs a channel that succeeds immediately with the specified lazy value.
*
* @since 2.0.0
* @category constructors
*/
export const sync = core.sync;
/**
* Converts a `Channel` to a `PubSub`.
*
* @since 2.0.0
* @category destructors
*/
export const toPubSub = channel.toPubSub;
/**
* Returns a scoped `Effect` that can be used to repeatedly pull elements from
* the constructed `Channel`. The pull effect fails with the channel's failure
* in case the channel fails, or returns either the channel's done value or an
* emitted element.
*
* @since 2.0.0
* @category destructors
*/
export const toPull = channel.toPull;
/**
* Returns an `Effect` that can be used to repeatedly pull elements from the
* constructed `Channel` within the provided `Scope`. The pull effect fails
* with the channel's failure in case the channel fails, or returns either the
* channel's done value or an emitted element.
*
* @since 3.11.0
* @category destructors
*/
export const toPullIn = channel.toPullIn;
/**
* Converts a `Channel` to a `Queue`.
*
* @since 2.0.0
* @category destructors
*/
export const toQueue = channel.toQueue;
/** Converts this channel to a `Sink`.
*
* @since 2.0.0
* @category destructors
*/
export const toSink = sink.channelToSink;
/**
* Converts this channel to a `Stream`.
*
* @since 2.0.0
* @category destructors
*/
export const toStream = stream.channelToStream;
const void_ = core.void;
export {
/**
* @since 2.0.0
* @category constructors
*/
void_ as void };
/**
* Constructs a `Channel` from an effect that will result in a `Channel` if
* successful.
*
* @since 2.0.0
* @category constructors
*/
export const unwrap = channel.unwrap;
/**
* Constructs a `Channel` from a scoped effect that will result in a
* `Channel` if successful.
*
* @since 2.0.0
* @category constructors
*/
export const unwrapScoped = channel.unwrapScoped;
/**
* Constructs a `Channel` from a function which receives a `Scope` and returns
* an effect that will result in a `Channel` if successful.
*
* @since 3.11.0
* @category constructors
*/
export const unwrapScopedWith = channel.unwrapScopedWith;
/**
* Updates a service in the context of this channel.
*
* @since 2.0.0
* @category context
*/
export const updateService = channel.updateService;
/**
* Wraps the channel with a new span for tracing.
*
* @since 2.0.0
* @category tracing
*/
export const withSpan = channel.withSpan;
/**
* Writes a single value to the channel.
*
* @since 2.0.0
* @category constructors
*/
export const write = core.write;
/**
* Writes a sequence of values to the channel.
*
* @since 2.0.0
* @category constructors
*/
export const writeAll = channel.writeAll;
/**
* Writes a `Chunk` of values to the channel.
*
* @since 2.0.0
* @category constructors
*/
export const writeChunk = channel.writeChunk;
/**
* Returns a new channel that is the sequential composition of this channel
* and the specified channel. The returned channel terminates with a tuple of
* the terminal values of both channels.
*
* @since 2.0.0
* @category zipping
*/
export const zip = channel.zip;
/**
* Returns a new channel that is the sequential composition of this channel
* and the specified channel. The returned channel terminates with the
* terminal value of this channel.
*
* @since 2.0.0
* @category zipping
*/
export const zipLeft = channel.zipLeft;
/**
* Returns a new channel that is the sequential composition of this channel
* and the specified channel. The returned channel terminates with the
* terminal value of that channel.
*
* @since 2.0.0
* @category zipping
*/
export const zipRight = channel.zipRight;
/**
* Represents a generic checked exception which occurs when a `Channel` is
* executed.
*
* @since 2.0.0
* @category errors
*/
export const ChannelException = channel.ChannelException;
/**
* Returns `true` if the specified value is an `ChannelException`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isChannelException = channel.isChannelException;
//# sourceMappingURL=Channel.js.map

1
_node_modules/effect/dist/esm/Channel.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

64
_node_modules/effect/dist/esm/ChildExecutorDecision.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
/**
* @since 2.0.0
*/
import * as internal from "./internal/channel/childExecutorDecision.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ChildExecutorDecisionTypeId = internal.ChildExecutorDecisionTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const Continue = internal.Continue;
/**
* @since 2.0.0
* @category constructors
*/
export const Close = internal.Close;
/**
* @since 2.0.0
* @category constructors
*/
export const Yield = internal.Yield;
/**
* Returns `true` if the specified value is a `ChildExecutorDecision`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isChildExecutorDecision = internal.isChildExecutorDecision;
/**
* Returns `true` if the specified `ChildExecutorDecision` is a `Continue`,
* `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isContinue = internal.isContinue;
/**
* Returns `true` if the specified `ChildExecutorDecision` is a `Close`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isClose = internal.isClose;
/**
* Returns `true` if the specified `ChildExecutorDecision` is a `Yield`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isYield = internal.isYield;
/**
* Folds over a `ChildExecutorDecision` to produce a value of type `A`.
*
* @since 2.0.0
* @category folding
*/
export const match = internal.match;
//# sourceMappingURL=ChildExecutorDecision.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ChildExecutorDecision.js","names":["internal","ChildExecutorDecisionTypeId","Continue","Close","Yield","isChildExecutorDecision","isContinue","isClose","isYield","match"],"sources":["../../src/ChildExecutorDecision.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,QAAQ,MAAM,6CAA6C;AAEvE;;;;AAIA,OAAO,MAAMC,2BAA2B,GAAkBD,QAAQ,CAACC,2BAA2B;AA4D9F;;;;AAIA,OAAO,MAAMC,QAAQ,GAAuCF,QAAQ,CAACE,QAAQ;AAE7E;;;;AAIA,OAAO,MAAMC,KAAK,GAA8CH,QAAQ,CAACG,KAAK;AAE9E;;;;AAIA,OAAO,MAAMC,KAAK,GAAuCJ,QAAQ,CAACI,KAAK;AAEvE;;;;;;;AAOA,OAAO,MAAMC,uBAAuB,GAA+CL,QAAQ,CAACK,uBAAuB;AAEnH;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsDN,QAAQ,CAACM,UAAU;AAEhG;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAAmDP,QAAQ,CAACO,OAAO;AAEvF;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAAmDR,QAAQ,CAACQ,OAAO;AAEvF;;;;;;AAMA,OAAO,MAAMC,KAAK,GA4BdT,QAAQ,CAACS,KAAK","ignoreList":[]}

1083
_node_modules/effect/dist/esm/Chunk.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/Chunk.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

38
_node_modules/effect/dist/esm/Clock.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import * as internal from "./internal/clock.js";
import * as defaultServices from "./internal/defaultServices.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ClockTypeId = internal.ClockTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* @since 2.0.0
* @category constructors
*/
export const sleep = defaultServices.sleep;
/**
* @since 2.0.0
* @category constructors
*/
export const currentTimeMillis = defaultServices.currentTimeMillis;
/**
* @since 2.0.0
* @category constructors
*/
export const currentTimeNanos = defaultServices.currentTimeNanos;
/**
* @since 2.0.0
* @category constructors
*/
export const clockWith = defaultServices.clockWith;
/**
* @since 2.0.0
* @category context
*/
export const Clock = internal.clockTag;
//# sourceMappingURL=Clock.js.map

1
_node_modules/effect/dist/esm/Clock.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Clock.js","names":["internal","defaultServices","ClockTypeId","make","sleep","currentTimeMillis","currentTimeNanos","clockWith","Clock","clockTag"],"sources":["../../src/Clock.ts"],"sourcesContent":[null],"mappings":"AAMA,OAAO,KAAKA,QAAQ,MAAM,qBAAqB;AAC/C,OAAO,KAAKC,eAAe,MAAM,+BAA+B;AAEhE;;;;AAIA,OAAO,MAAMC,WAAW,GAAkBF,QAAQ,CAACE,WAAW;AA8D9D;;;;AAIA,OAAO,MAAMC,IAAI,GAAuBH,QAAQ,CAACG,IAAI;AAErD;;;;AAIA,OAAO,MAAMC,KAAK,GAA8DH,eAAe,CAACG,KAAK;AAErG;;;;AAIA,OAAO,MAAMC,iBAAiB,GAA0BJ,eAAe,CAACI,iBAAiB;AAEzF;;;;AAIA,OAAO,MAAMC,gBAAgB,GAA0BL,eAAe,CAACK,gBAAgB;AAEvF;;;;AAIA,OAAO,MAAMC,SAAS,GACpBN,eAAe,CAACM,SAAS;AAE3B;;;;AAIA,OAAO,MAAMC,KAAK,GAA8BR,QAAQ,CAACS,QAAQ","ignoreList":[]}

321
_node_modules/effect/dist/esm/Config.js generated vendored Normal file
View File

@@ -0,0 +1,321 @@
import * as internal from "./internal/config.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ConfigTypeId = internal.ConfigTypeId;
/**
* Constructs a config from a tuple / struct / arguments of configs.
*
* @since 2.0.0
* @category constructors
*/
export const all = internal.all;
/**
* Constructs a config for an array of values.
*
* @since 2.0.0
* @category constructors
*/
export const array = internal.array;
/**
* Constructs a config for a boolean value.
*
* @since 2.0.0
* @category constructors
*/
export const boolean = internal.boolean;
/**
* Constructs a config for a network port [1, 65535].
*
* @since 3.16.0
* @category constructors
*/
export const port = internal.port;
/**
* Constructs a config for an URL value.
*
* @since 3.11.0
* @category constructors
*/
export const url = internal.url;
/**
* Constructs a config for a sequence of values.
*
* @since 2.0.0
* @category constructors
*/
export const chunk = internal.chunk;
/**
* Constructs a config for a date value.
*
* @since 2.0.0
* @category constructors
*/
export const date = internal.date;
/**
* Constructs a config that fails with the specified message.
*
* @since 2.0.0
* @category constructors
*/
export const fail = internal.fail;
/**
* Constructs a config for a float value.
*
* @since 2.0.0
* @category constructors
*/
export const number = internal.number;
/**
* Constructs a config for a integer value.
*
* @since 2.0.0
* @category constructors
*/
export const integer = internal.integer;
/**
* Constructs a config for a literal value.
*
* **Example**
*
* ```ts
* import { Config } from "effect"
*
* const config = Config.literal("http", "https")("PROTOCOL")
* ```
*
* @since 2.0.0
* @category constructors
*/
export const literal = internal.literal;
/**
* Constructs a config for a `LogLevel` value.
*
* @since 2.0.0
* @category constructors
*/
export const logLevel = internal.logLevel;
/**
* Constructs a config for a duration value.
*
* @since 2.5.0
* @category constructors
*/
export const duration = internal.duration;
/**
* This function returns `true` if the specified value is an `Config` value,
* `false` otherwise.
*
* This function can be useful for checking the type of a value before
* attempting to operate on it as an `Config` value. For example, you could
* use `isConfig` to check the type of a value before using it as an
* argument to a function that expects an `Config` value.
*
* @since 2.0.0
* @category refinements
*/
export const isConfig = internal.isConfig;
/**
* Returns a config whose structure is the same as this one, but which produces
* a different value, constructed using the specified function.
*
* @since 2.0.0
* @category mapping
*/
export const map = internal.map;
/**
* Returns a config whose structure is the same as this one, but which may
* produce a different value, constructed using the specified function, which
* may throw exceptions that will be translated into validation errors.
*
* @since 2.0.0
* @category utils
*/
export const mapAttempt = internal.mapAttempt;
/**
* Returns a new config whose structure is the samea as this one, but which
* may produce a different value, constructed using the specified fallible
* function.
*
* @since 2.0.0
* @category utils
*/
export const mapOrFail = internal.mapOrFail;
/**
* Returns a config that has this configuration nested as a property of the
* specified name.
*
* @since 2.0.0
* @category utils
*/
export const nested = internal.nested;
/**
* Returns a config whose structure is preferentially described by this
* config, but which falls back to the specified config if there is an issue
* reading from this config.
*
* @since 2.0.0
* @category utils
*/
export const orElse = internal.orElse;
/**
* Returns configuration which reads from this configuration, but which falls
* back to the specified configuration if reading from this configuration
* fails with an error satisfying the specified predicate.
*
* @since 2.0.0
* @category utils
*/
export const orElseIf = internal.orElseIf;
/**
* Returns an optional version of this config, which will be `None` if the
* data is missing from configuration, and `Some` otherwise.
*
* @since 2.0.0
* @category utils
*/
export const option = internal.option;
/**
* Constructs a new primitive config.
*
* @since 2.0.0
* @category constructors
*/
export const primitive = internal.primitive;
/**
* Returns a config that describes a sequence of values, each of which has the
* structure of this config.
*
* @since 2.0.0
* @category utils
*/
export const repeat = internal.repeat;
/**
* Constructs a config for a secret value.
*
* @since 2.0.0
* @category constructors
* @deprecated
*/
export const secret = internal.secret;
/**
* Constructs a config for a redacted value.
*
* @since 2.0.0
* @category constructors
*/
export const redacted = internal.redacted;
/**
* Constructs a config for a branded value.
*
* @since 3.16.0
* @category constructors
*/
export const branded = internal.branded;
/**
* Constructs a config for a sequence of values.
*
* @since 2.0.0
* @category constructors
*/
export const hashSet = internal.hashSet;
/**
* Constructs a config for a string value.
*
* @since 2.0.0
* @category constructors
*/
export const string = internal.string;
/**
* Constructs a config for a non-empty string value.
*
* @since 3.7.0
* @category constructors
*/
export const nonEmptyString = internal.nonEmptyString;
/**
* Constructs a config which contains the specified value.
*
* @since 2.0.0
* @category constructors
*/
export const succeed = internal.succeed;
/**
* Lazily constructs a config.
*
* @since 2.0.0
* @category constructors
*/
export const suspend = internal.suspend;
/**
* Constructs a config which contains the specified lazy value.
*
* @since 2.0.0
* @category constructors
*/
export const sync = internal.sync;
/**
* Constructs a config for a sequence of values.
*
* @since 2.0.0
* @category constructors
*/
export const hashMap = internal.hashMap;
/**
* Constructs a config from some configuration wrapped with the `Wrap<A>` utility type.
*
* For example:
*
* ```
* import { Config, unwrap } from "./Config"
*
* interface Options { key: string }
*
* const makeConfig = (config: Config.Wrap<Options>): Config<Options> => unwrap(config)
* ```
*
* @since 2.0.0
* @category constructors
*/
export const unwrap = internal.unwrap;
/**
* Returns a config that describes the same structure as this one, but which
* performs validation during loading.
*
* @since 2.0.0
* @category utils
*/
export const validate = internal.validate;
/**
* Returns a config that describes the same structure as this one, but has the
* specified default value in case the information cannot be found.
*
* @since 2.0.0
* @category utils
*/
export const withDefault = internal.withDefault;
/**
* Adds a description to this configuration, which is intended for humans.
*
* @since 2.0.0
* @category utils
*/
export const withDescription = internal.withDescription;
/**
* Returns a config that is the composition of this config and the specified
* config.
*
* @since 2.0.0
* @category zipping
*/
export const zip = internal.zip;
/**
* Returns a config that is the composes this config and the specified config
* using the provided function.
*
* @since 2.0.0
* @category zipping
*/
export const zipWith = internal.zipWith;
//# sourceMappingURL=Config.js.map

1
_node_modules/effect/dist/esm/Config.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Config.js","names":["internal","ConfigTypeId","all","array","boolean","port","url","chunk","date","fail","number","integer","literal","logLevel","duration","isConfig","map","mapAttempt","mapOrFail","nested","orElse","orElseIf","option","primitive","repeat","secret","redacted","branded","hashSet","string","nonEmptyString","succeed","suspend","sync","hashMap","unwrap","validate","withDefault","withDescription","zip","zipWith"],"sources":["../../src/Config.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,QAAQ,MAAM,sBAAsB;AAQhD;;;;AAIA,OAAO,MAAMC,YAAY,GAAkBD,QAAQ,CAACC,YAAY;AAwEhE;;;;;;AAMA,OAAO,MAAMC,GAAG,GAWZF,QAAQ,CAACE,GAAG;AAEhB;;;;;;AAMA,OAAO,MA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sC,eAAe;AAE5B;;;;;;;AAOA,OAAO,MAAMC,GAAG,GAiBZvC,QAAQ,CAACuC,GAAG;AAEhB;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAiBhBxC,QAAQ,CAACwC,OAAO","ignoreList":[]}

107
_node_modules/effect/dist/esm/ConfigError.js generated vendored Normal file
View File

@@ -0,0 +1,107 @@
import * as internal from "./internal/configError.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ConfigErrorTypeId = internal.ConfigErrorTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const And = internal.And;
/**
* @since 2.0.0
* @category constructors
*/
export const Or = internal.Or;
/**
* @since 2.0.0
* @category constructors
*/
export const MissingData = internal.MissingData;
/**
* @since 2.0.0
* @category constructors
*/
export const InvalidData = internal.InvalidData;
/**
* @since 2.0.0
* @category constructors
*/
export const SourceUnavailable = internal.SourceUnavailable;
/**
* @since 2.0.0
* @category constructors
*/
export const Unsupported = internal.Unsupported;
/**
* Returns `true` if the specified value is a `ConfigError`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isConfigError = internal.isConfigError;
/**
* Returns `true` if the specified `ConfigError` is an `And`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isAnd = internal.isAnd;
/**
* Returns `true` if the specified `ConfigError` is an `Or`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isOr = internal.isOr;
/**
* Returns `true` if the specified `ConfigError` is an `InvalidData`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isInvalidData = internal.isInvalidData;
/**
* Returns `true` if the specified `ConfigError` is an `MissingData`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isMissingData = internal.isMissingData;
/**
* Returns `true` if the specified `ConfigError` contains only `MissingData` errors, `false` otherwise.
*
* @since 2.0.0
* @categer getters
*/
export const isMissingDataOnly = internal.isMissingDataOnly;
/**
* Returns `true` if the specified `ConfigError` is a `SourceUnavailable`,
* `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isSourceUnavailable = internal.isSourceUnavailable;
/**
* Returns `true` if the specified `ConfigError` is an `Unsupported`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isUnsupported = internal.isUnsupported;
/**
* @since 2.0.0
* @category utils
*/
export const prefixed = internal.prefixed;
/**
* @since 2.0.0
* @category folding
*/
export const reduceWithContext = internal.reduceWithContext;
//# sourceMappingURL=ConfigError.js.map

1
_node_modules/effect/dist/esm/ConfigError.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ConfigError.js","names":["internal","ConfigErrorTypeId","And","Or","MissingData","InvalidData","SourceUnavailable","Unsupported","isConfigError","isAnd","isOr","isInvalidData","isMissingData","isMissingDataOnly","isSourceUnavailable","isUnsupported","prefixed","reduceWithContext"],"sources":["../../src/ConfigError.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,QAAQ,MAAM,2BAA2B;AAErD;;;;AAIA,OAAO,MAAMC,iBAAiB,GAAkBD,QAAQ,CAACC,iBAAiB;AAmI1E;;;;AAIA,OAAO,MAAMC,GAAG,GAA0DF,QAAQ,CAACE,GAAG;AAEtF;;;;AAIA,OAAO,MAAMC,EAAE,GAA0DH,QAAQ,CAACG,EAAE;AAEpF;;;;AAIA,OAAO,MAAMC,WAAW,GACtBJ,QAAQ,CAACI,WAAW;AAEtB;;;;AAIA,OAAO,MAAMC,WAAW,GACtBL,QAAQ,CAACK,WAAW;AAEtB;;;;AAIA,OAAO,MAAMC,iBAAiB,GAKXN,QAAQ,CAACM,iBAAiB;AAE7C;;;;AAIA,OAAO,MAAMC,WAAW,GACtBP,QAAQ,CAACO,WAAW;AAEtB;;;;;;AAMA,OAAO,MAAMC,aAAa,GAAqCR,QAAQ,CAACQ,aAAa;AAErF;;;;;;AAMA,OAAO,MAAMC,KAAK,GAAuCT,QAAQ,CAACS,KAAK;AAEvE;;;;;;AAMA,OAAO,MAAMC,IAAI,GAAsCV,QAAQ,CAACU,IAAI;AAEpE;;;;;;;AAOA,OAAO,MAAMC,aAAa,GAA+CX,QAAQ,CAACW,aAAa;AAE/F;;;;;;;AAOA,OAAO,MAAMC,aAAa,GAA+CZ,QAAQ,CAACY,aAAa;AAE/F;;;;;;AAMA,OAAO,MAAMC,iBAAiB,GAAmCb,QAAQ,CAACa,iBAAiB;AAE3F;;;;;;;AAOA,OAAO,MAAMC,mBAAmB,GAAqDd,QAAQ,CAACc,mBAAmB;AAEjH;;;;;;;AAOA,OAAO,MAAMC,aAAa,GAA+Cf,QAAQ,CAACe,aAAa;AAE/F;;;;AAIA,OAAO,MAAMC,QAAQ,GAWjBhB,QAAQ,CAACgB,QAAQ;AAErB;;;;AAIA,OAAO,MAAMC,iBAAiB,GAW1BjB,QAAQ,CAACiB,iBAAiB","ignoreList":[]}

166
_node_modules/effect/dist/esm/ConfigProvider.js generated vendored Normal file
View File

@@ -0,0 +1,166 @@
import * as internal from "./internal/configProvider.js";
/**
* @since 2.0.0
* @category symbols
*/
export const ConfigProviderTypeId = internal.ConfigProviderTypeId;
/**
* @since 2.0.0
* @category symbols
*/
export const FlatConfigProviderTypeId = internal.FlatConfigProviderTypeId;
/**
* The service tag for `ConfigProvider`.
*
* @since 2.0.0
* @category context
*/
export const ConfigProvider = internal.configProviderTag;
/**
* Creates a new config provider.
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* Creates a new flat config provider.
*
* @since 2.0.0
* @category constructors
*/
export const makeFlat = internal.makeFlat;
/**
* A config provider that loads configuration from context variables
*
* **Options**:
*
* - `pathDelim`: The delimiter for the path segments (default: `"_"`).
* - `seqDelim`: The delimiter for the sequence of values (default: `","`).
*
* @since 2.0.0
* @category constructors
*/
export const fromEnv = internal.fromEnv;
/**
* Constructs a new `ConfigProvider` from a key/value (flat) provider, where
* nesting is embedded into the string keys.
*
* @since 2.0.0
* @category constructors
*/
export const fromFlat = internal.fromFlat;
/**
* Constructs a new `ConfigProvider` from a JSON object.
*
* @since 2.0.0
* @category constructors
*/
export const fromJson = internal.fromJson;
// TODO(4.0): use `_` for nested configs instead of `.` in next major
/**
* Constructs a ConfigProvider using a map and the specified delimiter string,
* which determines how to split the keys in the map into path segments.
*
* @since 2.0.0
* @category constructors
*/
export const fromMap = internal.fromMap;
/**
* Returns a new config provider that will automatically convert all property
* names to constant case. This can be utilized to adapt the names of
* configuration properties from the default naming convention of camel case
* to the naming convention of a config provider.
*
* @since 2.0.0
* @category combinators
*/
export const constantCase = internal.constantCase;
/**
* Returns a new config provider that will automatically tranform all path
* configuration names with the specified function. This can be utilized to
* adapt the names of configuration properties from one naming convention to
* another.
*
* @since 2.0.0
* @category utils
*/
export const mapInputPath = internal.mapInputPath;
/**
* Returns a new config provider that will automatically convert all property
* names to kebab case. This can be utilized to adapt the names of
* configuration properties from the default naming convention of camel case
* to the naming convention of a config provider.
*
* @since 2.0.0
* @category combinators
*/
export const kebabCase = internal.kebabCase;
/**
* Returns a new config provider that will automatically convert all property
* names to lower case. This can be utilized to adapt the names of
* configuration properties from the default naming convention of camel case
* to the naming convention of a config provider.
*
* @since 2.0.0
* @category combinators
*/
export const lowerCase = internal.lowerCase;
/**
* Returns a new config provider that will automatically nest all
* configuration under the specified property name. This can be utilized to
* aggregate separate configuration sources that are all required to load a
* single configuration value.
*
* @since 2.0.0
* @category utils
*/
export const nested = internal.nested;
/**
* Returns a new config provider that preferentially loads configuration data
* from this one, but which will fall back to the specified alternate provider
* if there are any issues loading the configuration from this provider.
*
* @since 2.0.0
* @category utils
*/
export const orElse = internal.orElse;
/**
* Returns a new config provider that will automatically un-nest all
* configuration under the specified property name. This can be utilized to
* de-aggregate separate configuration sources that are all required to load a
* single configuration value.
*
* @since 2.0.0
* @category utils
*/
export const unnested = internal.unnested;
/**
* Returns a new config provider that will automatically convert all property
* names to upper case. This can be utilized to adapt the names of
* configuration properties from the default naming convention of camel case
* to the naming convention of a config provider.
*
* @since 2.0.0
* @category combinators
*/
export const snakeCase = internal.snakeCase;
/**
* Returns a new config provider that will automatically convert all property
* names to upper case. This can be utilized to adapt the names of
* configuration properties from the default naming convention of camel case
* to the naming convention of a config provider.
*
* @since 2.0.0
* @category combinators
*/
export const upperCase = internal.upperCase;
/**
* Returns a new config provider that transforms the config provider with the
* specified function within the specified path.
*
* @since 2.0.0
* @category combinators
*/
export const within = internal.within;
//# sourceMappingURL=ConfigProvider.js.map

1
_node_modules/effect/dist/esm/ConfigProvider.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ConfigProvider.js","names":["internal","ConfigProviderTypeId","FlatConfigProviderTypeId","ConfigProvider","configProviderTag","make","makeFlat","fromEnv","fromFlat","fromJson","fromMap","constantCase","mapInputPath","kebabCase","lowerCase","nested","orElse","unnested","snakeCase","upperCase","within"],"sources":["../../src/ConfigProvider.ts"],"sourcesContent":[null],"mappings":"AAUA,OAAO,KAAKA,QAAQ,MAAM,8BAA8B;AAGxD;;;;AAIA,OAAO,MAAMC,oBAAoB,GAAkBD,QAAQ,CAACC,oBAAoB;AAQhF;;;;AAIA,OAAO,MAAMC,wBAAwB,GAAkBF,QAAQ,CAACE,wBAAwB;AAuGxF;;;;;;AAMA,OAAO,MAAMC,cAAc,GAAgDH,QAAQ,CAACI,iBAAiB;AAErG;;;;;;AAMA,OAAO,MAAMC,IAAI,GAKKL,QAAQ,CAACK,IAAI;AAEnC;;;;;;AAMA,OAAO,MAAMC,QAAQ,GAUON,QAAQ,CAACM,QAAQ;AAE7C;;;;;;;;;;;AAWA,OAAO,MAAMC,OAAO,GAAwEP,QAAQ,CAACO,OAAO;AAE5G;;;;;;;AAOA,OAAO,MAAMC,QAAQ,GAAkDR,QAAQ,CAACQ,QAAQ;AAExF;;;;;;AAMA,OAAO,MAAMC,QAAQ,GAAsCT,QAAQ,CAACS,QAAQ;AAE5E;AACA;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAClBV,QAAQ,CAACU,OAAO;AAElB;;;;;;;;;AASA,OAAO,MAAMC,YAAY,GAA6CX,QAAQ,CAACW,YAAY;AAE3F;;;;;;;;;AASA,OAAO,MAAMC,YAAY,GAqBrBZ,QAAQ,CAACY,YAAY;AAEzB;;;;;;;;;AASA,OAAO,MAAMC,SAAS,GAA6Cb,QAAQ,CAACa,SAAS;AAErF;;;;;;;;;AASA,OAAO,MAAMC,SAAS,GAA6Cd,QAAQ,CAACc,SAAS;AAErF;;;;;;;;;AASA,OAAO,MAAMC,MAAM,GAqBff,QAAQ,CAACe,MAAM;AAEnB;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAmBfhB,QAAQ,CAACgB,MAAM;AAEnB;;;;;;;;;AASA,OAAO,MAAMC,QAAQ,GAqBjBjB,QAAQ,CAACiB,QAAQ;AAErB;;;;;;;;;AASA,OAAO,MAAMC,SAAS,GAA6ClB,QAAQ,CAACkB,SAAS;AAErF;;;;;;;;;AASA,OAAO,MAAMC,SAAS,GAA6CnB,QAAQ,CAACmB,SAAS;AAErF;;;;;;;AAOA,OAAO,MAAMC,MAAM,GAqBfpB,QAAQ,CAACoB,MAAM","ignoreList":[]}

View File

@@ -0,0 +1,30 @@
/**
* @since 2.0.0
*/
import * as internal from "./internal/configProvider/pathPatch.js";
/**
* @since 2.0.0
* @category constructors
*/
export const empty = internal.empty;
/**
* @since 2.0.0
* @category constructors
*/
export const andThen = internal.andThen;
/**
* @since 2.0.0
* @category constructors
*/
export const mapName = internal.mapName;
/**
* @since 2.0.0
* @category constructors
*/
export const nested = internal.nested;
/**
* @since 2.0.0
* @category constructors
*/
export const unnested = internal.unnested;
//# sourceMappingURL=ConfigProviderPathPatch.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ConfigProviderPathPatch.js","names":["internal","empty","andThen","mapName","nested","unnested"],"sources":["../../src/ConfigProviderPathPatch.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,QAAQ,MAAM,wCAAwC;AAwDlE;;;;AAIA,OAAO,MAAMC,KAAK,GAAcD,QAAQ,CAACC,KAAK;AAE9C;;;;AAIA,OAAO,MAAMC,OAAO,GAWhBF,QAAQ,CAACE,OAAO;AAEpB;;;;AAIA,OAAO,MAAMC,OAAO,GAWhBH,QAAQ,CAACG,OAAO;AAEpB;;;;AAIA,OAAO,MAAMC,MAAM,GAWfJ,QAAQ,CAACI,MAAM;AAEnB;;;;AAIA,OAAO,MAAMC,QAAQ,GAWjBL,QAAQ,CAACK,QAAQ","ignoreList":[]}

118
_node_modules/effect/dist/esm/Console.js generated vendored Normal file
View File

@@ -0,0 +1,118 @@
import * as internal from "./internal/console.js";
import * as defaultConsole from "./internal/defaultServices/console.js";
/**
* @since 2.0.0
* @category type ids
*/
export const TypeId = defaultConsole.TypeId;
/**
* @since 2.0.0
* @category context
*/
export const Console = defaultConsole.consoleTag;
/**
* @since 2.0.0
* @category default services
*/
export const withConsole = internal.withConsole;
/**
* @since 2.0.0
* @category default services
*/
export const setConsole = internal.setConsole;
/**
* @since 2.0.0
* @category accessor
*/
export const consoleWith = internal.consoleWith;
/**
* @since 2.0.0
* @category accessor
*/
export const assert = internal.assert;
/**
* @since 2.0.0
* @category accessor
*/
export const clear = internal.clear;
/**
* @since 2.0.0
* @category accessor
*/
export const count = internal.count;
/**
* @since 2.0.0
* @category accessor
*/
export const countReset = internal.countReset;
/**
* @since 2.0.0
* @category accessor
*/
export const debug = internal.debug;
/**
* @since 2.0.0
* @category accessor
*/
export const dir = internal.dir;
/**
* @since 2.0.0
* @category accessor
*/
export const dirxml = internal.dirxml;
/**
* @since 2.0.0
* @category accessor
*/
export const error = internal.error;
/**
* @since 2.0.0
* @category accessor
*/
export const group = internal.group;
/**
* @since 2.0.0
* @category accessor
*/
export const info = internal.info;
/**
* @since 2.0.0
* @category accessor
*/
export const log = internal.log;
/**
* @since 2.0.0
* @category accessor
*/
export const table = internal.table;
/**
* @since 2.0.0
* @category accessor
*/
export const time = internal.time;
/**
* @since 2.0.0
* @category accessor
*/
export const timeLog = internal.timeLog;
/**
* @since 2.0.0
* @category accessor
*/
export const trace = internal.trace;
/**
* @since 2.0.0
* @category accessor
*/
export const warn = internal.warn;
/**
* @since 2.0.0
* @category accessor
*/
export const withGroup = internal.withGroup;
/**
* @since 2.0.0
* @category accessor
*/
export const withTime = internal.withTime;
//# sourceMappingURL=Console.js.map

1
_node_modules/effect/dist/esm/Console.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Console.js","names":["internal","defaultConsole","TypeId","Console","consoleTag","withConsole","setConsole","consoleWith","assert","clear","count","countReset","debug","dir","dirxml","error","group","info","log","table","time","timeLog","trace","warn","withGroup","withTime"],"sources":["../../src/Console.ts"],"sourcesContent":[null],"mappings":"AAKA,OAAO,KAAKA,QAAQ,MAAM,uBAAuB;AACjD,OAAO,KAAKC,cAAc,MAAM,uCAAuC;AAIvE;;;;AAIA,OAAO,MAAMC,MAAM,GAAkBD,cAAc,CAACC,MAAM;AAgE1D;;;;AAIA,OAAO,MAAMC,OAAO,GAAkCF,cAAc,CAACG,UAAU;AAE/E;;;;AAIA,OAAO,MAAMC,WAAW,GAWpBL,QAAQ,CAACK,WAAW;AAExB;;;;AAIA,OAAO,MAAMC,UAAU,GAA0DN,QAAQ,CAACM,UAAU;AAEpG;;;;AAIA,OAAO,MAAMC,WAAW,GAA2EP,QAAQ,CAACO,WAAW;AAEvH;;;;AAIA,OAAO,MAAMC,MAAM,GAAsER,QAAQ,CAACQ,MAAM;AAExG;;;;AAIA,OAAO,MAAMC,KAAK,GAAiBT,QAAQ,CAACS,KAAK;AAEjD;;;;AAIA,OAAO,MAAMC,KAAK,GAAqCV,QAAQ,CAACU,KAAK;AAErE;;;;AAIA,OAAO,MAAMC,UAAU,GAAqCX,QAAQ,CAACW,UAAU;AAE/E;;;;AAIA,OAAO,MAAMC,KAAK,GAAkDZ,QAAQ,CAACY,KAAK;AAElF;;;;AAIA,OAAO,MAAMC,GAAG,GAA+Cb,QAAQ,CAACa,GAAG;AAE3E;;;;AAIA,OAAO,MAAMC,MAAM,GAAkDd,QAAQ,CAACc,MAAM;AAEpF;;;;AAIA,OAAO,MAAMC,KAAK,GAAkDf,QAAQ,CAACe,KAAK;AAElF;;;;AAIA,OAAO,MAAMC,KAAK,GAEgBhB,QAAQ,CAACgB,KAAK;AAEhD;;;;AAIA,OAAO,MAAMC,IAAI,GAAkDjB,QAAQ,CAACiB,IAAI;AAEhF;;;;AAIA,OAAO,MAAMC,GAAG,GAAkDlB,QAAQ,CAACkB,GAAG;AAE9E;;;;AAIA,OAAO,MAAMC,KAAK,GAA2EnB,QAAQ,CAACmB,KAAK;AAE3G;;;;AAIA,OAAO,MAAMC,IAAI,GAA+DpB,QAAQ,CAACoB,IAAI;AAE7F;;;;AAIA,OAAO,MAAMC,OAAO,GAAkErB,QAAQ,CAACqB,OAAO;AAEtG;;;;AAIA,OAAO,MAAMC,KAAK,GAAkDtB,QAAQ,CAACsB,KAAK;AAElF;;;;AAIA,OAAO,MAAMC,IAAI,GAAkDvB,QAAQ,CAACuB,IAAI;AAEhF;;;;AAIA,OAAO,MAAMC,SAAS,GAsBlBxB,QAAQ,CAACwB,SAAS;AAEtB;;;;AAIA,OAAO,MAAMC,QAAQ,GAWjBzB,QAAQ,CAACyB,QAAQ","ignoreList":[]}

360
_node_modules/effect/dist/esm/Context.js generated vendored Normal file
View File

@@ -0,0 +1,360 @@
import * as internal from "./internal/context.js";
/**
* @since 2.0.0
* @category symbol
*/
export const TagTypeId = internal.TagTypeId;
/**
* @since 3.11.0
* @category symbol
*/
export const ReferenceTypeId = internal.ReferenceTypeId;
/**
* Creates a new `Tag` instance with an optional key parameter.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* assert.strictEqual(Context.GenericTag("PORT").key === Context.GenericTag("PORT").key, true)
* ```
*
* @since 2.0.0
* @category constructors
*/
export const GenericTag = internal.makeGenericTag;
const TypeId = internal.TypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMake = internal.makeContext;
/**
* Checks if the provided argument is a `Context`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* assert.strictEqual(Context.isContext(Context.empty()), true)
* ```
*
* @since 2.0.0
* @category guards
*/
export const isContext = internal.isContext;
/**
* Checks if the provided argument is a `Tag`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* assert.strictEqual(Context.isTag(Context.GenericTag("Tag")), true)
* ```
*
* @since 2.0.0
* @category guards
*/
export const isTag = internal.isTag;
/**
* Checks if the provided argument is a `Reference`.
*
* @since 3.11.0
* @category guards
* @experimental
*/
export const isReference = internal.isReference;
/**
* Returns an empty `Context`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* assert.strictEqual(Context.isContext(Context.empty()), true)
* ```
*
* @since 2.0.0
* @category constructors
*/
export const empty = internal.empty;
/**
* Creates a new `Context` with a single service associated to the tag.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
*
* const Services = Context.make(Port, { PORT: 8080 })
*
* assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })
* ```
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* Adds a service to a given `Context`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context, pipe } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const someContext = Context.make(Port, { PORT: 8080 })
*
* const Services = pipe(
* someContext,
* Context.add(Timeout, { TIMEOUT: 5000 })
* )
*
* assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })
* assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })
* ```
*
* @since 2.0.0
*/
export const add = internal.add;
/**
* Get a service from the context that corresponds to the given tag.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, Context } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const Services = pipe(
* Context.make(Port, { PORT: 8080 }),
* Context.add(Timeout, { TIMEOUT: 5000 })
* )
*
* assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })
* ```
*
* @since 2.0.0
* @category getters
*/
export const get = internal.get;
/**
* Get a service from the context that corresponds to the given tag, or
* use the fallback value.
*
* @since 3.7.0
* @category getters
*/
export const getOrElse = internal.getOrElse;
/**
* Get a service from the context that corresponds to the given tag.
* This function is unsafe because if the tag is not present in the context, a runtime error will be thrown.
*
* For a safer version see {@link getOption}.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const Services = Context.make(Port, { PORT: 8080 })
*
* assert.deepStrictEqual(Context.unsafeGet(Services, Port), { PORT: 8080 })
* assert.throws(() => Context.unsafeGet(Services, Timeout))
* ```
*
* @since 2.0.0
* @category unsafe
*/
export const unsafeGet = internal.unsafeGet;
/**
* Get the value associated with the specified tag from the context wrapped in an `Option` object. If the tag is not
* found, the `Option` object will be `None`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context, Option } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const Services = Context.make(Port, { PORT: 8080 })
*
* assert.deepStrictEqual(Context.getOption(Services, Port), Option.some({ PORT: 8080 }))
* assert.deepStrictEqual(Context.getOption(Services, Timeout), Option.none())
* ```
*
* @since 2.0.0
* @category getters
*/
export const getOption = internal.getOption;
/**
* Merges two `Context`s, returning a new `Context` containing the services of both.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const firstContext = Context.make(Port, { PORT: 8080 })
* const secondContext = Context.make(Timeout, { TIMEOUT: 5000 })
*
* const Services = Context.merge(firstContext, secondContext)
*
* assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })
* assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })
* ```
*
* @since 2.0.0
*/
export const merge = internal.merge;
/**
* Merges any number of `Context`s, returning a new `Context` containing the services of all.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
* const Host = Context.GenericTag<{ HOST: string }>("Host")
*
* const firstContext = Context.make(Port, { PORT: 8080 })
* const secondContext = Context.make(Timeout, { TIMEOUT: 5000 })
* const thirdContext = Context.make(Host, { HOST: "localhost" })
*
* const Services = Context.mergeAll(firstContext, secondContext, thirdContext)
*
* assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })
* assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })
* assert.deepStrictEqual(Context.get(Services, Host), { HOST: "localhost" })
* ```
*
* @since 3.12.0
*/
export const mergeAll = internal.mergeAll;
/**
* Returns a new `Context` that contains only the specified services.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, Context, Option } from "effect"
*
* const Port = Context.GenericTag<{ PORT: number }>("Port")
* const Timeout = Context.GenericTag<{ TIMEOUT: number }>("Timeout")
*
* const someContext = pipe(
* Context.make(Port, { PORT: 8080 }),
* Context.add(Timeout, { TIMEOUT: 5000 })
* )
*
* const Services = pipe(someContext, Context.pick(Port))
*
* assert.deepStrictEqual(Context.getOption(Services, Port), Option.some({ PORT: 8080 }))
* assert.deepStrictEqual(Context.getOption(Services, Timeout), Option.none())
* ```
*
* @since 2.0.0
*/
export const pick = internal.pick;
/**
* @since 2.0.0
*/
export const omit = internal.omit;
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Context, Layer } from "effect"
*
* class MyTag extends Context.Tag("MyTag")<
* MyTag,
* { readonly myNum: number }
* >() {
* static Live = Layer.succeed(this, { myNum: 108 })
* }
* ```
*
* @since 2.0.0
* @category constructors
*/
export const Tag = internal.Tag;
/**
* Creates a context tag with a default value.
*
* **Details**
*
* `Context.Reference` allows you to create a tag that can hold a value. You can
* provide a default value for the service, which will automatically be used
* when the context is accessed, or override it with a custom implementation
* when needed.
*
* **Example** (Declaring a Tag with a default value)
*
* ```ts
* import * as assert from "node:assert"
* import { Context, Effect } from "effect"
*
* class SpecialNumber extends Context.Reference<SpecialNumber>()(
* "SpecialNumber",
* { defaultValue: () => 2048 }
* ) {}
*
* // ┌─── Effect<void, never, never>
* // ▼
* const program = Effect.gen(function* () {
* const specialNumber = yield* SpecialNumber
* console.log(`The special number is ${specialNumber}`)
* })
*
* // No need to provide the SpecialNumber implementation
* Effect.runPromise(program)
* // Output: The special number is 2048
* ```
*
* **Example** (Overriding the default value)
*
* ```ts
* import { Context, Effect } from "effect"
*
* class SpecialNumber extends Context.Reference<SpecialNumber>()(
* "SpecialNumber",
* { defaultValue: () => 2048 }
* ) {}
*
* const program = Effect.gen(function* () {
* const specialNumber = yield* SpecialNumber
* console.log(`The special number is ${specialNumber}`)
* })
*
* Effect.runPromise(program.pipe(Effect.provideService(SpecialNumber, -1)))
* // Output: The special number is -1
* ```
*
* @since 3.11.0
* @category constructors
* @experimental
*/
export const Reference = internal.Reference;
//# sourceMappingURL=Context.js.map

1
_node_modules/effect/dist/esm/Context.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Context.js","names":["internal","TagTypeId","ReferenceTypeId","GenericTag","makeGenericTag","TypeId","unsafeMake","makeContext","isContext","isTag","isReference","empty","make","add","get","getOrElse","unsafeGet","getOption","merge","mergeAll","pick","omit","Tag","Reference"],"sources":["../../src/Context.ts"],"sourcesContent":[null],"mappings":"AAaA,OAAO,KAAKA,QAAQ,MAAM,uBAAuB;AAMjD;;;;AAIA,OAAO,MAAMC,SAAS,GAAkBD,QAAQ,CAACC,SAAS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QAAQ;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,IAAI,GAE8EpB,QAAQ,CAACoB,IAAI;AAE5G;;;AAGA,OAAO,MAAMC,IAAI,GAEsFrB,QAAQ,CAACqB,IAAI;AAEpH;;;;;;;;;;;;;;;;;AAiBA,OAAO,MAAMC,GAAG,GAAsFtB,QAAQ,CAACsB,GAAG;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,OAAO,MAAMC,SAAS,GAGmBvB,QAAQ,CAACuB,SAAS","ignoreList":[]}

566
_node_modules/effect/dist/esm/Cron.js generated vendored Normal file
View File

@@ -0,0 +1,566 @@
/**
* @since 2.0.0
*/
import * as Arr from "./Array.js";
import * as Data from "./Data.js";
import * as Either from "./Either.js";
import * as Equal from "./Equal.js";
import * as equivalence from "./Equivalence.js";
import { constVoid, dual, identity, pipe } from "./Function.js";
import * as Hash from "./Hash.js";
import { format, NodeInspectSymbol } from "./Inspectable.js";
import * as dateTime from "./internal/dateTime.js";
import * as N from "./Number.js";
import * as Option from "./Option.js";
import { pipeArguments } from "./Pipeable.js";
import { hasProperty } from "./Predicate.js";
import * as String from "./String.js";
/**
* @since 2.0.0
* @category symbols
*/
export const TypeId = /*#__PURE__*/Symbol.for("effect/Cron");
const CronProto = {
[TypeId]: TypeId,
[Equal.symbol](that) {
return isCron(that) && equals(this, that);
},
[Hash.symbol]() {
return pipe(Hash.hash(this.tz), Hash.combine(Hash.array(Arr.fromIterable(this.seconds))), Hash.combine(Hash.array(Arr.fromIterable(this.minutes))), Hash.combine(Hash.array(Arr.fromIterable(this.hours))), Hash.combine(Hash.array(Arr.fromIterable(this.days))), Hash.combine(Hash.array(Arr.fromIterable(this.months))), Hash.combine(Hash.array(Arr.fromIterable(this.weekdays))), Hash.cached(this));
},
toString() {
return format(this.toJSON());
},
toJSON() {
return {
_id: "Cron",
tz: this.tz,
seconds: Arr.fromIterable(this.seconds),
minutes: Arr.fromIterable(this.minutes),
hours: Arr.fromIterable(this.hours),
days: Arr.fromIterable(this.days),
months: Arr.fromIterable(this.months),
weekdays: Arr.fromIterable(this.weekdays)
};
},
[NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
/**
* Checks if a given value is a `Cron` instance.
*
* @since 2.0.0
* @category guards
*/
export const isCron = u => hasProperty(u, TypeId);
/**
* Creates a `Cron` instance.
*
* @since 2.0.0
* @category constructors
*/
export const make = values => {
const o = Object.create(CronProto);
o.seconds = new Set(Arr.sort(values.seconds ?? [0], N.Order));
o.minutes = new Set(Arr.sort(values.minutes, N.Order));
o.hours = new Set(Arr.sort(values.hours, N.Order));
o.days = new Set(Arr.sort(values.days, N.Order));
o.months = new Set(Arr.sort(values.months, N.Order));
o.weekdays = new Set(Arr.sort(values.weekdays, N.Order));
o.tz = Option.fromNullable(values.tz);
const seconds = Array.from(o.seconds);
const minutes = Array.from(o.minutes);
const hours = Array.from(o.hours);
const days = Array.from(o.days);
const months = Array.from(o.months);
const weekdays = Array.from(o.weekdays);
o.first = {
second: seconds[0] ?? 0,
minute: minutes[0] ?? 0,
hour: hours[0] ?? 0,
day: days[0] ?? 1,
month: (months[0] ?? 1) - 1,
weekday: weekdays[0] ?? 0
};
o.next = {
second: nextLookupTable(seconds, 60),
minute: nextLookupTable(minutes, 60),
hour: nextLookupTable(hours, 24),
day: nextLookupTable(days, 32),
month: nextLookupTable(months, 13),
weekday: nextLookupTable(weekdays, 7)
};
return o;
};
const nextLookupTable = (values, size) => {
const result = new Array(size).fill(undefined);
if (values.length === 0) {
return result;
}
let current = undefined;
let index = values.length - 1;
for (let i = size - 1; i >= 0; i--) {
while (index >= 0 && values[index] >= i) {
current = values[index--];
}
result[i] = current;
}
return result;
};
/**
* @since 2.0.0
* @category symbol
*/
export const ParseErrorTypeId = /*#__PURE__*/Symbol.for("effect/Cron/errors/ParseError");
/**
* Represents a checked exception which occurs when decoding fails.
*
* @since 2.0.0
* @category models
*/
export class ParseError extends /*#__PURE__*/Data.TaggedError("CronParseError") {
/**
* @since 2.0.0
*/
[ParseErrorTypeId] = ParseErrorTypeId;
}
/**
* Returns `true` if the specified value is an `ParseError`, `false` otherwise.
*
* @since 2.0.0
* @category guards
*/
export const isParseError = u => hasProperty(u, ParseErrorTypeId);
/**
* Parses a cron expression into a `Cron` instance.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* // At 04:00 on every day-of-month from 8 through 14.
* assert.deepStrictEqual(Cron.parse("0 0 4 8-14 * *"), Either.right(Cron.make({
* seconds: [0],
* minutes: [0],
* hours: [4],
* days: [8, 9, 10, 11, 12, 13, 14],
* months: [],
* weekdays: []
* })))
* ```
*
* @since 2.0.0
* @category constructors
*/
export const parse = (cron, tz) => {
const segments = cron.split(" ").filter(String.isNonEmpty);
if (segments.length !== 5 && segments.length !== 6) {
return Either.left(new ParseError({
message: `Invalid number of segments in cron expression`,
input: cron
}));
}
if (segments.length === 5) {
segments.unshift("0");
}
const [seconds, minutes, hours, days, months, weekdays] = segments;
const zone = tz === undefined || dateTime.isTimeZone(tz) ? Either.right(tz) : Either.fromOption(dateTime.zoneFromString(tz), () => new ParseError({
message: `Invalid time zone in cron expression`,
input: tz
}));
return Either.all({
tz: zone,
seconds: parseSegment(seconds, secondOptions),
minutes: parseSegment(minutes, minuteOptions),
hours: parseSegment(hours, hourOptions),
days: parseSegment(days, dayOptions),
months: parseSegment(months, monthOptions),
weekdays: parseSegment(weekdays, weekdayOptions)
}).pipe(Either.map(make));
};
/**
* Parses a cron expression into a `Cron` instance.
*
* **Details**
*
* This function takes a cron expression as a string and attempts to parse it
* into a `Cron` instance. If the expression is valid, the resulting `Cron`
* instance will represent the schedule defined by the cron expression.
*
* If the expression is invalid, the function throws a `ParseError`.
*
* You can optionally provide a time zone (`tz`) to interpret the cron
* expression in a specific time zone. If no time zone is provided, the cron
* expression will use the default time zone.
*
* @example
* ```ts
* import { Cron } from "effect"
*
* // At 04:00 on every day-of-month from 8 through 14.
* console.log(Cron.unsafeParse("0 4 8-14 * *"))
* // Output:
* // {
* // _id: 'Cron',
* // tz: { _id: 'Option', _tag: 'None' },
* // seconds: [ 0 ],
* // minutes: [ 0 ],
* // hours: [ 4 ],
* // days: [
* // 8, 9, 10, 11,
* // 12, 13, 14
* // ],
* // months: [],
* // weekdays: []
* // }
* ```
*
* @since 2.0.0
* @category constructors
*/
export const unsafeParse = (cron, tz) => Either.getOrThrowWith(parse(cron, tz), identity);
/**
* Checks if a given `Date` falls within an active `Cron` time window.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
* assert.deepStrictEqual(Cron.match(cron, new Date("2021-01-08 04:00:00")), true)
* assert.deepStrictEqual(Cron.match(cron, new Date("2021-01-08 05:00:00")), false)
* ```
*
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
*
* @since 2.0.0
*/
export const match = (cron, date) => {
const parts = dateTime.unsafeMakeZoned(date, {
timeZone: Option.getOrUndefined(cron.tz)
}).pipe(dateTime.toParts);
if (cron.seconds.size !== 0 && !cron.seconds.has(parts.seconds)) {
return false;
}
if (cron.minutes.size !== 0 && !cron.minutes.has(parts.minutes)) {
return false;
}
if (cron.hours.size !== 0 && !cron.hours.has(parts.hours)) {
return false;
}
if (cron.months.size !== 0 && !cron.months.has(parts.month)) {
return false;
}
if (cron.days.size === 0 && cron.weekdays.size === 0) {
return true;
}
if (cron.weekdays.size === 0) {
return cron.days.has(parts.day);
}
if (cron.days.size === 0) {
return cron.weekdays.has(parts.weekDay);
}
return cron.days.has(parts.day) || cron.weekdays.has(parts.weekDay);
};
const daysInMonth = date => new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 0)).getUTCDate();
/**
* Returns the next run `Date` for the given `Cron` instance.
*
* Uses the current time as a starting point if no value is provided for `now`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Cron, Either } from "effect"
*
* const after = new Date("2021-01-01 00:00:00")
* const cron = Either.getOrThrow(Cron.parse("0 4 8-14 * *"))
* assert.deepStrictEqual(Cron.next(cron, after), new Date("2021-01-08 04:00:00"))
* ```
*
* @throws `IllegalArgumentException` if the given `DateTime.Input` is invalid.
* @throws `Error` if the next run date cannot be found within 10,000 iterations.
*
* @since 2.0.0
*/
export const next = (cron, startFrom) => {
const tz = Option.getOrUndefined(cron.tz);
const zoned = dateTime.unsafeMakeZoned(startFrom ?? new Date(), {
timeZone: tz
});
const utc = tz !== undefined && dateTime.isTimeZoneNamed(tz) && tz.id === "UTC";
const adjustDst = utc ? constVoid : current => {
const adjusted = dateTime.unsafeMakeZoned(current, {
timeZone: zoned.zone,
adjustForTimeZone: true
}).pipe(dateTime.toDate);
// TODO: This implementation currently only skips forward when transitioning into daylight savings time.
const drift = current.getTime() - adjusted.getTime();
if (drift > 0) {
current.setTime(current.getTime() + drift);
}
};
const result = dateTime.mutate(zoned, current => {
current.setUTCSeconds(current.getUTCSeconds() + 1, 0);
for (let i = 0; i < 10_000; i++) {
if (cron.seconds.size !== 0) {
const currentSecond = current.getUTCSeconds();
const nextSecond = cron.next.second[currentSecond];
if (nextSecond === undefined) {
current.setUTCMinutes(current.getUTCMinutes() + 1, cron.first.second);
adjustDst(current);
continue;
}
if (nextSecond > currentSecond) {
current.setUTCSeconds(nextSecond);
adjustDst(current);
continue;
}
}
if (cron.minutes.size !== 0) {
const currentMinute = current.getUTCMinutes();
const nextMinute = cron.next.minute[currentMinute];
if (nextMinute === undefined) {
current.setUTCHours(current.getUTCHours() + 1, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
if (nextMinute > currentMinute) {
current.setUTCMinutes(nextMinute, cron.first.second);
adjustDst(current);
continue;
}
}
if (cron.hours.size !== 0) {
const currentHour = current.getUTCHours();
const nextHour = cron.next.hour[currentHour];
if (nextHour === undefined) {
current.setUTCDate(current.getUTCDate() + 1);
current.setUTCHours(cron.first.hour, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
if (nextHour > currentHour) {
current.setUTCHours(nextHour, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
}
if (cron.weekdays.size !== 0 || cron.days.size !== 0) {
let a = Infinity;
let b = Infinity;
if (cron.weekdays.size !== 0) {
const currentWeekday = current.getUTCDay();
const nextWeekday = cron.next.weekday[currentWeekday];
a = nextWeekday === undefined ? 7 - currentWeekday + cron.first.weekday : nextWeekday - currentWeekday;
}
if (cron.days.size !== 0 && a !== 0) {
const currentDay = current.getUTCDate();
const nextDay = cron.next.day[currentDay];
b = nextDay === undefined ? daysInMonth(current) - currentDay + cron.first.day : nextDay - currentDay;
}
const addDays = Math.min(a, b);
if (addDays !== 0) {
current.setUTCDate(current.getUTCDate() + addDays);
current.setUTCHours(cron.first.hour, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
}
if (cron.months.size !== 0) {
const currentMonth = current.getUTCMonth() + 1;
const nextMonth = cron.next.month[currentMonth];
if (nextMonth === undefined) {
current.setUTCFullYear(current.getUTCFullYear() + 1);
current.setUTCMonth(cron.first.month, cron.first.day);
current.setUTCHours(cron.first.hour, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
if (nextMonth > currentMonth) {
current.setUTCMonth(nextMonth - 1, cron.first.day);
current.setUTCHours(cron.first.hour, cron.first.minute, cron.first.second);
adjustDst(current);
continue;
}
}
return;
}
throw new Error("Unable to find next cron date");
});
return dateTime.toDateUtc(result);
};
/**
* Returns an `IterableIterator` which yields the sequence of `Date`s that match the `Cron` instance.
*
* @since 2.0.0
*/
export const sequence = function* (cron, startFrom) {
while (true) {
yield startFrom = next(cron, startFrom);
}
};
/**
* @category instances
* @since 2.0.0
*/
export const Equivalence = /*#__PURE__*/equivalence.make((self, that) => restrictionsEquals(self.seconds, that.seconds) && restrictionsEquals(self.minutes, that.minutes) && restrictionsEquals(self.hours, that.hours) && restrictionsEquals(self.days, that.days) && restrictionsEquals(self.months, that.months) && restrictionsEquals(self.weekdays, that.weekdays));
const restrictionsArrayEquals = /*#__PURE__*/equivalence.array(equivalence.number);
const restrictionsEquals = (self, that) => restrictionsArrayEquals(Arr.fromIterable(self), Arr.fromIterable(that));
/**
* Checks if two `Cron`s are equal.
*
* @since 2.0.0
* @category predicates
*/
export const equals = /*#__PURE__*/dual(2, (self, that) => Equivalence(self, that));
const secondOptions = {
min: 0,
max: 59
};
const minuteOptions = {
min: 0,
max: 59
};
const hourOptions = {
min: 0,
max: 23
};
const dayOptions = {
min: 1,
max: 31
};
const monthOptions = {
min: 1,
max: 12,
aliases: {
jan: 1,
feb: 2,
mar: 3,
apr: 4,
may: 5,
jun: 6,
jul: 7,
aug: 8,
sep: 9,
oct: 10,
nov: 11,
dec: 12
}
};
const weekdayOptions = {
min: 0,
max: 6,
aliases: {
sun: 0,
mon: 1,
tue: 2,
wed: 3,
thu: 4,
fri: 5,
sat: 6
}
};
const parseSegment = (input, options) => {
const capacity = options.max - options.min + 1;
const values = new Set();
const fields = input.split(",");
for (const field of fields) {
const [raw, step] = splitStep(field);
if (raw === "*" && step === undefined) {
return Either.right(new Set());
}
if (step !== undefined) {
if (!Number.isInteger(step)) {
return Either.left(new ParseError({
message: `Expected step value to be a positive integer`,
input
}));
}
if (step < 1) {
return Either.left(new ParseError({
message: `Expected step value to be greater than 0`,
input
}));
}
if (step > options.max) {
return Either.left(new ParseError({
message: `Expected step value to be less than ${options.max}`,
input
}));
}
}
if (raw === "*") {
for (let i = options.min; i <= options.max; i += step ?? 1) {
values.add(i);
}
} else {
const [left, right] = splitRange(raw, options.aliases);
if (!Number.isInteger(left)) {
return Either.left(new ParseError({
message: `Expected a positive integer`,
input
}));
}
if (left < options.min || left > options.max) {
return Either.left(new ParseError({
message: `Expected a value between ${options.min} and ${options.max}`,
input
}));
}
if (right === undefined) {
values.add(left);
} else {
if (!Number.isInteger(right)) {
return Either.left(new ParseError({
message: `Expected a positive integer`,
input
}));
}
if (right < options.min || right > options.max) {
return Either.left(new ParseError({
message: `Expected a value between ${options.min} and ${options.max}`,
input
}));
}
if (left > right) {
return Either.left(new ParseError({
message: `Invalid value range`,
input
}));
}
for (let i = left; i <= right; i += step ?? 1) {
values.add(i);
}
}
}
if (values.size >= capacity) {
return Either.right(new Set());
}
}
return Either.right(values);
};
const splitStep = input => {
const seperator = input.indexOf("/");
if (seperator !== -1) {
return [input.slice(0, seperator), Number(input.slice(seperator + 1))];
}
return [input, undefined];
};
const splitRange = (input, aliases) => {
const seperator = input.indexOf("-");
if (seperator !== -1) {
return [aliasOrValue(input.slice(0, seperator), aliases), aliasOrValue(input.slice(seperator + 1), aliases)];
}
return [aliasOrValue(input, aliases), undefined];
};
function aliasOrValue(field, aliases) {
return aliases?.[field.toLocaleLowerCase()] ?? Number(field);
}
//# sourceMappingURL=Cron.js.map

1
_node_modules/effect/dist/esm/Cron.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

305
_node_modules/effect/dist/esm/Data.js generated vendored Normal file
View File

@@ -0,0 +1,305 @@
import * as core from "./internal/core.js";
import * as internal from "./internal/data.js";
import { StructuralPrototype } from "./internal/effectable.js";
import * as Predicate from "./Predicate.js";
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* const alice = Data.struct({ name: "Alice", age: 30 })
*
* const bob = Data.struct({ name: "Bob", age: 40 })
*
* assert.deepStrictEqual(Equal.equals(alice, alice), true)
* assert.deepStrictEqual(Equal.equals(alice, Data.struct({ name: "Alice", age: 30 })), true)
*
* assert.deepStrictEqual(Equal.equals(alice, { name: "Alice", age: 30 }), false)
* assert.deepStrictEqual(Equal.equals(alice, bob), false)
* ```
*
* @category constructors
* @since 2.0.0
*/
export const struct = internal.struct;
/**
* @category constructors
* @since 2.0.0
*/
export const unsafeStruct = as => Object.setPrototypeOf(as, StructuralPrototype);
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* const alice = Data.tuple("Alice", 30)
*
* const bob = Data.tuple("Bob", 40)
*
* assert.deepStrictEqual(Equal.equals(alice, alice), true)
* assert.deepStrictEqual(Equal.equals(alice, Data.tuple("Alice", 30)), true)
*
* assert.deepStrictEqual(Equal.equals(alice, ["Alice", 30]), false)
* assert.deepStrictEqual(Equal.equals(alice, bob), false)
* ```
*
* @category constructors
* @since 2.0.0
*/
export const tuple = (...as) => unsafeArray(as);
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* const alice = Data.struct({ name: "Alice", age: 30 })
* const bob = Data.struct({ name: "Bob", age: 40 })
*
* const persons = Data.array([alice, bob])
*
* assert.deepStrictEqual(
* Equal.equals(
* persons,
* Data.array([
* Data.struct({ name: "Alice", age: 30 }),
* Data.struct({ name: "Bob", age: 40 })
* ])
* ),
* true
* )
* ```
*
* @category constructors
* @since 2.0.0
*/
export const array = as => unsafeArray(as.slice(0));
/**
* @category constructors
* @since 2.0.0
*/
export const unsafeArray = as => Object.setPrototypeOf(as, internal.ArrayProto);
const _case = () => args => args === undefined ? Object.create(StructuralPrototype) : struct(args);
export {
/**
* Provides a constructor for the specified `Case`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* interface Person {
* readonly name: string
* }
*
* // Creating a constructor for the specified Case
* const Person = Data.case<Person>()
*
* // Creating instances of Person
* const mike1 = Person({ name: "Mike" })
* const mike2 = Person({ name: "Mike" })
* const john = Person({ name: "John" })
*
* // Checking equality
* assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
* assert.deepStrictEqual(Equal.equals(mike1, john), false)
*
* ```
* @since 2.0.0
* @category constructors
*/
_case as case };
/**
* Provides a tagged constructor for the specified `Case`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data } from "effect"
*
* interface Person {
* readonly _tag: "Person" // the tag
* readonly name: string
* }
*
* const Person = Data.tagged<Person>("Person")
*
* const mike = Person({ name: "Mike" })
*
* assert.deepEqual(mike, { _tag: "Person", name: "Mike" })
* ```
*
* @since 2.0.0
* @category constructors
*/
export const tagged = tag => args => {
const value = args === undefined ? Object.create(StructuralPrototype) : struct(args);
value._tag = tag;
return value;
};
/**
* Provides a constructor for a Case Class.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* class Person extends Data.Class<{ readonly name: string }> {}
*
* // Creating instances of Person
* const mike1 = new Person({ name: "Mike" })
* const mike2 = new Person({ name: "Mike" })
* const john = new Person({ name: "John" })
*
* // Checking equality
* assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
* assert.deepStrictEqual(Equal.equals(mike1, john), false)
* ```
*
* @since 2.0.0
* @category constructors
*/
export const Class = internal.Structural;
/**
* Provides a Tagged constructor for a Case Class.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Data, Equal } from "effect"
*
* class Person extends Data.TaggedClass("Person")<{ readonly name: string }> {}
*
* // Creating instances of Person
* const mike1 = new Person({ name: "Mike" })
* const mike2 = new Person({ name: "Mike" })
* const john = new Person({ name: "John" })
*
* // Checking equality
* assert.deepStrictEqual(Equal.equals(mike1, mike2), true)
* assert.deepStrictEqual(Equal.equals(mike1, john), false)
*
* assert.deepStrictEqual(mike1._tag, "Person")
* ```
*
* @since 2.0.0
* @category constructors
*/
export const TaggedClass = tag => {
class Base extends Class {
_tag = tag;
}
return Base;
};
/**
* @since 2.0.0
* @category constructors
*/
export const Structural = internal.Structural;
/**
* Create a constructor for a tagged union of `Data` structs.
*
* You can also pass a `TaggedEnum.WithGenerics` if you want to add generics to
* the constructor.
*
* @example
* ```ts
* import { Data } from "effect"
*
* const { BadRequest, NotFound } = Data.taggedEnum<
* | { readonly _tag: "BadRequest"; readonly status: 400; readonly message: string }
* | { readonly _tag: "NotFound"; readonly status: 404; readonly message: string }
* >()
*
* const notFound = NotFound({ status: 404, message: "Not Found" })
* ```
*
* @example
* import { Data } from "effect"
*
* type MyResult<E, A> = Data.TaggedEnum<{
* Failure: { readonly error: E }
* Success: { readonly value: A }
* }>
* interface MyResultDefinition extends Data.TaggedEnum.WithGenerics<2> {
* readonly taggedEnum: MyResult<this["A"], this["B"]>
* }
* const { Failure, Success } = Data.taggedEnum<MyResultDefinition>()
*
* const success = Success({ value: 1 })
*
* @category constructors
* @since 2.0.0
*/
export const taggedEnum = () => new Proxy({}, {
get(_target, tag, _receiver) {
if (tag === "$is") {
return Predicate.isTagged;
} else if (tag === "$match") {
return taggedMatch;
}
return tagged(tag);
}
});
function taggedMatch() {
if (arguments.length === 1) {
const cases = arguments[0];
return function (value) {
return cases[value._tag](value);
};
}
const value = arguments[0];
const cases = arguments[1];
return cases[value._tag](value);
}
/**
* Provides a constructor for a Case Class.
*
* @since 2.0.0
* @category constructors
*/
export const Error = /*#__PURE__*/function () {
const plainArgsSymbol = /*#__PURE__*/Symbol.for("effect/Data/Error/plainArgs");
const O = {
BaseEffectError: class extends core.YieldableError {
constructor(args) {
super(args?.message, args?.cause ? {
cause: args.cause
} : undefined);
if (args) {
Object.assign(this, args);
// @effect-diagnostics-next-line floatingEffect:off
Object.defineProperty(this, plainArgsSymbol, {
value: args,
enumerable: false
});
}
}
toJSON() {
return {
...this[plainArgsSymbol],
...this
};
}
}
};
return O.BaseEffectError;
}();
/**
* @since 2.0.0
* @category constructors
*/
export const TaggedError = tag => {
const O = {
BaseEffectError: class extends Error {
_tag = tag;
}
};
O.BaseEffectError.prototype.name = tag;
return O.BaseEffectError;
};
//# sourceMappingURL=Data.js.map

1
_node_modules/effect/dist/esm/Data.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Data.js","names":["core","internal","StructuralPrototype","Predicate","struct","unsafeStruct","as","Object","setPrototypeOf","tuple","unsafeArray","array","slice","ArrayProto","_case","args","undefined","create","case","tagged","tag","value","_tag","Class","Structural","TaggedClass","Base","taggedEnum","Proxy","get","_target","_receiver","isTagged","taggedMatch","arguments","length","cases","Error","plainArgsSymbol","Symbol","for","O","BaseEffectError","YieldableError","constructor","message","cause","assign","defineProperty","enumerable","toJSON","TaggedError","prototype","name"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zC,MAAMC,eAAe,gBAAGC,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC;EACjE,MAAMC,CAAC,GAAG;IACRC,eAAe,EAAE,cAAc1C,IAAI,CAAC2C,cAAc;MAChDC,YAAY7B,IAAS;QACnB,KAAK,CAACA,IAAI,EAAE8B,OAAO,EAAE9B,IAAI,EAAE+B,KAAK,GAAG;UAAEA,KAAK,EAAE/B,IAAI,CAAC+B;QAAK,CAAE,GAAG9B,SAAS,CAAC;QACrE,IAAID,IAAI,EAAE;UACRR,MAAM,CAACwC,MAAM,CAAC,IAAI,EAAEhC,IAAI,CAAC;UACzB;UACAR,MAAM,CAACyC,cAAc,CAAC,IAAI,EAAEV,eAAe,EAAE;YAAEjB,KAAK,EAAEN,IAAI;YAAEkC,UAAU,EAAE;UAAK,CAAE,CAAC;QAClF;MACF;MACAC,MAAMA,CAAA;QACJ,OAAO;UAAE,GAAI,IAAY,CAACZ,eAAe,CAAC;UAAE,GAAG;QAAI,CAAE;MACvD;;GAEH;EACD,OAAOG,CAAC,CAACC,eAAe;AAC1B,CAAC,CAAC,CAAE;AAEJ;;;;AAIA,OAAO,MAAMS,WAAW,GAAwB/B,GAAQ,IAGW;EACjE,MAAMqB,CAAC,GAAG;IACRC,eAAe,EAAE,cAAcL,KAAS;MAC7Bf,IAAI,GAAGF,GAAG;;GAEtB;EACCqB,CAAC,CAACC,eAAe,CAACU,SAAiB,CAACC,IAAI,GAAGjC,GAAG;EAChD,OAAOqB,CAAC,CAACC,eAAsB;AACjC,CAAC","ignoreList":[]}

1071
_node_modules/effect/dist/esm/DateTime.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/DateTime.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

12
_node_modules/effect/dist/esm/DefaultServices.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import * as internal from "./internal/defaultServices.js";
/**
* @since 2.0.0
* @category constructors
*/
export const liveServices = internal.liveServices;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentServices = internal.currentServices;
//# sourceMappingURL=DefaultServices.js.map

1
_node_modules/effect/dist/esm/DefaultServices.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"DefaultServices.js","names":["internal","liveServices","currentServices"],"sources":["../../src/DefaultServices.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO,KAAKA,QAAQ,MAAM,+BAA+B;AAezD;;;;AAIA,OAAO,MAAMC,YAAY,GAAqCD,QAAQ,CAACC,YAAY;AAEnF;;;;AAIA,OAAO,MAAMC,eAAe,GAAwDF,QAAQ,CAACE,eAAe","ignoreList":[]}

169
_node_modules/effect/dist/esm/Deferred.js generated vendored Normal file
View File

@@ -0,0 +1,169 @@
import * as core from "./internal/core.js";
import * as internal from "./internal/deferred.js";
/**
* @since 2.0.0
* @category symbols
*/
export const DeferredTypeId = internal.DeferredTypeId;
/**
* Creates a new `Deferred`.
*
* @since 2.0.0
* @category constructors
*/
export const make = core.deferredMake;
/**
* Creates a new `Deferred` from the specified `FiberId`.
*
* @since 2.0.0
* @category constructors
*/
export const makeAs = core.deferredMakeAs;
const _await = core.deferredAwait;
export {
/**
* Retrieves the value of the `Deferred`, suspending the fiber running the
* workflow until the result is available.
*
* @since 2.0.0
* @category getters
*/
_await as await };
/**
* Completes the deferred with the result of the specified effect. If the
* deferred has already been completed, the method will produce false.
*
* Note that `Deferred.completeWith` will be much faster, so consider using
* that if you do not need to memoize the result of the specified effect.
*
* @since 2.0.0
* @category utils
*/
export const complete = core.deferredComplete;
/**
* Completes the deferred with the result of the specified effect. If the
* deferred has already been completed, the method will produce false.
*
* @since 2.0.0
* @category utils
*/
export const completeWith = core.deferredCompleteWith;
/**
* Exits the `Deferred` with the specified `Exit` value, which will be
* propagated to all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const done = core.deferredDone;
/**
* Fails the `Deferred` with the specified error, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const fail = core.deferredFail;
/**
* Fails the `Deferred` with the specified error, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const failSync = core.deferredFailSync;
/**
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const failCause = core.deferredFailCause;
/**
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const failCauseSync = core.deferredFailCauseSync;
/**
* Kills the `Deferred` with the specified defect, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const die = core.deferredDie;
/**
* Kills the `Deferred` with the specified defect, which will be propagated to
* all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category utils
*/
export const dieSync = core.deferredDieSync;
/**
* Completes the `Deferred` with interruption. This will interrupt all fibers
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
* calling this method.
*
* @since 2.0.0
* @category utils
*/
export const interrupt = core.deferredInterrupt;
/**
* Completes the `Deferred` with interruption. This will interrupt all fibers
* waiting on the value of the `Deferred` with the specified `FiberId`.
*
* @since 2.0.0
* @category utils
*/
export const interruptWith = core.deferredInterruptWith;
/**
* Returns `true` if this `Deferred` has already been completed with a value or
* an error, `false` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const isDone = core.deferredIsDone;
/**
* Returns a `Some<Effect<A, E, R>>` from the `Deferred` if this `Deferred` has
* already been completed, `None` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const poll = core.deferredPoll;
/**
* Completes the `Deferred` with the specified value.
*
* @since 2.0.0
* @category utils
*/
export const succeed = core.deferredSucceed;
/**
* Completes the `Deferred` with the specified lazily evaluated value.
*
* @since 2.0.0
* @category utils
*/
export const sync = core.deferredSync;
/**
* Unsafely creates a new `Deferred` from the specified `FiberId`.
*
* @since 2.0.0
* @category unsafe
*/
export const unsafeMake = core.deferredUnsafeMake;
/**
* Unsafely exits the `Deferred` with the specified `Exit` value, which will be
* propagated to all fibers waiting on the value of the `Deferred`.
*
* @since 2.0.0
* @category unsafe
*/
export const unsafeDone = core.deferredUnsafeDone;
//# sourceMappingURL=Deferred.js.map

1
_node_modules/effect/dist/esm/Deferred.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Deferred.js","names":["core","internal","DeferredTypeId","make","deferredMake","makeAs","deferredMakeAs","_await","deferredAwait","await","complete","deferredComplete","completeWith","deferredCompleteWith","done","deferredDone","fail","deferredFail","failSync","deferredFailSync","failCause","deferredFailCause","failCauseSync","deferredFailCauseSync","die","deferredDie","dieSync","deferredDieSync","interrupt","deferredInterrupt","interruptWith","deferredInterruptWith","isDone","deferredIsDone","poll","deferredPoll","succeed","deferredSucceed","sync","deferredSync","unsafeMake","deferredUnsafeMake","unsafeDone","deferredUnsafeDone"],"sources":["../../src/Deferred.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO,KAAKA,IAAI,MAAM,oBAAoB;AAC1C,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAMlD;;;;AAIA,OAAO,MAAMC,cAAc,GAAkBD,QAAQ,CAACC,cAAc;AA8DpE;;;;;;AAMA,OAAO,MAAMC,IAAI,GAAsDH,IAAI,CAACI,YAAY;AAExF;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA8EL,IAAI,CAACM,cAAc;AAEpH,MAAMC,MAAM,GAAwDP,IAAI,CAACQ,aAAa;AAEtF;AACE;;;;;;;AAOAD,MAAM,IAAIE,KAAK;AAGjB;;;;;;;;;;AAUA,OAAO,MAAMC,QAAQ,GAuBjBV,IAAI,CAACW,gBAAgB;AAEzB;;;;;;;AAOA,OAAO,MAAMC,YAAY,GAiBrBZ,IAAI,CAACa,oBAAoB;AAE7B;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAiBbd,IAAI,CAACe,YAAY;AAErB;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAiBbhB,IAAI,CAACiB,YAAY;AAErB;;;;;;;AAOA,OAAO,MAAMC,QAAQ,GAiBjBlB,IAAI,CAACmB,gBAAgB;AAEzB;;;;;;;AAOA,OAAO,MAAMC,SAAS,GAiBlBpB,IAAI,CAACqB,iBAAiB;AAE1B;;;;;;;AAOA,OAAO,MAAMC,aAAa,GAiBtBtB,IAAI,CAACuB,qBAAqB;AAE9B;;;;;;;AAOA,OAAO,MAAMC,GAAG,GAiBZxB,IAAI,CAACyB,WAAW;AAEpB;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAiBhB1B,IAAI,CAAC2B,eAAe;AAExB;;;;;;;;AAQA,OAAO,MAAMC,SAAS,GAA2D5B,IAAI,CAAC6B,iBAAiB;AAEvG;;;;;;;AAOA,OAAO,MAAMC,aAAa,GAiBtB9B,IAAI,CAAC+B,qBAAqB;AAE9B;;;;;;;AAOA,OAAO,MAAMC,MAAM,GAA2DhC,IAAI,CAACiC,cAAc;AAEjG;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAEwClC,IAAI,CAACmC,YAAY;AAE1E;;;;;;AAMA,OAAO,MAAMC,OAAO,GAehBpC,IAAI,CAACqC,eAAe;AAExB;;;;;;AAMA,OAAO,MAAMC,IAAI,GAebtC,IAAI,CAACuC,YAAY;AAErB;;;;;;AAMA,OAAO,MAAMC,UAAU,GAA+DxC,IAAI,CAACyC,kBAAkB;AAE7G;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsE1C,IAAI,CAAC2C,kBAAkB","ignoreList":[]}

132
_node_modules/effect/dist/esm/Differ.js generated vendored Normal file
View File

@@ -0,0 +1,132 @@
import * as Dual from "./Function.js";
import * as internal from "./internal/differ.js";
import * as ChunkPatch from "./internal/differ/chunkPatch.js";
import * as ContextPatch from "./internal/differ/contextPatch.js";
import * as HashMapPatch from "./internal/differ/hashMapPatch.js";
import * as HashSetPatch from "./internal/differ/hashSetPatch.js";
import * as OrPatch from "./internal/differ/orPatch.js";
import * as ReadonlyArrayPatch from "./internal/differ/readonlyArrayPatch.js";
/**
* @since 2.0.0
* @category symbol
*/
export const TypeId = internal.DifferTypeId;
const ChunkPatchTypeId = ChunkPatch.ChunkPatchTypeId;
const ContextPatchTypeId = ContextPatch.ContextPatchTypeId;
const HashMapPatchTypeId = HashMapPatch.HashMapPatchTypeId;
const HashSetPatchTypeId = HashSetPatch.HashSetPatchTypeId;
const OrPatchTypeId = OrPatch.OrPatchTypeId;
const ReadonlyArrayPatchTypeId = ReadonlyArrayPatch.ReadonlyArrayPatchTypeId;
/**
* An empty patch that describes no changes.
*
* @since 2.0.0
* @category patch
*/
export const empty = self => self.empty;
/**
* @since 2.0.0
* @category patch
*/
export const diff = /*#__PURE__*/Dual.dual(3, (self, oldValue, newValue) => self.diff(oldValue, newValue));
/**
* Combines two patches to produce a new patch that describes the updates of
* the first patch and then the updates of the second patch. The combine
* operation should be associative. In addition, if the combine operation is
* commutative then joining multiple fibers concurrently will result in
* deterministic `FiberRef` values.
*
* @since 2.0.0
* @category patch
*/
export const combine = /*#__PURE__*/Dual.dual(3, (self, first, second) => self.combine(first, second));
/**
* Applies a patch to an old value to produce a new value that is equal to the
* old value with the updates described by the patch.
*
* @since 2.0.0
* @category patch
*/
export const patch = /*#__PURE__*/Dual.dual(3, (self, patch, oldValue) => self.patch(patch, oldValue));
/**
* Constructs a new `Differ`.
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* Constructs a differ that knows how to diff `Env` values.
*
* @since 2.0.0
* @category constructors
*/
export const environment = internal.environment;
/**
* Constructs a differ that knows how to diff a `Chunk` of values given a
* differ that knows how to diff the values.
*
* @since 2.0.0
* @category constructors
*/
export const chunk = internal.chunk;
/**
* Constructs a differ that knows how to diff a `HashMap` of keys and values given
* a differ that knows how to diff the values.
*
* @since 2.0.0
* @category constructors
*/
export const hashMap = internal.hashMap;
/**
* Constructs a differ that knows how to diff a `HashSet` of values.
*
* @since 2.0.0
* @category constructors
*/
export const hashSet = internal.hashSet;
/**
* Combines this differ and the specified differ to produce a differ that
* knows how to diff the sum of their values.
*
* @since 2.0.0
*/
export const orElseEither = internal.orElseEither;
/**
* Constructs a differ that knows how to diff a `ReadonlyArray` of values.
*
* @since 2.0.0
* @category constructors
*/
export const readonlyArray = internal.readonlyArray;
/**
* Transforms the type of values that this differ knows how to differ using
* the specified functions that map the new and old value types to each other.
*
* @since 2.0.0
*/
export const transform = internal.transform;
/**
* Constructs a differ that just diffs two values by returning a function that
* sets the value to the new value. This differ does not support combining
* multiple updates to the value compositionally and should only be used when
* there is no compositional way to update them.
*
* @since 2.0.0
*/
export const update = internal.update;
/**
* A variant of `update` that allows specifying the function that will be used
* to combine old values with new values.
*
* @since 2.0.0
*/
export const updateWith = internal.updateWith;
/**
* Combines this differ and the specified differ to produce a new differ that
* knows how to diff the product of their values.
*
* @since 2.0.0
*/
export const zip = internal.zip;
//# sourceMappingURL=Differ.js.map

1
_node_modules/effect/dist/esm/Differ.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Differ.js","names":["Dual","internal","ChunkPatch","ContextPatch","HashMapPatch","HashSetPatch","OrPatch","ReadonlyArrayPatch","TypeId","DifferTypeId","ChunkPatchTypeId","ContextPatchTypeId","HashMapPatchTypeId","HashSetPatchTypeId","OrPatchTypeId","ReadonlyArrayPatchTypeId","empty","self","diff","dual","oldValue","newValue","combine","first","second","patch","make","environment","chunk","hashMap","hashSet","orElseEither","readonlyArray","transform","update","updateWith","zip"],"sources":["../../src/Differ.ts"],"sourcesContent":[null],"mappings":"AAOA,OAAO,KAAKA,IAAI,MAAM,eAAe;AAGrC,OAAO,KAAKC,QAAQ,MAAM,sBAAsB;AAChD,OAAO,KAAKC,UAAU,MAAM,iCAAiC;AAC7D,OAAO,KAAKC,YAAY,MAAM,mCAAmC;AACjE,OAAO,KAAKC,YAAY,MAAM,mCAAmC;AACjE,OAAO,KAAKC,YAAY,MAAM,mCAAmC;AACjE,OAAO,KAAKC,OAAO,MAAM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AAMC,KAAK,GAE4C3B,QAAQ,CAAC2B,KAAK;AAE5E;;;;;;;AAOA,OAAO,MAAMC,OAAO,GAEwD5B,QAAQ,CAAC4B,OAAO;AAE5F;;;;;;AAMA,OAAO,MAAMC,OAAO,GAGhB7B,QAAQ,CAAC6B,OAAO;AAEpB;;;;;;AAMA,OAAO,MAAMC,YAAY,GAuBrB9B,QAAQ,CAAC8B,YAAY;AAEzB;;;;;;AAMA,OAAO,MAAMC,aAAa,GAEoD/B,QAAQ,CAAC+B,aAAa;AAEpG;;;;;;AAMA,OAAO,MAAMC,SAAS,GA0BlBhC,QAAQ,CAACgC,SAAS;AAEtB;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAAoCjC,QAAQ,CAACiC,MAAM;AAEtE;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAwDlC,QAAQ,CAACkC,UAAU;AAElG;;;;;;AAMA,OAAO,MAAMC,GAAG,GAuBZnC,QAAQ,CAACmC,GAAG","ignoreList":[]}

702
_node_modules/effect/dist/esm/Duration.js generated vendored Normal file
View File

@@ -0,0 +1,702 @@
/**
* @since 2.0.0
*/
import * as Equal from "./Equal.js";
import { dual } from "./Function.js";
import * as Hash from "./Hash.js";
import { NodeInspectSymbol } from "./Inspectable.js";
import * as Option from "./Option.js";
import * as order from "./Order.js";
import { pipeArguments } from "./Pipeable.js";
import { hasProperty, isBigInt, isNumber, isString } from "./Predicate.js";
const TypeId = /*#__PURE__*/Symbol.for("effect/Duration");
const bigint0 = /*#__PURE__*/BigInt(0);
const bigint24 = /*#__PURE__*/BigInt(24);
const bigint60 = /*#__PURE__*/BigInt(60);
const bigint1e3 = /*#__PURE__*/BigInt(1_000);
const bigint1e6 = /*#__PURE__*/BigInt(1_000_000);
const bigint1e9 = /*#__PURE__*/BigInt(1_000_000_000);
const DURATION_REGEX = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
/**
* @since 2.0.0
*/
export const decode = input => {
if (isDuration(input)) {
return input;
} else if (isNumber(input)) {
return millis(input);
} else if (isBigInt(input)) {
return nanos(input);
} else if (Array.isArray(input) && input.length === 2 && input.every(isNumber)) {
if (input[0] === -Infinity || input[1] === -Infinity || Number.isNaN(input[0]) || Number.isNaN(input[1])) {
return zero;
}
if (input[0] === Infinity || input[1] === Infinity) {
return infinity;
}
return nanos(BigInt(Math.round(input[0] * 1_000_000_000)) + BigInt(Math.round(input[1])));
} else if (isString(input)) {
const match = DURATION_REGEX.exec(input);
if (match) {
const [_, valueStr, unit] = match;
const value = Number(valueStr);
switch (unit) {
case "nano":
case "nanos":
return nanos(BigInt(valueStr));
case "micro":
case "micros":
return micros(BigInt(valueStr));
case "milli":
case "millis":
return millis(value);
case "second":
case "seconds":
return seconds(value);
case "minute":
case "minutes":
return minutes(value);
case "hour":
case "hours":
return hours(value);
case "day":
case "days":
return days(value);
case "week":
case "weeks":
return weeks(value);
}
}
}
throw new Error("Invalid DurationInput");
};
/**
* @since 2.5.0
*/
export const decodeUnknown = /*#__PURE__*/Option.liftThrowable(decode);
const zeroValue = {
_tag: "Millis",
millis: 0
};
const infinityValue = {
_tag: "Infinity"
};
const DurationProto = {
[TypeId]: TypeId,
[Hash.symbol]() {
return Hash.cached(this, Hash.structure(this.value));
},
[Equal.symbol](that) {
return isDuration(that) && equals(this, that);
},
toString() {
return `Duration(${format(this)})`;
},
toJSON() {
switch (this.value._tag) {
case "Millis":
return {
_id: "Duration",
_tag: "Millis",
millis: this.value.millis
};
case "Nanos":
return {
_id: "Duration",
_tag: "Nanos",
hrtime: toHrTime(this)
};
case "Infinity":
return {
_id: "Duration",
_tag: "Infinity"
};
}
},
[NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
const make = input => {
const duration = Object.create(DurationProto);
if (isNumber(input)) {
if (isNaN(input) || input <= 0) {
duration.value = zeroValue;
} else if (!Number.isFinite(input)) {
duration.value = infinityValue;
} else if (!Number.isInteger(input)) {
duration.value = {
_tag: "Nanos",
nanos: BigInt(Math.round(input * 1_000_000))
};
} else {
duration.value = {
_tag: "Millis",
millis: input
};
}
} else if (input <= bigint0) {
duration.value = zeroValue;
} else {
duration.value = {
_tag: "Nanos",
nanos: input
};
}
return duration;
};
/**
* @since 2.0.0
* @category guards
*/
export const isDuration = u => hasProperty(u, TypeId);
/**
* @since 2.0.0
* @category guards
*/
export const isFinite = self => self.value._tag !== "Infinity";
/**
* @since 3.5.0
* @category guards
*/
export const isZero = self => {
switch (self.value._tag) {
case "Millis":
{
return self.value.millis === 0;
}
case "Nanos":
{
return self.value.nanos === bigint0;
}
case "Infinity":
{
return false;
}
}
};
/**
* @since 2.0.0
* @category constructors
*/
export const zero = /*#__PURE__*/make(0);
/**
* @since 2.0.0
* @category constructors
*/
export const infinity = /*#__PURE__*/make(Infinity);
/**
* @since 2.0.0
* @category constructors
*/
export const nanos = nanos => make(nanos);
/**
* @since 2.0.0
* @category constructors
*/
export const micros = micros => make(micros * bigint1e3);
/**
* @since 2.0.0
* @category constructors
*/
export const millis = millis => make(millis);
/**
* @since 2.0.0
* @category constructors
*/
export const seconds = seconds => make(seconds * 1000);
/**
* @since 2.0.0
* @category constructors
*/
export const minutes = minutes => make(minutes * 60_000);
/**
* @since 2.0.0
* @category constructors
*/
export const hours = hours => make(hours * 3_600_000);
/**
* @since 2.0.0
* @category constructors
*/
export const days = days => make(days * 86_400_000);
/**
* @since 2.0.0
* @category constructors
*/
export const weeks = weeks => make(weeks * 604_800_000);
/**
* @since 2.0.0
* @category getters
*/
export const toMillis = self => match(self, {
onMillis: millis => millis,
onNanos: nanos => Number(nanos) / 1_000_000
});
/**
* @since 2.0.0
* @category getters
*/
export const toSeconds = self => match(self, {
onMillis: millis => millis / 1_000,
onNanos: nanos => Number(nanos) / 1_000_000_000
});
/**
* @since 3.8.0
* @category getters
*/
export const toMinutes = self => match(self, {
onMillis: millis => millis / 60_000,
onNanos: nanos => Number(nanos) / 60_000_000_000
});
/**
* @since 3.8.0
* @category getters
*/
export const toHours = self => match(self, {
onMillis: millis => millis / 3_600_000,
onNanos: nanos => Number(nanos) / 3_600_000_000_000
});
/**
* @since 3.8.0
* @category getters
*/
export const toDays = self => match(self, {
onMillis: millis => millis / 86_400_000,
onNanos: nanos => Number(nanos) / 86_400_000_000_000
});
/**
* @since 3.8.0
* @category getters
*/
export const toWeeks = self => match(self, {
onMillis: millis => millis / 604_800_000,
onNanos: nanos => Number(nanos) / 604_800_000_000_000
});
/**
* Get the duration in nanoseconds as a bigint.
*
* If the duration is infinite, returns `Option.none()`
*
* @since 2.0.0
* @category getters
*/
export const toNanos = self => {
const _self = decode(self);
switch (_self.value._tag) {
case "Infinity":
return Option.none();
case "Nanos":
return Option.some(_self.value.nanos);
case "Millis":
return Option.some(BigInt(Math.round(_self.value.millis * 1_000_000)));
}
};
/**
* Get the duration in nanoseconds as a bigint.
*
* If the duration is infinite, it throws an error.
*
* @since 2.0.0
* @category getters
*/
export const unsafeToNanos = self => {
const _self = decode(self);
switch (_self.value._tag) {
case "Infinity":
throw new Error("Cannot convert infinite duration to nanos");
case "Nanos":
return _self.value.nanos;
case "Millis":
return BigInt(Math.round(_self.value.millis * 1_000_000));
}
};
/**
* @since 2.0.0
* @category getters
*/
export const toHrTime = self => {
const _self = decode(self);
switch (_self.value._tag) {
case "Infinity":
return [Infinity, 0];
case "Nanos":
return [Number(_self.value.nanos / bigint1e9), Number(_self.value.nanos % bigint1e9)];
case "Millis":
return [Math.floor(_self.value.millis / 1000), Math.round(_self.value.millis % 1000 * 1_000_000)];
}
};
/**
* @since 2.0.0
* @category pattern matching
*/
export const match = /*#__PURE__*/dual(2, (self, options) => {
const _self = decode(self);
switch (_self.value._tag) {
case "Nanos":
return options.onNanos(_self.value.nanos);
case "Infinity":
return options.onMillis(Infinity);
case "Millis":
return options.onMillis(_self.value.millis);
}
});
/**
* @since 2.0.0
* @category pattern matching
*/
export const matchWith = /*#__PURE__*/dual(3, (self, that, options) => {
const _self = decode(self);
const _that = decode(that);
if (_self.value._tag === "Infinity" || _that.value._tag === "Infinity") {
return options.onMillis(toMillis(_self), toMillis(_that));
} else if (_self.value._tag === "Nanos" || _that.value._tag === "Nanos") {
const selfNanos = _self.value._tag === "Nanos" ? _self.value.nanos : BigInt(Math.round(_self.value.millis * 1_000_000));
const thatNanos = _that.value._tag === "Nanos" ? _that.value.nanos : BigInt(Math.round(_that.value.millis * 1_000_000));
return options.onNanos(selfNanos, thatNanos);
}
return options.onMillis(_self.value.millis, _that.value.millis);
});
/**
* @category instances
* @since 2.0.0
*/
export const Order = /*#__PURE__*/order.make((self, that) => matchWith(self, that, {
onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0
}));
/**
* Checks if a `Duration` is between a `minimum` and `maximum` value.
*
* @category predicates
* @since 2.0.0
*/
export const between = /*#__PURE__*/order.between(/*#__PURE__*/order.mapInput(Order, decode));
/**
* @category instances
* @since 2.0.0
*/
export const Equivalence = (self, that) => matchWith(self, that, {
onMillis: (self, that) => self === that,
onNanos: (self, that) => self === that
});
const _min = /*#__PURE__*/order.min(Order);
/**
* @since 2.0.0
*/
export const min = /*#__PURE__*/dual(2, (self, that) => _min(decode(self), decode(that)));
const _max = /*#__PURE__*/order.max(Order);
/**
* @since 2.0.0
* @category order
*/
export const max = /*#__PURE__*/dual(2, (self, that) => _max(decode(self), decode(that)));
const _clamp = /*#__PURE__*/order.clamp(Order);
/**
* @since 2.0.0
* @category order
*/
export const clamp = /*#__PURE__*/dual(2, (self, options) => _clamp(decode(self), {
minimum: decode(options.minimum),
maximum: decode(options.maximum)
}));
/**
* @since 2.4.19
* @category math
*/
export const divide = /*#__PURE__*/dual(2, (self, by) => match(self, {
onMillis: millis => {
if (by === 0 || isNaN(by) || !Number.isFinite(by)) {
return Option.none();
}
return Option.some(make(millis / by));
},
onNanos: nanos => {
if (isNaN(by) || by <= 0 || !Number.isFinite(by)) {
return Option.none();
}
try {
return Option.some(make(nanos / BigInt(by)));
} catch {
return Option.none();
}
}
}));
/**
* @since 2.4.19
* @category math
*/
export const unsafeDivide = /*#__PURE__*/dual(2, (self, by) => match(self, {
onMillis: millis => make(millis / by),
onNanos: nanos => {
if (isNaN(by) || by < 0 || Object.is(by, -0)) {
return zero;
} else if (Object.is(by, 0) || !Number.isFinite(by)) {
return infinity;
}
return make(nanos / BigInt(by));
}
}));
/**
* @since 2.0.0
* @category math
*/
export const times = /*#__PURE__*/dual(2, (self, times) => match(self, {
onMillis: millis => make(millis * times),
onNanos: nanos => make(nanos * BigInt(times))
}));
/**
* @since 2.0.0
* @category math
*/
export const subtract = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => make(self - that),
onNanos: (self, that) => make(self - that)
}));
/**
* @since 2.0.0
* @category math
*/
export const sum = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => make(self + that),
onNanos: (self, that) => make(self + that)
}));
/**
* @since 2.0.0
* @category predicates
*/
export const lessThan = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => self < that,
onNanos: (self, that) => self < that
}));
/**
* @since 2.0.0
* @category predicates
*/
export const lessThanOrEqualTo = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => self <= that,
onNanos: (self, that) => self <= that
}));
/**
* @since 2.0.0
* @category predicates
*/
export const greaterThan = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => self > that,
onNanos: (self, that) => self > that
}));
/**
* @since 2.0.0
* @category predicates
*/
export const greaterThanOrEqualTo = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {
onMillis: (self, that) => self >= that,
onNanos: (self, that) => self >= that
}));
/**
* @since 2.0.0
* @category predicates
*/
export const equals = /*#__PURE__*/dual(2, (self, that) => Equivalence(decode(self), decode(that)));
/**
* Converts a `Duration` to its parts.
*
* @since 3.8.0
* @category conversions
*/
export const parts = self => {
const duration = decode(self);
if (duration.value._tag === "Infinity") {
return {
days: Infinity,
hours: Infinity,
minutes: Infinity,
seconds: Infinity,
millis: Infinity,
nanos: Infinity
};
}
const nanos = unsafeToNanos(duration);
const ms = nanos / bigint1e6;
const sec = ms / bigint1e3;
const min = sec / bigint60;
const hr = min / bigint60;
const days = hr / bigint24;
return {
days: Number(days),
hours: Number(hr % bigint24),
minutes: Number(min % bigint60),
seconds: Number(sec % bigint60),
millis: Number(ms % bigint1e3),
nanos: Number(nanos % bigint1e6)
};
};
/**
* Converts a `Duration` to a human readable string.
*
* @since 2.0.0
* @category conversions
* @example
* ```ts
* import { Duration } from "effect"
*
* Duration.format(Duration.millis(1000)) // "1s"
* Duration.format(Duration.millis(1001)) // "1s 1ms"
* ```
*/
export const format = self => {
const duration = decode(self);
if (duration.value._tag === "Infinity") {
return "Infinity";
}
if (isZero(duration)) {
return "0";
}
const fragments = parts(duration);
const pieces = [];
if (fragments.days !== 0) {
pieces.push(`${fragments.days}d`);
}
if (fragments.hours !== 0) {
pieces.push(`${fragments.hours}h`);
}
if (fragments.minutes !== 0) {
pieces.push(`${fragments.minutes}m`);
}
if (fragments.seconds !== 0) {
pieces.push(`${fragments.seconds}s`);
}
if (fragments.millis !== 0) {
pieces.push(`${fragments.millis}ms`);
}
if (fragments.nanos !== 0) {
pieces.push(`${fragments.nanos}ns`);
}
return pieces.join(" ");
};
/**
* Formats a Duration into an ISO8601 duration string.
*
* Months are assumed to be 30 days and years are assumed to be 365 days.
*
* Milliseconds and nanoseconds are expressed as fractional seconds.
*
* @example
* ```ts
* import { Duration } from "effect"
*
* Duration.unsafeFormatIso(Duration.days(1)) // => "P1D"
* Duration.unsafeFormatIso(Duration.minutes(90)) // => "PT1H30M"
* Duration.unsafeFormatIso(Duration.millis(1500)) // => "PT1.5S"
* ```
*
* @throws `RangeError` If the duration is not finite.
*
* @since 3.13.0
* @category conversions
*/
export const unsafeFormatIso = self => {
const duration = decode(self);
if (!isFinite(duration)) {
throw new RangeError("Cannot format infinite duration");
}
const fragments = [];
const {
days,
hours,
millis,
minutes,
nanos,
seconds
} = parts(duration);
let rest = days;
if (rest >= 365) {
const years = Math.floor(rest / 365);
rest %= 365;
fragments.push(`${years}Y`);
}
if (rest >= 30) {
const months = Math.floor(rest / 30);
rest %= 30;
fragments.push(`${months}M`);
}
if (rest >= 7) {
const weeks = Math.floor(rest / 7);
rest %= 7;
fragments.push(`${weeks}W`);
}
if (rest > 0) {
fragments.push(`${rest}D`);
}
if (hours !== 0 || minutes !== 0 || seconds !== 0 || millis !== 0 || nanos !== 0) {
fragments.push("T");
if (hours !== 0) {
fragments.push(`${hours}H`);
}
if (minutes !== 0) {
fragments.push(`${minutes}M`);
}
if (seconds !== 0 || millis !== 0 || nanos !== 0) {
const total = BigInt(seconds) * bigint1e9 + BigInt(millis) * bigint1e6 + BigInt(nanos);
const str = (Number(total) / 1e9).toFixed(9).replace(/\.?0+$/, "");
fragments.push(`${str}S`);
}
}
return `P${fragments.join("") || "T0S"}`;
};
/**
* Formats a Duration into an ISO8601 duration string.
*
* Months are assumed to be 30 days and years are assumed to be 365 days.
*
* Returns `Option.none()` if the duration is infinite.
*
* @example
* ```ts
* import { Duration, Option } from "effect"
*
* Duration.formatIso(Duration.days(1)) // => Option.some("P1D")
* Duration.formatIso(Duration.minutes(90)) // => Option.some("PT1H30M")
* Duration.formatIso(Duration.millis(1500)) // => Option.some("PT1.5S")
* Duration.formatIso(Duration.infinity) // => Option.none()
* ```
*
* @since 3.13.0
* @category conversions
*/
export const formatIso = self => {
const duration = decode(self);
return isFinite(duration) ? Option.some(unsafeFormatIso(duration)) : Option.none();
};
/**
* Parses an ISO8601 duration string into a `Duration`.
*
* Months are assumed to be 30 days and years are assumed to be 365 days.
*
* @example
* ```ts
* import { Duration, Option } from "effect"
*
* Duration.fromIso("P1D") // => Option.some(Duration.days(1))
* Duration.fromIso("PT1H") // => Option.some(Duration.hours(1))
* Duration.fromIso("PT1M") // => Option.some(Duration.minutes(1))
* Duration.fromIso("PT1.5S") // => Option.some(Duration.seconds(1.5))
* ```
*
* @since 3.13.0
* @category conversions
*/
export const fromIso = iso => {
const result = DURATION_ISO_REGEX.exec(iso);
if (result == null) {
return Option.none();
}
const [years, months, weeks, days, hours, mins, secs] = result.slice(1, 8).map(_ => _ ? Number(_) : 0);
const value = years * 365 * 24 * 60 * 60 + months * 30 * 24 * 60 * 60 + weeks * 7 * 24 * 60 * 60 + days * 24 * 60 * 60 + hours * 60 * 60 + mins * 60 + secs;
return Option.some(seconds(value));
};
const DURATION_ISO_REGEX = /^P(?!$)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?!$)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
//# sourceMappingURL=Duration.js.map

1
_node_modules/effect/dist/esm/Duration.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

10883
_node_modules/effect/dist/esm/Effect.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/Effect.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

49
_node_modules/effect/dist/esm/Effectable.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
import * as internal from "./internal/effectable.js";
/**
* @since 2.0.0
* @category type ids
*/
export const EffectTypeId = internal.EffectTypeId;
/**
* @since 2.0.0
* @category type ids
*/
export const StreamTypeId = internal.StreamTypeId;
/**
* @since 2.0.0
* @category type ids
*/
export const SinkTypeId = internal.SinkTypeId;
/**
* @since 2.0.0
* @category type ids
*/
export const ChannelTypeId = internal.ChannelTypeId;
/**
* @since 2.0.0
* @category prototypes
*/
export const EffectPrototype = internal.EffectPrototype;
/**
* @since 2.0.0
* @category prototypes
*/
export const CommitPrototype = internal.CommitPrototype;
/**
* @since 2.0.0
* @category prototypes
*/
export const StructuralCommitPrototype = internal.StructuralCommitPrototype;
const Base = internal.Base;
const StructuralBase = internal.StructuralBase;
/**
* @since 2.0.0
* @category constructors
*/
export class Class extends Base {}
/**
* @since 2.0.0
* @category constructors
*/
export class StructuralClass extends StructuralBase {}
//# sourceMappingURL=Effectable.js.map

1
_node_modules/effect/dist/esm/Effectable.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Effectable.js","names":["internal","EffectTypeId","StreamTypeId","SinkTypeId","ChannelTypeId","EffectPrototype","CommitPrototype","StructuralCommitPrototype","Base","StructuralBase","Class","StructuralClass"],"sources":["../../src/Effectable.ts"],"sourcesContent":[null],"mappings":"AAKA,OAAO,KAAKA,QAAQ,MAAM,0BAA0B;AAIpD;;;;AAIA,OAAO,MAAMC,YAAY,GAAwBD,QAAQ,CAACC,YAAY;AAQtE;;;;AAIA,OAAO,MAAMC,YAAY,GAAwBF,QAAQ,CAACE,YAAY;AAQtE;;;;AAIA,OAAO,MAAMC,UAAU,GAAoBH,QAAQ,CAACG,UAAU;AAQ9D;;;;AAIA,OAAO,MAAMC,aAAa,GAA0BJ,QAAQ,CAACI,aAAa;AAgB1E;;;;AAIA,OAAO,MAAMC,eAAe,GAAyBL,QAAQ,CAACK,eAAe;AAE7E;;;;AAIA,OAAO,MAAMC,eAAe,GAAyBN,QAAQ,CAACM,eAAe;AAE7E;;;;AAIA,OAAO,MAAMC,yBAAyB,GAAyBP,QAAQ,CAACO,yBAAyB;AAEjG,MAAMC,IAAI,GAAoBR,QAAQ,CAACQ,IAAI;AAC3C,MAAMC,cAAc,GAAoBT,QAAQ,CAACS,cAAc;AAE/D;;;;AAIA,OAAM,MAAgBC,KAA+B,SAAQF,IAAa;AAO1E;;;;AAIA,OAAM,MAAgBG,eAAyC,SAAQF,cAAuB","ignoreList":[]}

688
_node_modules/effect/dist/esm/Either.js generated vendored Normal file
View File

@@ -0,0 +1,688 @@
/**
* @since 2.0.0
*/
import * as Equivalence from "./Equivalence.js";
import { constNull, constUndefined, dual, identity } from "./Function.js";
import * as doNotation from "./internal/doNotation.js";
import * as either from "./internal/either.js";
import * as option_ from "./internal/option.js";
import { isFunction } from "./Predicate.js";
import * as Gen from "./Utils.js";
/**
* @category symbols
* @since 2.0.0
*/
export const TypeId = either.TypeId;
/**
* Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias
* of this structure.
*
* @category constructors
* @since 2.0.0
*/
export const right = either.right;
const void_ = /*#__PURE__*/right(void 0);
export {
/**
* @category constructors
* @since 3.13.0
*/
void_ as void };
/**
* Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this
* structure.
*
* @category constructors
* @since 2.0.0
*/
export const left = either.left;
/**
* Takes a lazy default and a nullable value, if the value is not nully (`null` or `undefined`), turn it into a `Right`, if the value is nully use
* the provided default as a `Left`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.fromNullable(1, () => 'fallback'), Either.right(1))
* assert.deepStrictEqual(Either.fromNullable(null, () => 'fallback'), Either.left('fallback'))
* ```
*
* @category constructors
* @since 2.0.0
*/
export const fromNullable = /*#__PURE__*/dual(2, (self, onNullable) => self == null ? left(onNullable(self)) : right(self));
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, Option } from "effect"
*
* assert.deepStrictEqual(Either.fromOption(Option.some(1), () => 'error'), Either.right(1))
* assert.deepStrictEqual(Either.fromOption(Option.none(), () => 'error'), Either.left('error'))
* ```
*
* @category constructors
* @since 2.0.0
*/
export const fromOption = either.fromOption;
const try_ = evaluate => {
if (isFunction(evaluate)) {
try {
return right(evaluate());
} catch (e) {
return left(e);
}
} else {
try {
return right(evaluate.try());
} catch (e) {
return left(evaluate.catch(e));
}
}
};
export {
/**
* Imports a synchronous side-effect into a pure `Either` value, translating any
* thrown exceptions into typed failed eithers creating with `Either.left`.
*
* @category constructors
* @since 2.0.0
*/
try_ as try };
/**
* Tests if a value is a `Either`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.isEither(Either.right(1)), true)
* assert.deepStrictEqual(Either.isEither(Either.left("a")), true)
* assert.deepStrictEqual(Either.isEither({ right: 1 }), false)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isEither = either.isEither;
/**
* Determine if a `Either` is a `Left`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.isLeft(Either.right(1)), false)
* assert.deepStrictEqual(Either.isLeft(Either.left("a")), true)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isLeft = either.isLeft;
/**
* Determine if a `Either` is a `Right`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.isRight(Either.right(1)), true)
* assert.deepStrictEqual(Either.isRight(Either.left("a")), false)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isRight = either.isRight;
/**
* Converts a `Either` to an `Option` discarding the `Left`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, Option } from "effect"
*
* assert.deepStrictEqual(Either.getRight(Either.right('ok')), Option.some('ok'))
* assert.deepStrictEqual(Either.getRight(Either.left('err')), Option.none())
* ```
*
* @category getters
* @since 2.0.0
*/
export const getRight = either.getRight;
/**
* Converts a `Either` to an `Option` discarding the value.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, Option } from "effect"
*
* assert.deepStrictEqual(Either.getLeft(Either.right('ok')), Option.none())
* assert.deepStrictEqual(Either.getLeft(Either.left('err')), Option.some('err'))
* ```
*
* @category getters
* @since 2.0.0
*/
export const getLeft = either.getLeft;
/**
* @category equivalence
* @since 2.0.0
*/
export const getEquivalence = ({
left,
right
}) => Equivalence.make((x, y) => isLeft(x) ? isLeft(y) && left(x.left, y.left) : isRight(y) && right(x.right, y.right));
/**
* @category mapping
* @since 2.0.0
*/
export const mapBoth = /*#__PURE__*/dual(2, (self, {
onLeft,
onRight
}) => isLeft(self) ? left(onLeft(self.left)) : right(onRight(self.right)));
/**
* Maps the `Left` side of an `Either` value to a new `Either` value.
*
* @category mapping
* @since 2.0.0
*/
export const mapLeft = /*#__PURE__*/dual(2, (self, f) => isLeft(self) ? left(f(self.left)) : right(self.right));
/**
* Maps the `Right` side of an `Either` value to a new `Either` value.
*
* @category mapping
* @since 2.0.0
*/
export const map = /*#__PURE__*/dual(2, (self, f) => isRight(self) ? right(f(self.right)) : left(self.left));
/**
* Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the `onLeft function,
* if the value is a `Right` the inner value is applied to the `onRight` function.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, Either } from "effect"
*
* const onLeft = (strings: ReadonlyArray<string>): string => `strings: ${strings.join(', ')}`
*
* const onRight = (value: number): string => `Ok: ${value}`
*
* assert.deepStrictEqual(pipe(Either.right(1), Either.match({ onLeft, onRight })), 'Ok: 1')
* assert.deepStrictEqual(
* pipe(Either.left(['string 1', 'string 2']), Either.match({ onLeft, onRight })),
* 'strings: string 1, string 2'
* )
* ```
*
* @category pattern matching
* @since 2.0.0
*/
export const match = /*#__PURE__*/dual(2, (self, {
onLeft,
onRight
}) => isLeft(self) ? onLeft(self.left) : onRight(self.right));
/**
* Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`
* or `Left` of the result of the provided function if the predicate returns false
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, Either } from "effect"
*
* const isPositive = (n: number): boolean => n > 0
* const isPositiveEither = Either.liftPredicate(isPositive, n => `${n} is not positive`)
*
* assert.deepStrictEqual(
* isPositiveEither(1),
* Either.right(1)
* )
* assert.deepStrictEqual(
* isPositiveEither(0),
* Either.left("0 is not positive")
* )
* ```
*
* @category lifting
* @since 3.4.0
*/
export const liftPredicate = /*#__PURE__*/dual(3, (a, predicate, orLeftWith) => predicate(a) ? right(a) : left(orLeftWith(a)));
/**
* Filter the right value with the provided function.
* If the predicate fails, set the left value with the result of the provided function.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, Either } from "effect"
*
* const isPositive = (n: number): boolean => n > 0
*
* assert.deepStrictEqual(
* pipe(
* Either.right(1),
* Either.filterOrLeft(isPositive, n => `${n} is not positive`)
* ),
* Either.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* Either.right(0),
* Either.filterOrLeft(isPositive, n => `${n} is not positive`)
* ),
* Either.left("0 is not positive")
* )
* ```
*
* @since 2.0.0
* @category filtering & conditionals
*/
export const filterOrLeft = /*#__PURE__*/dual(3, (self, predicate, orLeftWith) => flatMap(self, r => predicate(r) ? right(r) : left(orLeftWith(r))));
/**
* @category getters
* @since 2.0.0
*/
export const merge = /*#__PURE__*/match({
onLeft: identity,
onRight: identity
});
/**
* Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.getOrElse(Either.right(1), (error) => error + "!"), 1)
* assert.deepStrictEqual(Either.getOrElse(Either.left("not a number"), (error) => error + "!"), "not a number!")
* ```
*
* @category getters
* @since 2.0.0
*/
export const getOrElse = /*#__PURE__*/dual(2, (self, onLeft) => isLeft(self) ? onLeft(self.left) : self.right);
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.getOrNull(Either.right(1)), 1)
* assert.deepStrictEqual(Either.getOrNull(Either.left("a")), null)
* ```
*
* @category getters
* @since 2.0.0
*/
export const getOrNull = /*#__PURE__*/getOrElse(constNull);
/**
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.getOrUndefined(Either.right(1)), 1)
* assert.deepStrictEqual(Either.getOrUndefined(Either.left("a")), undefined)
* ```
*
* @category getters
* @since 2.0.0
*/
export const getOrUndefined = /*#__PURE__*/getOrElse(constUndefined);
/**
* Extracts the value of an `Either` or throws if the `Either` is `Left`.
*
* If a default error is sufficient for your use case and you don't need to configure the thrown error, see {@link getOrThrow}.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(
* Either.getOrThrowWith(Either.right(1), () => new Error('Unexpected Left')),
* 1
* )
* assert.throws(() => Either.getOrThrowWith(Either.left("error"), () => new Error('Unexpected Left')))
* ```
*
* @category getters
* @since 2.0.0
*/
export const getOrThrowWith = /*#__PURE__*/dual(2, (self, onLeft) => {
if (isRight(self)) {
return self.right;
}
throw onLeft(self.left);
});
// TODO(4.0): by default should throw `L` (i.e getOrThrowWith with the identity function)
/**
* Extracts the value of an `Either` or throws if the `Either` is `Left`.
*
* The thrown error is a default error. To configure the error thrown, see {@link getOrThrowWith}.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.getOrThrow(Either.right(1)), 1)
* assert.throws(() => Either.getOrThrow(Either.left("error")))
* ```
*
* @throws `Error("getOrThrow called on a Left")`
*
* @category getters
* @since 2.0.0
*/
export const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error("getOrThrow called on a Left"));
/**
* Returns `self` if it is a `Right` or `that` otherwise.
*
* @category error handling
* @since 2.0.0
*/
export const orElse = /*#__PURE__*/dual(2, (self, that) => isLeft(self) ? that(self.left) : right(self.right));
/**
* @category sequencing
* @since 2.0.0
*/
export const flatMap = /*#__PURE__*/dual(2, (self, f) => isLeft(self) ? left(self.left) : f(self.right));
/**
* Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.
*
* @category sequencing
* @since 2.0.0
*/
export const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {
const b = isFunction(f) ? f(a) : f;
return isEither(b) ? b : right(b);
}));
/**
* @category zipping
* @since 2.0.0
*/
export const zipWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(self, r => map(that, r2 => f(r, r2))));
/**
* @category combining
* @since 2.0.0
*/
export const ap = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));
/**
* Takes a structure of `Either`s and returns an `Either` of values with the same structure.
*
* - If a tuple is supplied, then the returned `Either` will contain a tuple with the same length.
* - If a struct is supplied, then the returned `Either` will contain a struct with the same keys.
* - If an iterable is supplied, then the returned `Either` will contain an array.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either } from "effect"
*
* assert.deepStrictEqual(Either.all([Either.right(1), Either.right(2)]), Either.right([1, 2]))
* assert.deepStrictEqual(Either.all({ right: Either.right(1), b: Either.right("hello") }), Either.right({ right: 1, b: "hello" }))
* assert.deepStrictEqual(Either.all({ right: Either.right(1), b: Either.left("error") }), Either.left("error"))
* ```
*
* @category combining
* @since 2.0.0
*/
// @ts-expect-error
export const all = input => {
if (Symbol.iterator in input) {
const out = [];
for (const e of input) {
if (isLeft(e)) {
return e;
}
out.push(e.right);
}
return right(out);
}
const out = {};
for (const key of Object.keys(input)) {
const e = input[key];
if (isLeft(e)) {
return e;
}
out[key] = e.right;
}
return right(out);
};
/**
* Returns an `Either` that swaps the error/success cases. This allows you to
* use all methods on the error channel, possibly before flipping back.
*
* @since 2.0.0
* @category mapping
*/
export const flip = self => isLeft(self) ? right(self.left) : left(self.right);
const adapter = /*#__PURE__*/Gen.adapter();
/**
* @category generators
* @since 2.0.0
*/
export const gen = (...args) => {
const f = args.length === 1 ? args[0] : args[1].bind(args[0]);
const iterator = f(adapter);
let state = iterator.next();
while (!state.done) {
const current = Gen.isGenKind(state.value) ? state.value.value : Gen.yieldWrapGet(state.value);
if (isLeft(current)) {
return current;
}
state = iterator.next(current.right);
}
return right(state.value);
};
// -------------------------------------------------------------------------------------
// do notation
// -------------------------------------------------------------------------------------
/**
* The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
*
* Here's how the do simulation works:
*
* 1. Start the do simulation using the `Do` value
* 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, pipe } from "effect"
*
* const result = pipe(
* Either.Do,
* Either.bind("x", () => Either.right(2)),
* Either.bind("y", () => Either.right(3)),
* Either.let("sum", ({ x, y }) => x + y)
* )
* assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))
* ```
*
* @see {@link bind}
* @see {@link bindTo}
* @see {@link let_ let}
*
* @category do notation
* @since 2.0.0
*/
export const Do = /*#__PURE__*/right({});
/**
* The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
*
* Here's how the do simulation works:
*
* 1. Start the do simulation using the `Do` value
* 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, pipe } from "effect"
*
* const result = pipe(
* Either.Do,
* Either.bind("x", () => Either.right(2)),
* Either.bind("y", () => Either.right(3)),
* Either.let("sum", ({ x, y }) => x + y)
* )
* assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))
* ```
*
* @see {@link Do}
* @see {@link bindTo}
* @see {@link let_ let}
*
* @category do notation
* @since 2.0.0
*/
export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
/**
* The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
*
* Here's how the do simulation works:
*
* 1. Start the do simulation using the `Do` value
* 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, pipe } from "effect"
*
* const result = pipe(
* Either.Do,
* Either.bind("x", () => Either.right(2)),
* Either.bind("y", () => Either.right(3)),
* Either.let("sum", ({ x, y }) => x + y)
* )
* assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))
* ```
*
* @see {@link Do}
* @see {@link bind}
* @see {@link let_ let}
*
* @category do notation
* @since 2.0.0
*/
export const bindTo = /*#__PURE__*/doNotation.bindTo(map);
const let_ = /*#__PURE__*/doNotation.let_(map);
export {
/**
* The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
*
* Here's how the do simulation works:
*
* 1. Start the do simulation using the `Do` value
* 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values
* 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { Either, pipe } from "effect"
*
* const result = pipe(
* Either.Do,
* Either.bind("x", () => Either.right(2)),
* Either.bind("y", () => Either.right(3)),
* Either.let("sum", ({ x, y }) => x + y)
* )
* assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))
* ```
*
* @see {@link Do}
* @see {@link bindTo}
* @see {@link bind}
*
* @category do notation
* @since 2.0.0
*/
let_ as let };
/**
* Converts an `Option` of an `Either` into an `Either` of an `Option`.
*
* **Details**
*
* This function transforms an `Option<Either<A, E>>` into an
* `Either<Option<A>, E>`. If the `Option` is `None`, the resulting `Either`
* will be a `Right` with a `None` value. If the `Option` is `Some`, the
* inner `Either` will be executed, and its result wrapped in a `Some`.
*
* @example
* ```ts
* import { Effect, Either, Option } from "effect"
*
* // ┌─── Option<Either<number, never>>
* // ▼
* const maybe = Option.some(Either.right(42))
*
* // ┌─── Either<Option<number>, never, never>
* // ▼
* const result = Either.transposeOption(maybe)
*
* console.log(Effect.runSync(result))
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
* ```
*
* @since 3.14.0
* @category Optional Wrapping & Unwrapping
*/
export const transposeOption = self => {
return option_.isNone(self) ? right(option_.none) : map(self.value, option_.some);
};
/**
* Applies an `Either` on an `Option` and transposes the result.
*
* **Details**
*
* If the `Option` is `None`, the resulting `Either` will immediately succeed with a `Right` value of `None`.
* If the `Option` is `Some`, the transformation function will be applied to the inner value, and its result wrapped in a `Some`.
*
* @example
* ```ts
* import { Either, Option, pipe } from "effect"
*
* // ┌─── Either<Option<number>, never>>
* // ▼
* const noneResult = pipe(
* Option.none(),
* Either.transposeMapOption(() => Either.right(42)) // will not be executed
* )
* console.log(noneResult)
* // Output: { _id: 'Either', _tag: 'Right', right: { _id: 'Option', _tag: 'None' } }
*
* // ┌─── Either<Option<number>, never>>
* // ▼
* const someRightResult = pipe(
* Option.some(42),
* Either.transposeMapOption((value) => Either.right(value * 2))
* )
* console.log(someRightResult)
* // Output: { _id: 'Either', _tag: 'Right', right: { _id: 'Option', _tag: 'Some', value: 84 } }
* ```
*
* @since 3.15.0
* @category Optional Wrapping & Unwrapping
*/
export const transposeMapOption = /*#__PURE__*/dual(2, (self, f) => option_.isNone(self) ? right(option_.none) : map(f(self.value), option_.some));
//# sourceMappingURL=Either.js.map

1
_node_modules/effect/dist/esm/Either.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

136
_node_modules/effect/dist/esm/Encoding.js generated vendored Normal file
View File

@@ -0,0 +1,136 @@
/**
* This module provides encoding & decoding functionality for:
*
* - base64 (RFC4648)
* - base64 (URL)
* - hex
*
* @since 2.0.0
*/
import * as Either from "./Either.js";
import * as Base64 from "./internal/encoding/base64.js";
import * as Base64Url from "./internal/encoding/base64Url.js";
import * as Common from "./internal/encoding/common.js";
import * as Hex from "./internal/encoding/hex.js";
/**
* Encodes the given value into a base64 (RFC4648) `string`.
*
* @category encoding
* @since 2.0.0
*/
export const encodeBase64 = input => typeof input === "string" ? Base64.encode(Common.encoder.encode(input)) : Base64.encode(input);
/**
* Decodes a base64 (RFC4648) encoded `string` into a `Uint8Array`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeBase64 = str => Base64.decode(str);
/**
* Decodes a base64 (RFC4648) encoded `string` into a UTF-8 `string`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeBase64String = str => Either.map(decodeBase64(str), _ => Common.decoder.decode(_));
/**
* Encodes the given value into a base64 (URL) `string`.
*
* @category encoding
* @since 2.0.0
*/
export const encodeBase64Url = input => typeof input === "string" ? Base64Url.encode(Common.encoder.encode(input)) : Base64Url.encode(input);
/**
* Decodes a base64 (URL) encoded `string` into a `Uint8Array`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeBase64Url = str => Base64Url.decode(str);
/**
* Decodes a base64 (URL) encoded `string` into a UTF-8 `string`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeBase64UrlString = str => Either.map(decodeBase64Url(str), _ => Common.decoder.decode(_));
/**
* Encodes the given value into a hex `string`.
*
* @category encoding
* @since 2.0.0
*/
export const encodeHex = input => typeof input === "string" ? Hex.encode(Common.encoder.encode(input)) : Hex.encode(input);
/**
* Decodes a hex encoded `string` into a `Uint8Array`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeHex = str => Hex.decode(str);
/**
* Decodes a hex encoded `string` into a UTF-8 `string`.
*
* @category decoding
* @since 2.0.0
*/
export const decodeHexString = str => Either.map(decodeHex(str), _ => Common.decoder.decode(_));
/**
* Encodes a UTF-8 `string` into a URI component `string`.
*
* @category encoding
* @since 3.12.0
*/
export const encodeUriComponent = str => Either.try({
try: () => encodeURIComponent(str),
catch: e => EncodeException(str, e instanceof Error ? e.message : "Invalid input")
});
/**
* Decodes a URI component `string` into a UTF-8 `string`.
*
* @category decoding
* @since 3.12.0
*/
export const decodeUriComponent = str => Either.try({
try: () => decodeURIComponent(str),
catch: e => DecodeException(str, e instanceof Error ? e.message : "Invalid input")
});
/**
* @since 2.0.0
* @category symbols
*/
export const DecodeExceptionTypeId = Common.DecodeExceptionTypeId;
/**
* Creates a checked exception which occurs when decoding fails.
*
* @since 2.0.0
* @category errors
*/
export const DecodeException = Common.DecodeException;
/**
* Returns `true` if the specified value is an `DecodeException`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isDecodeException = Common.isDecodeException;
/**
* @since 3.12.0
* @category symbols
*/
export const EncodeExceptionTypeId = Common.EncodeExceptionTypeId;
/**
* Creates a checked exception which occurs when encoding fails.
*
* @since 3.12.0
* @category errors
*/
export const EncodeException = Common.EncodeException;
/**
* Returns `true` if the specified value is an `EncodeException`, `false` otherwise.
*
* @since 3.12.0
* @category refinements
*/
export const isEncodeException = Common.isEncodeException;
//# sourceMappingURL=Encoding.js.map

1
_node_modules/effect/dist/esm/Encoding.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Encoding.js","names":["Either","Base64","Base64Url","Common","Hex","encodeBase64","input","encode","encoder","decodeBase64","str","decode","decodeBase64String","map","_","decoder","encodeBase64Url","decodeBase64Url","decodeBase64UrlString","encodeHex","decodeHex","decodeHexString","encodeUriComponent","try","encodeURIComponent","catch","e","EncodeException","Error","message","decodeUriComponent","decodeURIComponent","DecodeException","DecodeExceptionTypeId","isDecodeException","EncodeExceptionTypeId","isEncodeException"],"sources":["../../src/Encoding.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,OAAO,KAAKA,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AACvD,OAAO,KAAKC,SAAS,MAAM,kCAAkC;AAC7D,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AACvD,OAAO,KAAKC,GAAG,MAAM,4BAA4B;AAEjD;;;;;;AAMA,OAAO,MAAMC,YAAY,GAA4CC,KAAK,IACxE,OAAOA,KAAK,KAAK,QAAQ,GAAGL,MAAM,CAACM,MAAM,CAACJ,MAAM,CAACK,OAAO,CAACD,MAAM,CAACD,KAAK,CAAC,CAAC,GAAGL,MAAM,CAACM,MAAM,CAACD,KAAK,CAAC;AAEhG;;;;;;AAMA,OAAO,MAAMG,YAAY,GAAIC,GAAW,IAAiDT,MAAM,CAACU,MAAM,CAACD,GAAG,CAAC;AAE3G;;;;;;AAMA,OAAO,MAAME,kBAA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C;EACTA,GAAG,EAAEA,CAAA,KAAMC,kBAAkB,CAACd,GAAG,CAAC;EAClCe,KAAK,EAAGC,CAAC,IAAKC,eAAe,CAACjB,GAAG,EAAEgB,CAAC,YAAYE,KAAK,GAAGF,CAAC,CAACG,OAAO,GAAG,eAAe;CACpF,CAAC;AAEJ;;;;;;AAMA,OAAO,MAAMC,kBAAkB,GAAIpB,GAAW,IAC5CV,MAAM,CAACuB,GAAG,CAAC;EACTA,GAAG,EAAEA,CAAA,KAAMQ,kBAAkB,CAACrB,GAAG,CAAC;EAClCe,KAAK,EAAGC,CAAC,IAAKM,eAAe,CAACtB,GAAG,EAAEgB,CAAC,YAAYE,KAAK,GAAGF,CAAC,CAACG,OAAO,GAAG,eAAe;CACpF,CAAC;AAEJ;;;;AAIA,OAAO,MAAMI,qBAAqB,GAAkB9B,MAAM,CAAC8B,qBAAqB;AAqBhF;;;;;;AAMA,OAAO,MAAMD,eAAe,GAAyD7B,MAAM,CAAC6B,eAAe;AAE3G;;;;;;AAMA,OAAO,MAAME,iBAAiB,GAAyC/B,MAAM,CAAC+B,iBAAiB;AAE/F;;;;AAIA,OAAO,MAAMC,qBAAqB,GAAkBhC,MAAM,CAACgC,qBAAqB;AAqBhF;;;;;;AAMA,OAAO,MAAMR,eAAe,GAAyDxB,MAAM,CAACwB,eAAe;AAE3G;;;;;;AAMA,OAAO,MAAMS,iBAAiB,GAAyCjC,MAAM,CAACiC,iBAAiB","ignoreList":[]}

69
_node_modules/effect/dist/esm/Equal.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import * as Hash from "./Hash.js";
import { hasProperty } from "./Predicate.js";
import { structuralRegionState } from "./Utils.js";
/**
* @since 2.0.0
* @category symbols
*/
export const symbol = /*#__PURE__*/Symbol.for("effect/Equal");
export function equals() {
if (arguments.length === 1) {
return self => compareBoth(self, arguments[0]);
}
return compareBoth(arguments[0], arguments[1]);
}
function compareBoth(self, that) {
if (self === that) {
return true;
}
const selfType = typeof self;
if (selfType !== typeof that) {
return false;
}
if (selfType === "object" || selfType === "function") {
if (self !== null && that !== null) {
if (isEqual(self) && isEqual(that)) {
if (Hash.hash(self) === Hash.hash(that) && self[symbol](that)) {
return true;
} else {
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
} else if (self instanceof Date && that instanceof Date) {
return self.toISOString() === that.toISOString();
} else if (self instanceof URL && that instanceof URL) {
return self.href === that.href;
}
}
if (structuralRegionState.enabled) {
if (Array.isArray(self) && Array.isArray(that)) {
return self.length === that.length && self.every((v, i) => compareBoth(v, that[i]));
}
if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
const keysSelf = Object.keys(self);
const keysThat = Object.keys(that);
if (keysSelf.length === keysThat.length) {
for (const key of keysSelf) {
// @ts-expect-error
if (!(key in that && compareBoth(self[key], that[key]))) {
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
}
return true;
}
}
return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
}
return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
}
/**
* @since 2.0.0
* @category guards
*/
export const isEqual = u => hasProperty(u, symbol);
/**
* @since 2.0.0
* @category instances
*/
export const equivalence = () => equals;
//# sourceMappingURL=Equal.js.map

1
_node_modules/effect/dist/esm/Equal.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Equal.js","names":["Hash","hasProperty","structuralRegionState","symbol","Symbol","for","equals","arguments","length","self","compareBoth","that","selfType","isEqual","hash","enabled","tester","Date","toISOString","URL","href","Array","isArray","every","v","i","Object","getPrototypeOf","prototype","keysSelf","keys","keysThat","key","u","equivalence"],"sources":["../../src/Equal.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,IAAI,MAAM,WAAW;AACjC,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,qBAAqB,QAAQ,YAAY;AAElD;;;;AAIA,OAAO,MAAMC,MAA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;EACF;EAEA,OAAOT,qBAAqB,CAACa,OAAO,IAAIb,qBAAqB,CAACc,MAAM,GAChEd,qBAAqB,CAACc,MAAM,CAACP,IAAI,EAAEE,IAAI,CAAC,GACxC,KAAK;AACX;AAEA;;;;AAIA,OAAO,MAAME,OAAO,GAAIoB,CAAU,IAAiBhC,WAAW,CAACgC,CAAC,EAAE9B,MAAM,CAAC;AAEzE;;;;AAIA,OAAO,MAAM+B,WAAW,GAA4BA,CAAA,KAAM5B,MAAM","ignoreList":[]}

166
_node_modules/effect/dist/esm/Equivalence.js generated vendored Normal file
View File

@@ -0,0 +1,166 @@
/**
* This module provides an implementation of the `Equivalence` type class, which defines a binary relation
* that is reflexive, symmetric, and transitive. In other words, it defines a notion of equivalence between values of a certain type.
* These properties are also known in mathematics as an "equivalence relation".
*
* @since 2.0.0
*/
import { dual } from "./Function.js";
/**
* @category constructors
* @since 2.0.0
*/
export const make = isEquivalent => (self, that) => self === that || isEquivalent(self, that);
const isStrictEquivalent = (x, y) => x === y;
/**
* Return an `Equivalence` that uses strict equality (===) to compare values.
*
* @since 2.0.0
* @category constructors
*/
export const strict = () => isStrictEquivalent;
/**
* @category instances
* @since 2.0.0
*/
export const string = /*#__PURE__*/strict();
/**
* @category instances
* @since 2.0.0
*/
export const number = /*#__PURE__*/strict();
/**
* @category instances
* @since 2.0.0
*/
export const boolean = /*#__PURE__*/strict();
/**
* @category instances
* @since 2.0.0
*/
export const bigint = /*#__PURE__*/strict();
/**
* @category instances
* @since 2.0.0
*/
export const symbol = /*#__PURE__*/strict();
/**
* @category combining
* @since 2.0.0
*/
export const combine = /*#__PURE__*/dual(2, (self, that) => make((x, y) => self(x, y) && that(x, y)));
/**
* @category combining
* @since 2.0.0
*/
export const combineMany = /*#__PURE__*/dual(2, (self, collection) => make((x, y) => {
if (!self(x, y)) {
return false;
}
for (const equivalence of collection) {
if (!equivalence(x, y)) {
return false;
}
}
return true;
}));
const isAlwaysEquivalent = (_x, _y) => true;
/**
* @category combining
* @since 2.0.0
*/
export const combineAll = collection => combineMany(isAlwaysEquivalent, collection);
/**
* @category mapping
* @since 2.0.0
*/
export const mapInput = /*#__PURE__*/dual(2, (self, f) => make((x, y) => self(f(x), f(y))));
/**
* @category instances
* @since 2.0.0
*/
export const Date = /*#__PURE__*/mapInput(number, date => date.getTime());
/**
* @category combining
* @since 2.0.0
*/
export const product = /*#__PURE__*/dual(2, (self, that) => make(([xa, xb], [ya, yb]) => self(xa, ya) && that(xb, yb)));
/**
* @category combining
* @since 2.0.0
*/
export const all = collection => {
return make((x, y) => {
const len = Math.min(x.length, y.length);
let collectionLength = 0;
for (const equivalence of collection) {
if (collectionLength >= len) {
break;
}
if (!equivalence(x[collectionLength], y[collectionLength])) {
return false;
}
collectionLength++;
}
return true;
});
};
/**
* @category combining
* @since 2.0.0
*/
export const productMany = (self, collection) => {
const equivalence = all(collection);
return make((x, y) => !self(x[0], y[0]) ? false : equivalence(x.slice(1), y.slice(1)));
};
/**
* Similar to `Promise.all` but operates on `Equivalence`s.
*
* ```ts skip-type-checking
* [Equivalence<A>, Equivalence<B>, ...] -> Equivalence<[A, B, ...]>
* ```
*
* Given a tuple of `Equivalence`s returns a new `Equivalence` that compares values of a tuple
* by applying each `Equivalence` to the corresponding element of the tuple.
*
* @category combinators
* @since 2.0.0
*/
export const tuple = (...elements) => all(elements);
/**
* Creates a new `Equivalence` for an array of values based on a given `Equivalence` for the elements of the array.
*
* @category combinators
* @since 2.0.0
*/
export const array = item => make((self, that) => {
if (self.length !== that.length) {
return false;
}
for (let i = 0; i < self.length; i++) {
const isEq = item(self[i], that[i]);
if (!isEq) {
return false;
}
}
return true;
});
/**
* Given a struct of `Equivalence`s returns a new `Equivalence` that compares values of a struct
* by applying each `Equivalence` to the corresponding property of the struct.
*
* @category combinators
* @since 2.0.0
*/
export const struct = fields => {
const keys = Object.keys(fields);
return make((self, that) => {
for (const key of keys) {
if (!fields[key](self[key], that[key])) {
return false;
}
}
return true;
});
};
//# sourceMappingURL=Equivalence.js.map

1
_node_modules/effect/dist/esm/Equivalence.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Equivalence.js","names":["dual","make","isEquivalent","self","that","isStrictEquivalent","x","y","strict","string","number","boolean","bigint","symbol","combine","combineMany","collection","equivalence","isAlwaysEquivalent","_x","_y","combineAll","mapInput","f","Date","date","getTime","product","xa","xb","ya","yb","all","len","Math","min","length","collectionLength","productMany","slice","tuple","elements","array","item","i","isEq","struct","fields","keys","Object","key"],"sources":["../../src/Equivalence.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;AAOA,SAASA,IAAI,QAAQ,eAAe;AAmBpC;;;;AAIA,OAAO,MAAMC,IAAI,GAAOC,YAA2C,IAAqB,CAACC,IAAO,EAAEC,IAAO,KACvGD,IAAI,KAAKC,IAAI,IAAIF,YAAY,CAACC,IAAI,EAAEC,IAAI,CAAC;AAE3C,MAAMC,kBAAkB,GAAGA,CAACC,CAAU,EAAEC,CAAU,KAAKD,CAAC,KAAKC,CAAC;AAE9D;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA4BA,CAAA,KAAMH,kBAAkB;AAEvE;;;;AAIA,OAAO,MAAMI,MAAM,gBAAwBD,MAAM,EAAE;AAEnD;;;;AAIA,OAAO,MAAME,MAAM,gBAAwBF,MAAM,EAAE;AAEnD;;;;AAIA,OAAO,MAAMG,OAAO,gBAAyBH,MAAM,EAAE;AAErD;;;;AAIA,OAAO,MAAMI,MAAM,gBAAwBJ,MAAM,EAAE;AAEnD;;;;AAIA,OAAO,MAAMK,MAAM,gBAAwBL,MAAM,EAAE;AAEnD;;;;AAIA,OAAO,MAAMM,OAAO,gBAWhBd,IAAI,CAAC,CAAC,EAAE,CAAIG,IAAoB,EAAEC,IAAoB,KAAqBH,IAAI,CAAC,CAACK,CAAC,EAAEC,CAAC,KAAKJ,IAAI,CAACG,CAAC,EAAEC,CAAC,CAAC,IAAIH,IAAI,CAACE,CAAC,EAAEC,CAAC,CAAC,CAAC,CA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MAAM,EAAE;IAC/B,OAAO,KAAK;EACd;EAEA,KAAK,IAAIQ,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGzC,IAAI,CAACiC,MAAM,EAAEQ,CAAC,EAAE,EAAE;IACpC,MAAMC,IAAI,GAAGF,IAAI,CAACxC,IAAI,CAACyC,CAAC,CAAC,EAAExC,IAAI,CAACwC,CAAC,CAAC,CAAC;IACnC,IAAI,CAACC,IAAI,EAAE;MACT,OAAO,KAAK;IACd;EACF;EAEA,OAAO,IAAI;AACb,CAAC,CAAC;AAEJ;;;;;;;AAOA,OAAO,MAAMC,MAAM,GACjBC,MAAS,IACsF;EAC/F,MAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,MAAM,CAAC;EAChC,OAAO9C,IAAI,CAAC,CAACE,IAAI,EAAEC,IAAI,KAAI;IACzB,KAAK,MAAM8C,GAAG,IAAIF,IAAI,EAAE;MACtB,IAAI,CAACD,MAAM,CAACG,GAAG,CAAC,CAAC/C,IAAI,CAAC+C,GAAG,CAAC,EAAE9C,IAAI,CAAC8C,GAAG,CAAC,CAAC,EAAE;QACtC,OAAO,KAAK;MACd;IACF;IACA,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}

99
_node_modules/effect/dist/esm/ExecutionPlan.js generated vendored Normal file
View File

@@ -0,0 +1,99 @@
import * as Effect from "./Effect.js";
import * as internal from "./internal/executionPlan.js";
import * as Layer from "./Layer.js";
import { pipeArguments } from "./Pipeable.js";
/**
* @since 3.16.0
* @category Symbols
* @experimental
*/
export const TypeId = internal.TypeId;
/**
* @since 3.16.0
* @category Guards
* @experimental
*/
export const isExecutionPlan = internal.isExecutionPlan;
/**
* Create an `ExecutionPlan`, which can be used with `Effect.withExecutionPlan` or `Stream.withExecutionPlan`, allowing you to provide different resources for each step of execution until the effect succeeds or the plan is exhausted.
*
* ```ts
* import type { LanguageModel } from "@effect/ai"
* import type { Layer } from "effect"
* import { Effect, ExecutionPlan, Schedule } from "effect"
*
* declare const layerBad: Layer.Layer<LanguageModel.LanguageModel>
* declare const layerGood: Layer.Layer<LanguageModel.LanguageModel>
*
* const ThePlan = ExecutionPlan.make(
* {
* // First try with the bad layer 2 times with a 3 second delay between attempts
* provide: layerBad,
* attempts: 2,
* schedule: Schedule.spaced(3000)
* },
* // Then try with the bad layer 3 times with a 1 second delay between attempts
* {
* provide: layerBad,
* attempts: 3,
* schedule: Schedule.spaced(1000)
* },
* // Finally try with the good layer.
* //
* // If `attempts` is omitted, the plan will only attempt once, unless a schedule is provided.
* {
* provide: layerGood
* }
* )
*
* declare const effect: Effect.Effect<
* void,
* never,
* LanguageModel.LanguageModel
* >
* const withPlan: Effect.Effect<void> = Effect.withExecutionPlan(effect, ThePlan)
* ```
*
* @since 3.16.0
* @category Constructors
* @experimental
*/
export const make = (...steps) => makeProto(steps.map((options, i) => {
if (options.attempts && options.attempts < 1) {
throw new Error(`ExecutionPlan.make: step[${i}].attempts must be greater than 0`);
}
return {
schedule: options.schedule,
attempts: options.attempts,
while: options.while ? input => Effect.suspend(() => {
const result = options.while(input);
return typeof result === "boolean" ? Effect.succeed(result) : result;
}) : undefined,
provide: options.provide
};
}));
const Proto = {
[TypeId]: TypeId,
get withRequirements() {
const self = this;
return Effect.contextWith(context => makeProto(self.steps.map(step => ({
...step,
provide: Layer.isLayer(step.provide) ? Layer.provide(step.provide, Layer.succeedContext(context)) : step.provide
}))));
},
pipe() {
return pipeArguments(this, arguments);
}
};
const makeProto = steps => {
const self = Object.create(Proto);
self.steps = steps;
return self;
};
/**
* @since 3.16.0
* @category Combining
* @experimental
*/
export const merge = (...plans) => makeProto(plans.flatMap(plan => plan.steps));
//# sourceMappingURL=ExecutionPlan.js.map

1
_node_modules/effect/dist/esm/ExecutionPlan.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExecutionPlan.js","names":["Effect","internal","Layer","pipeArguments","TypeId","isExecutionPlan","make","steps","makeProto","map","options","i","attempts","Error","schedule","while","input","suspend","result","succeed","undefined","provide","Proto","withRequirements","self","contextWith","context","step","isLayer","succeedContext","pipe","arguments","Object","create","merge","plans","flatMap","plan"],"sources":["../../src/ExecutionPlan.ts"],"sourcesContent":[null],"mappings":"AAMA,OAAO,KAAKA,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,QAAQ,MAAM,6BAA6B;AACvD,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC,SAASC,aAAa,QAAQ,eAAe;AAG7C;;;;;AAKA,OAAO,MAAMC,MAAM,GAAkBH,QAAQ,CAACG,MAAM;AASpD;;;;;AAKA,OAAO,MAAMC,eAAe,GAA4CJ,QAAQ,CAACI,eAAe;AA6FhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,OAAO,MAAMC,IAAI,GAAGA,CAClB,GAAGC,KAAgD,KAanDC,SAAS,CAACD,KAAK,CAACE,GAAG,CAAC,CAACC,OAAO,EAAEC,CAAC,KAAI;EACjC,IAAID,OAAO,CAACE,QAAQ,IAAIF,OAAO,CAACE,QAAQ,GAAG,CAAC,EAAE;IAC5C,MAAM,IAAIC,KAAK,CAAC,4BAA4BF,CAAC,mCAAmC,CAAC;EACnF;EACA,OAAO;IACLG,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BF,QAAQ,EAAEF,OAAO,CAACE,QAAQ;IAC1BG,KAAK,EAAEL,OAAO,CAACK,KAAK,GACfC,KAAU,IACXhB,MAAM,CAACiB,OAAO,CAAC,MAAK;MAClB,MAAMC,MAAM,GAAGR,OAAO,CAACK,KAAM,CAACC,KAAK,CAAC;MACpC,OAAO,OAAOE,MAAM,KAAK,SAAS,GAAGlB,MAAM,CAACmB,OAAO,CAACD,MAAM,CAAC,GAAGA,MAAM;IACtE,CAAC,CAAC,GACFE,SAAS;IACbC,OAAO,EAAEX,OAAO,CAACW;GAClB;AACH,CAAC,CAAQ,CAAC;AAmEZ,MAAMC,KAAK,GAAsC;EAC/C,CAAClB,MAAM,GAAGA,MAAM;EAChB,IAAImB,gBAAgBA,CAAA;IAClB,MAAMC,IAAI,GAAG,IAAiC;IAC9C,OAAOxB,MAAM,CAACyB,WAAW,CAAEC,OAA6B,IACtDlB,SAAS,CAACgB,IAAI,CAACjB,KAAK,CAACE,GAAG,CAAEkB,IAAI,KAAM;MAClC,GAAGA,IAAI;MACPN,OAAO,EAAEnB,KAAK,CAAC0B,OAAO,CAACD,IAAI,CAACN,OAAO,CAAC,GAAGnB,KAAK,CAACmB,OAAO,CAACM,IAAI,CAACN,OAAO,EAAEnB,KAAK,CAAC2B,cAAc,CAACH,OAAO,CAAC,CAAC,GAAGC,IAAI,CAACN;KAC1G,CAAC,CAAQ,CAAC,CACZ;EACH,CAAC;EACDS,IAAIA,CAAA;IACF,OAAO3B,aAAa,CAAC,IAAI,EAAE4B,SAAS,CAAC;EACvC;CACD;AAED,MAAMvB,SAAS,GACbD,KAKW,IACT;EACF,MAAMiB,IAAI,GAAGQ,MAAM,CAACC,MAAM,CAACX,KAAK,CAAC;EACjCE,IAAI,CAACjB,KAAK,GAAGA,KAAK;EAClB,OAAOiB,IAAI;AACb,CAAC;AAED;;;;;AAKA,OAAO,MAAMU,KAAK,GAAGA,CACnB,GAAGC,KAAY,KAMX3B,SAAS,CAAC2B,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAAC9B,KAAK,CAAQ,CAAC","ignoreList":[]}

55
_node_modules/effect/dist/esm/ExecutionStrategy.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
import * as internal from "./internal/executionStrategy.js";
/**
* Execute effects sequentially.
*
* @since 2.0.0
* @category constructors
*/
export const sequential = internal.sequential;
/**
* Execute effects in parallel.
*
* @since 2.0.0
* @category constructors
*/
export const parallel = internal.parallel;
/**
* Execute effects in parallel, up to the specified number of concurrent fibers.
*
* @since 2.0.0
* @category constructors
*/
export const parallelN = internal.parallelN;
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isSequential = internal.isSequential;
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isParallel = internal.isParallel;
/**
* Returns `true` if the specified `ExecutionStrategy` is an instance of
* `Sequential`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isParallelN = internal.isParallelN;
/**
* Folds over the specified `ExecutionStrategy` using the provided case
* functions.
*
* @since 2.0.0
* @category folding
*/
export const match = internal.match;
//# sourceMappingURL=ExecutionStrategy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ExecutionStrategy.js","names":["internal","sequential","parallel","parallelN","isSequential","isParallel","isParallelN","match"],"sources":["../../src/ExecutionStrategy.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,QAAQ,MAAM,iCAAiC;AA6C3D;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAsBD,QAAQ,CAACC,UAAU;AAEhE;;;;;;AAMA,OAAO,MAAMC,QAAQ,GAAsBF,QAAQ,CAACE,QAAQ;AAE5D;;;;;;AAMA,OAAO,MAAMC,SAAS,GAA+CH,QAAQ,CAACG,SAAS;AAEvF;;;;;;;AAOA,OAAO,MAAMC,YAAY,GAAoDJ,QAAQ,CAACI,YAAY;AAElG;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAkDL,QAAQ,CAACK,UAAU;AAE5F;;;;;;;AAOA,OAAO,MAAMC,WAAW,GAAmDN,QAAQ,CAACM,WAAW;AAE/F;;;;;;;AAOA,OAAO,MAAMC,KAAK,GA8BdP,QAAQ,CAACO,KAAK","ignoreList":[]}

257
_node_modules/effect/dist/esm/Exit.js generated vendored Normal file
View File

@@ -0,0 +1,257 @@
import * as core from "./internal/core.js";
/**
* Returns `true` if the specified value is an `Exit`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isExit = core.exitIsExit;
/**
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isFailure = core.exitIsFailure;
/**
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isSuccess = core.exitIsSuccess;
/**
* Returns `true` if the specified exit is a `Failure` **and** the `Cause` of
* the failure was due to interruption, `false` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const isInterrupted = core.exitIsInterrupted;
/**
* Maps the `Success` value of the specified exit to the provided constant
* value.
*
* @since 2.0.0
* @category mapping
*/
export const as = core.exitAs;
/**
* Maps the `Success` value of the specified exit to a void.
*
* @since 2.0.0
* @category mapping
*/
export const asVoid = core.exitAsVoid;
/**
* Returns a `Some<Cause<E>>` if the specified exit is a `Failure`, `None`
* otherwise.
*
* @since 2.0.0
* @category getters
*/
export const causeOption = core.exitCauseOption;
/**
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
* the provided iterable contains no elements, `None` will be returned.
*
* @since 2.0.0
* @category constructors
*/
export const all = core.exitCollectAll;
/**
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
*
* @since 2.0.0
* @category constructors
*/
export const die = core.exitDie;
/**
* Executes the predicate on the value of the specified exit if it is a
* `Success`, otherwise returns `false`.
*
* @since 2.0.0
* @category elements
*/
export const exists = core.exitExists;
/**
* Constructs a new `Exit.Failure` from the specified recoverable error of type
* `E`.
*
* @since 2.0.0
* @category constructors
*/
export const fail = core.exitFail;
/**
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
*
* @since 2.0.0
* @category constructors
*/
export const failCause = core.exitFailCause;
/**
* @since 2.0.0
* @category sequencing
*/
export const flatMap = core.exitFlatMap;
/**
* @since 2.0.0
* @category sequencing
*/
export const flatMapEffect = core.exitFlatMapEffect;
/**
* @since 2.0.0
* @category sequencing
*/
export const flatten = core.exitFlatten;
/**
* @since 2.0.0
* @category traversing
*/
export const forEachEffect = core.exitForEachEffect;
/**
* Converts an `Either<R, L>` into an `Exit<R, L>`.
*
* @since 2.0.0
* @category conversions
*/
export const fromEither = core.exitFromEither;
/**
* Converts an `Option<A>` into an `Exit<void, A>`.
*
* @since 2.0.0
* @category conversions
*/
export const fromOption = core.exitFromOption;
/**
* Returns the `A` if specified exit is a `Success`, otherwise returns the
* alternate `A` value computed from the specified function which receives the
* `Cause<E>` of the exit `Failure`.
*
* @since 2.0.0
* @category getters
*/
export const getOrElse = core.exitGetOrElse;
/**
* Constructs a new `Exit.Failure` from the specified `FiberId` indicating that
* the `Fiber` running an `Effect` workflow was terminated due to interruption.
*
* @since 2.0.0
* @category constructors
*/
export const interrupt = core.exitInterrupt;
/**
* Maps over the `Success` value of the specified exit using the provided
* function.
*
* @since 2.0.0
* @category mapping
*/
export const map = core.exitMap;
/**
* Maps over the `Success` and `Failure` cases of the specified exit using the
* provided functions.
*
* @since 2.0.0
* @category mapping
*/
export const mapBoth = core.exitMapBoth;
/**
* Maps over the error contained in the `Failure` of the specified exit using
* the provided function.
*
* @since 2.0.0
* @category mapping
*/
export const mapError = core.exitMapError;
/**
* Maps over the `Cause` contained in the `Failure` of the specified exit using
* the provided function.
*
* @since 2.0.0
* @category mapping
*/
export const mapErrorCause = core.exitMapErrorCause;
/**
* @since 2.0.0
* @category folding
*/
export const match = core.exitMatch;
/**
* @since 2.0.0
* @category folding
*/
export const matchEffect = core.exitMatchEffect;
/**
* Constructs a new `Exit.Success` containing the specified value of type `A`.
*
* @since 2.0.0
* @category constructors
*/
export const succeed = core.exitSucceed;
const void_ = core.exitVoid;
export {
/**
* Represents an `Exit` which succeeds with `undefined`.
*
* @since 2.0.0
* @category constructors
*/
void_ as void };
/**
* Sequentially zips the this result with the specified result or else returns
* the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zip = core.exitZip;
/**
* Sequentially zips the this result with the specified result discarding the
* second element of the tuple or else returns the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zipLeft = core.exitZipLeft;
/**
* Sequentially zips the this result with the specified result discarding the
* first element of the tuple or else returns the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zipRight = core.exitZipRight;
/**
* Parallelly zips the this result with the specified result or else returns
* the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zipPar = core.exitZipPar;
/**
* Parallelly zips the this result with the specified result discarding the
* second element of the tuple or else returns the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zipParLeft = core.exitZipParLeft;
/**
* Parallelly zips the this result with the specified result discarding the
* first element of the tuple or else returns the failed `Cause<E | E2>`.
*
* @since 2.0.0
* @category zipping
*/
export const zipParRight = core.exitZipParRight;
/**
* Zips this exit together with that exit using the specified combination
* functions.
*
* @since 2.0.0
* @category zipping
*/
export const zipWith = core.exitZipWith;
//# sourceMappingURL=Exit.js.map

1
_node_modules/effect/dist/esm/Exit.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Exit.js","names":["core","isExit","exitIsExit","isFailure","exitIsFailure","isSuccess","exitIsSuccess","isInterrupted","exitIsInterrupted","as","exitAs","asVoid","exitAsVoid","causeOption","exitCauseOption","all","exitCollectAll","die","exitDie","exists","exitExists","fail","exitFail","failCause","exitFailCause","flatMap","exitFlatMap","flatMapEffect","exitFlatMapEffect","flatten","exitFlatten","forEachEffect","exitForEachEffect","fromEither","exitFromEither","fromOption","exitFromOption","getOrElse","exitGetOrElse","interrupt","exitInterrupt","map","exitMap","mapBoth","exitMapBoth","mapError","exitMapError","mapErrorCause","exitMapErrorCause","match","exitMatch","matchEffect","exitMatchEffect","succeed","exitSucceed","void_","exitVoid","void","zip","exitZip","zipLeft","exitZipLeft","zipRight","exitZipRight","zipPar","exitZipPar","zipParLeft","exitZipParLeft","zipParRight","exitZipParRight","zipWith","exitZipWith"],"sources":["../../src/Exit.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO,KAAKA,IAAI,MAAM,oBAAoB;AAuE1C;;;;;;AAMA,OAAO,MAAMC,MAAM,GAAg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* @since 3.10.0
*/
export * from "fast-check";
//# sourceMappingURL=FastCheck.js.map

1
_node_modules/effect/dist/esm/FastCheck.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FastCheck.js","names":[],"sources":["../../src/FastCheck.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;;;;AAIA,cAAc,YAAY","ignoreList":[]}

350
_node_modules/effect/dist/esm/Fiber.js generated vendored Normal file
View File

@@ -0,0 +1,350 @@
import * as core from "./internal/core.js";
import * as circular from "./internal/effect/circular.js";
import * as internal from "./internal/fiber.js";
import * as fiberRuntime from "./internal/fiberRuntime.js";
/**
* @since 2.0.0
* @category symbols
*/
export const FiberTypeId = internal.FiberTypeId;
/**
* @since 2.0.0
* @category symbols
*/
export const RuntimeFiberTypeId = internal.RuntimeFiberTypeId;
/**
* @since 2.0.0
* @category instances
*/
export const Order = internal.Order;
/**
* Returns `true` if the specified value is a `Fiber`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isFiber = internal.isFiber;
/**
* Returns `true` if the specified `Fiber` is a `RuntimeFiber`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isRuntimeFiber = internal.isRuntimeFiber;
/**
* The identity of the fiber.
*
* @since 2.0.0
* @category getters
*/
export const id = internal.id;
const _await = internal._await;
export {
/**
* Awaits the fiber, which suspends the awaiting fiber until the result of the
* fiber has been determined.
*
* @since 2.0.0
* @category getters
*/
_await as await };
/**
* Awaits on all fibers to be completed, successfully or not.
*
* @since 2.0.0
* @category destructors
*/
export const awaitAll = fiberRuntime.fiberAwaitAll;
/**
* Retrieves the immediate children of the fiber.
*
* @since 2.0.0
* @category getters
*/
export const children = internal.children;
/**
* Collects all fibers into a single fiber producing an in-order list of the
* results.
*
* @since 2.0.0
* @category constructors
*/
export const all = fiberRuntime.fiberAll;
/**
* A fiber that is done with the specified `Exit` value.
*
* @since 2.0.0
* @category constructors
*/
export const done = internal.done;
/**
* @since 2.0.0
* @category destructors
*/
export const dump = internal.dump;
/**
* @since 2.0.0
* @category destructors
*/
export const dumpAll = internal.dumpAll;
/**
* A fiber that has already failed with the specified value.
*
* @since 2.0.0
* @category constructors
*/
export const fail = internal.fail;
/**
* Creates a `Fiber` that has already failed with the specified cause.
*
* @since 2.0.0
* @category constructors
*/
export const failCause = internal.failCause;
/**
* Lifts an `Effect` into a `Fiber`.
*
* @since 2.0.0
* @category conversions
*/
export const fromEffect = internal.fromEffect;
/**
* Gets the current fiber if one is running.
*
* @since 2.0.0
* @category utilities
*/
export const getCurrentFiber = internal.getCurrentFiber;
/**
* Inherits values from all `FiberRef` instances into current fiber. This
* will resume immediately.
*
* @since 2.0.0
* @category destructors
*/
export const inheritAll = internal.inheritAll;
/**
* Interrupts the fiber from whichever fiber is calling this method. If the
* fiber has already exited, the returned effect will resume immediately.
* Otherwise, the effect will resume when the fiber exits.
*
* @since 2.0.0
* @category interruption
*/
export const interrupt = core.interruptFiber;
/**
* Constructrs a `Fiber` that is already interrupted.
*
* @since 2.0.0
* @category constructors
*/
export const interrupted = internal.interrupted;
/**
* Interrupts the fiber as if interrupted from the specified fiber. If the
* fiber has already exited, the returned effect will resume immediately.
* Otherwise, the effect will resume when the fiber exits.
*
* @since 2.0.0
* @category interruption
*/
export const interruptAs = core.interruptAsFiber;
/**
* Interrupts the fiber as if interrupted from the specified fiber. If the
* fiber has already exited, the returned effect will resume immediately.
* Otherwise, the effect will resume when the fiber exits.
*
* @since 2.0.0
* @category interruption
*/
export const interruptAsFork = internal.interruptAsFork;
/**
* Interrupts all fibers, awaiting their interruption.
*
* @since 2.0.0
* @category interruption
*/
export const interruptAll = internal.interruptAll;
/**
* Interrupts all fibers as by the specified fiber, awaiting their
* interruption.
*
* @since 2.0.0
* @category interruption
*/
export const interruptAllAs = internal.interruptAllAs;
/**
* Interrupts the fiber from whichever fiber is calling this method. The
* interruption will happen in a separate daemon fiber, and the returned
* effect will always resume immediately without waiting.
*
* @since 2.0.0
* @category interruption
*/
export const interruptFork = fiberRuntime.fiberInterruptFork;
/**
* Joins the fiber, which suspends the joining fiber until the result of the
* fiber has been determined. Attempting to join a fiber that has erred will
* result in a catchable error. Joining an interrupted fiber will result in an
* "inner interruption" of this fiber, unlike interruption triggered by
* another fiber, "inner interruption" can be caught and recovered.
*
* @since 2.0.0
* @category destructors
*/
export const join = internal.join;
/**
* Joins all fibers, awaiting their _successful_ completion. Attempting to
* join a fiber that has erred will result in a catchable error, _if_ that
* error does not result from interruption.
*
* @since 2.0.0
* @category destructors
*/
export const joinAll = fiberRuntime.fiberJoinAll;
/**
* Maps over the value the Fiber computes.
*
* @since 2.0.0
* @category mapping
*/
export const map = internal.map;
/**
* Effectually maps over the value the fiber computes.
*
* @since 2.0.0
* @category mapping
*/
export const mapEffect = internal.mapEffect;
/**
* Passes the success of this fiber to the specified callback, and continues
* with the fiber that it returns.
*
* @since 2.0.0
* @category mapping
*/
export const mapFiber = internal.mapFiber;
/**
* Folds over the `Fiber` or `RuntimeFiber`.
*
* @since 2.0.0
* @category folding
*/
export const match = internal.match;
/**
* A fiber that never fails or succeeds.
*
* @since 2.0.0
* @category constructors
*/
export const never = internal.never;
/**
* Returns a fiber that prefers `this` fiber, but falls back to the `that` one
* when `this` one fails. Interrupting the returned fiber will interrupt both
* fibers, sequentially, from left to right.
*
* @since 2.0.0
* @category alternatives
*/
export const orElse = internal.orElse;
/**
* Returns a fiber that prefers `this` fiber, but falls back to the `that` one
* when `this` one fails. Interrupting the returned fiber will interrupt both
* fibers, sequentially, from left to right.
*
* @since 2.0.0
* @category alternatives
*/
export const orElseEither = internal.orElseEither;
/**
* Tentatively observes the fiber, but returns immediately if it is not
* already done.
*
* @since 2.0.0
* @category getters
*/
export const poll = internal.poll;
/**
* Pretty-prints a `RuntimeFiber`.
*
* @since 2.0.0
* @category destructors
*/
export const pretty = internal.pretty;
/**
* Returns a chunk containing all root fibers.
*
* @since 2.0.0
* @category constructors
*/
export const roots = internal.roots;
/**
* Returns a chunk containing all root fibers.
*
* @since 2.0.0
* @category constructors
*/
export const unsafeRoots = internal.unsafeRoots;
/**
* Converts this fiber into a scoped effect. The fiber is interrupted when the
* scope is closed.
*
* @since 2.0.0
* @category destructors
*/
export const scoped = fiberRuntime.fiberScoped;
/**
* Returns the `FiberStatus` of a `RuntimeFiber`.
*
* @since 2.0.0
* @category getters
*/
export const status = internal.status;
/**
* Returns a fiber that has already succeeded with the specified value.
*
* @since 2.0.0
* @category constructors
*/
export const succeed = internal.succeed;
const void_ = internal.void;
export {
/**
* A fiber that has already succeeded with unit.
*
* @since 2.0.0
* @category constructors
*/
void_ as void };
/**
* Zips this fiber and the specified fiber together, producing a tuple of
* their output.
*
* @since 2.0.0
* @category zipping
*/
export const zip = circular.zipFiber;
/**
* Same as `zip` but discards the output of that `Fiber`.
*
* @since 2.0.0
* @category zipping
*/
export const zipLeft = circular.zipLeftFiber;
/**
* Same as `zip` but discards the output of this `Fiber`.
*
* @since 2.0.0
* @category zipping
*/
export const zipRight = circular.zipRightFiber;
/**
* Zips this fiber with the specified fiber, combining their results using the
* specified combiner function. Both joins and interruptions are performed in
* sequential order from left to right.
*
* @since 2.0.0
* @category zipping
*/
export const zipWith = circular.zipWithFiber;
//# sourceMappingURL=Fiber.js.map

1
_node_modules/effect/dist/esm/Fiber.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Fiber.js","names":["core","circular","internal","fiberRuntime","FiberTypeId","RuntimeFiberTypeId","Order","isFiber","isRuntimeFiber","id","_await","await","awaitAll","fiberAwaitAll","children","all","fiberAll","done","dump","dumpAll","fail","failCause","fromEffect","getCurrentFiber","inheritAll","interrupt","interruptFiber","interrupted","interruptAs","interruptAsFiber","interruptAsFork","interruptAll","interruptAllAs","interruptFork","fiberInterruptFork","join","joinAll","fiberJoinAll","map","mapEffect","mapFiber","match","never","orElse","orElseEither","poll","pretty","roots","unsafeRoots","scoped","fiberScoped","status","succeed","void_","void","zip","zipFiber","zipLeft","zipLeftFiber","zipRight","zipRightFiber","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AAQA,OAAO,MAAMC,MAAM,GAmBfzC,QAAQ,CAACyC,MAAM;AAEnB;;;;;;;;AAQA,OAAO,MAAMC,YAAY,GAmBrB1C,QAAQ,CAAC0C,YAAY;AAEzB;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAA+E3C,QAAQ,CAAC2C,IAAI;AAE7G;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA8D5C,QAAQ,CAAC4C,MAAM;AAEhG;;;;;;AAMA,OAAO,MAAMC,KAAK,GAAiD7C,QAAQ,CAAC6C,KAAK;AAEjF;;;;;;AAMA,OAAO,MAAMC,WAAW,GAA+C9C,QAAQ,CAAC8C,WAAW;AAE3F;;;;;;;AAOA,OAAO,MAAMC,MAAM,GACjB9C,YAAY,CAAC+C,WAAW;AAE1B;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA+EjD,QAAQ,CAACiD,MAAM;AAEjH;;;;;;AAMA,OAAO,MAAMC,OAAO,GAA8BlD,QAAQ,CAACkD,OAAO;AAElE,MAAMC,KAAK,GAAgBnD,QAAQ,CAACoD,IAAI;AACxC;AACE;;;;;;AAMAD,KAAK,IAAIC,IAAI;AAGf;;;;;;;AAOA,OAAO,MAAMC,GAAG,GAiBZtD,QAAQ,CAACuD,QAAQ;AAErB;;;;;;AAMA,OAAO,MAAMC,OAAO,GAehBxD,QAAQ,CAACyD,YAAY;AAEzB;;;;;;AAMA,OAAO,MAAMC,QAAQ,GAejB1D,QAAQ,CAAC2D,aAAa;AAE1B;;;;;;;;AAQA,OAAO,MAAMC,OAAO,GAmBhB5D,QAAQ,CAAC6D,YAAY","ignoreList":[]}

309
_node_modules/effect/dist/esm/FiberHandle.js generated vendored Normal file
View File

@@ -0,0 +1,309 @@
import * as Cause from "./Cause.js";
import * as Deferred from "./Deferred.js";
import * as Effect from "./Effect.js";
import * as Exit from "./Exit.js";
import * as Fiber from "./Fiber.js";
import * as FiberId from "./FiberId.js";
import { constFalse, dual } from "./Function.js";
import * as HashSet from "./HashSet.js";
import * as Inspectable from "./Inspectable.js";
import * as Option from "./Option.js";
import { pipeArguments } from "./Pipeable.js";
import * as Predicate from "./Predicate.js";
import * as Runtime from "./Runtime.js";
/**
* @since 2.0.0
* @categories type ids
*/
export const TypeId = /*#__PURE__*/Symbol.for("effect/FiberHandle");
/**
* @since 2.0.0
* @categories refinements
*/
export const isFiberHandle = u => Predicate.hasProperty(u, TypeId);
const Proto = {
[TypeId]: TypeId,
toString() {
return Inspectable.format(this.toJSON());
},
toJSON() {
return {
_id: "FiberHandle",
state: this.state
};
},
[Inspectable.NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
const unsafeMake = deferred => {
const self = Object.create(Proto);
self.state = {
_tag: "Open",
fiber: undefined
};
self.deferred = deferred;
return self;
};
/**
* A FiberHandle can be used to store a single fiber.
* When the associated Scope is closed, the contained fiber will be interrupted.
*
* You can add a fiber to the handle using `FiberHandle.run`, and the fiber will
* be automatically removed from the FiberHandle when it completes.
*
* @example
* ```ts
* import { Effect, FiberHandle } from "effect"
*
* Effect.gen(function*() {
* const handle = yield* FiberHandle.make()
*
* // run some effects
* yield* FiberHandle.run(handle, Effect.never)
* // this will interrupt the previous fiber
* yield* FiberHandle.run(handle, Effect.never)
*
* yield* Effect.sleep(1000)
* }).pipe(
* Effect.scoped // The fiber will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories constructors
*/
export const make = () => Effect.acquireRelease(Effect.map(Deferred.make(), deferred => unsafeMake(deferred)), handle => Effect.withFiberRuntime(parent => {
const state = handle.state;
if (state._tag === "Closed") return Effect.void;
handle.state = {
_tag: "Closed"
};
return state.fiber ? Effect.intoDeferred(Effect.asVoid(Fiber.interruptAs(state.fiber, FiberId.combine(parent.id(), internalFiberId))), handle.deferred) : Deferred.done(handle.deferred, Exit.void);
}));
/**
* Create an Effect run function that is backed by a FiberHandle.
*
* @since 2.0.0
* @categories constructors
*/
export const makeRuntime = () => Effect.flatMap(make(), self => runtime(self)());
/**
* Create an Effect run function that is backed by a FiberHandle.
*
* @since 3.13.0
* @categories constructors
*/
export const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
const internalFiberIdId = -1;
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
emptyCase: constFalse,
failCase: constFalse,
dieCase: constFalse,
interruptCase: (_, fiberId) => HashSet.has(FiberId.ids(fiberId), internalFiberIdId),
sequentialCase: (_, left, right) => left || right,
parallelCase: (_, left, right) => left || right
});
/**
* Set the fiber in a FiberHandle. When the fiber completes, it will be removed from the FiberHandle.
* If a fiber is already running, it will be interrupted unless `options.onlyIfMissing` is set.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeSet = /*#__PURE__*/dual(args => isFiberHandle(args[0]), (self, fiber, options) => {
if (self.state._tag === "Closed") {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
} else if (self.state.fiber !== undefined) {
if (options?.onlyIfMissing === true) {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
} else if (self.state.fiber === fiber) {
return;
}
self.state.fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
self.state.fiber = undefined;
}
self.state.fiber = fiber;
fiber.addObserver(exit => {
if (self.state._tag === "Open" && fiber === self.state.fiber) {
self.state.fiber = undefined;
}
if (Exit.isFailure(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !Cause.isInterruptedOnly(exit.cause))) {
Deferred.unsafeDone(self.deferred, exit);
}
});
});
/**
* Set the fiber in the FiberHandle. When the fiber completes, it will be removed from the FiberHandle.
* If a fiber already exists in the FiberHandle, it will be interrupted unless `options.onlyIfMissing` is set.
*
* @since 2.0.0
* @categories combinators
*/
export const set = /*#__PURE__*/dual(args => isFiberHandle(args[0]), (self, fiber, options) => Effect.fiberIdWith(fiberId => Effect.sync(() => unsafeSet(self, fiber, {
interruptAs: fiberId,
onlyIfMissing: options?.onlyIfMissing,
propagateInterruption: options?.propagateInterruption
}))));
/**
* Retrieve the fiber from the FiberHandle.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeGet = self => self.state._tag === "Closed" ? Option.none() : Option.fromNullable(self.state.fiber);
/**
* Retrieve the fiber from the FiberHandle.
*
* @since 2.0.0
* @categories combinators
*/
export const get = self => Effect.suspend(() => unsafeGet(self));
/**
* @since 2.0.0
* @categories combinators
*/
export const clear = self => Effect.uninterruptibleMask(restore => Effect.withFiberRuntime(fiber => {
if (self.state._tag === "Closed" || self.state.fiber === undefined) {
return Effect.void;
}
return Effect.zipRight(restore(Fiber.interruptAs(self.state.fiber, FiberId.combine(fiber.id(), internalFiberId))), Effect.sync(() => {
if (self.state._tag === "Open") {
self.state.fiber = undefined;
}
}));
}));
const constInterruptedFiber = /*#__PURE__*/function () {
let fiber = undefined;
return () => {
if (fiber === undefined) {
fiber = Effect.runFork(Effect.interrupt);
}
return fiber;
};
}();
/**
* Run an Effect and add the forked fiber to the FiberHandle.
* When the fiber completes, it will be removed from the FiberHandle.
*
* @since 2.0.0
* @categories combinators
*/
export const run = function () {
const self = arguments[0];
if (Effect.isEffect(arguments[1])) {
return runImpl(self, arguments[1], arguments[2]);
}
const options = arguments[1];
return effect => runImpl(self, effect, options);
};
const runImpl = (self, effect, options) => Effect.fiberIdWith(fiberId => {
if (self.state._tag === "Closed") {
return Effect.interrupt;
} else if (self.state.fiber !== undefined && options?.onlyIfMissing === true) {
return Effect.sync(constInterruptedFiber);
}
return Effect.tap(Effect.forkDaemon(effect), fiber => unsafeSet(self, fiber, {
...options,
interruptAs: fiberId
}));
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberHandle.
*
* @example
* ```ts
* import { Context, Effect, FiberHandle } from "effect"
*
* interface Users {
* readonly _: unique symbol
* }
* const Users = Context.GenericTag<Users, {
* getAll: Effect.Effect<Array<unknown>>
* }>("Users")
*
* Effect.gen(function*() {
* const handle = yield* FiberHandle.make()
* const run = yield* FiberHandle.runtime(handle)<Users>()
*
* // run an effect and set the fiber in the handle
* run(Effect.andThen(Users, _ => _.getAll))
*
* // this will interrupt the previous fiber
* run(Effect.andThen(Users, _ => _.getAll))
* }).pipe(
* Effect.scoped // The fiber will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories combinators
*/
export const runtime = self => () => Effect.map(Effect.runtime(), runtime => {
const runFork = Runtime.runFork(runtime);
return (effect, options) => {
if (self.state._tag === "Closed") {
return constInterruptedFiber();
} else if (self.state.fiber !== undefined && options?.onlyIfMissing === true) {
return constInterruptedFiber();
}
const fiber = runFork(effect, options);
unsafeSet(self, fiber, options);
return fiber;
};
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberHandle.
*
* The returned run function will return Promise's that will resolve when the
* fiber completes.
*
* @since 3.13.0
* @categories combinators
*/
export const runtimePromise = self => () => Effect.map(runtime(self)(), runFork => (effect, options) => new Promise((resolve, reject) => runFork(effect, options).addObserver(exit => {
if (Exit.isSuccess(exit)) {
resolve(exit.value);
} else {
reject(Cause.squash(exit.cause));
}
})));
/**
* If any of the Fiber's in the handle terminate with a failure,
* the returned Effect will terminate with the first failure that occurred.
*
* @since 2.0.0
* @categories combinators
* @example
* ```ts
* import { Effect, FiberHandle } from "effect";
*
* Effect.gen(function* (_) {
* const handle = yield* _(FiberHandle.make());
* yield* _(FiberHandle.set(handle, Effect.runFork(Effect.fail("error"))));
*
* // parent fiber will fail with "error"
* yield* _(FiberHandle.join(handle));
* });
* ```
*/
export const join = self => Deferred.await(self.deferred);
/**
* Wait for the fiber in the FiberHandle to complete.
*
* @since 3.13.0
* @categories combinators
*/
export const awaitEmpty = self => Effect.suspend(() => {
if (self.state._tag === "Closed" || self.state.fiber === undefined) {
return Effect.void;
}
return Fiber.await(self.state.fiber);
});
//# sourceMappingURL=FiberHandle.js.map

1
_node_modules/effect/dist/esm/FiberHandle.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

115
_node_modules/effect/dist/esm/FiberId.js generated vendored Normal file
View File

@@ -0,0 +1,115 @@
import * as internal from "./internal/fiberId.js";
/**
* @since 2.0.0
* @category symbols
*/
export const FiberIdTypeId = internal.FiberIdTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const none = internal.none;
/**
* @since 2.0.0
* @category constructors
*/
export const runtime = internal.runtime;
/**
* @since 2.0.0
* @category constructors
*/
export const composite = internal.composite;
/**
* Returns `true` if the specified unknown value is a `FiberId`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isFiberId = internal.isFiberId;
/**
* Returns `true` if the `FiberId` is a `None`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isNone = internal.isNone;
/**
* Returns `true` if the `FiberId` is a `Runtime`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isRuntime = internal.isRuntime;
/**
* Returns `true` if the `FiberId` is a `Composite`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isComposite = internal.isComposite;
/**
* Combine two `FiberId`s.
*
* @since 2.0.0
* @category constructors
*/
export const combine = internal.combine;
/**
* Combines a set of `FiberId`s into a single `FiberId`.
*
* @since 2.0.0
* @category constructors
*/
export const combineAll = internal.combineAll;
/**
* Returns this `FiberId` if it is not `None`, otherwise returns that `FiberId`.
*
* @since 2.0.0
* @category utils
*/
export const getOrElse = internal.getOrElse;
/**
* Get the set of identifiers for this `FiberId`.
*
* @since 2.0.0
* @category destructors
*/
export const ids = internal.ids;
/**
* Creates a new `FiberId`.
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
/**
* Creates a string representing the name of the current thread of execution
* represented by the specified `FiberId`.
*
* @since 2.0.0
* @category destructors
*/
export const threadName = internal.threadName;
/**
* Convert a `FiberId` into an `Option<FiberId>`.
*
* @since 2.0.0
* @category destructors
*/
export const toOption = internal.toOption;
/**
* Convert a `FiberId` into a `HashSet<FiberId>`.
*
* @since 2.0.0
* @category destructors
*/
export const toSet = internal.toSet;
/**
* Unsafely creates a new `FiberId`.
*
* @since 2.0.0
* @category unsafe
*/
export const unsafeMake = internal.unsafeMake;
//# sourceMappingURL=FiberId.js.map

1
_node_modules/effect/dist/esm/FiberId.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FiberId.js","names":["internal","FiberIdTypeId","none","runtime","composite","isFiberId","isNone","isRuntime","isComposite","combine","combineAll","getOrElse","ids","make","threadName","toOption","toSet","unsafeMake"],"sources":["../../src/FiberId.ts"],"sourcesContent":[null],"mappings":"AAMA,OAAO,KAAKA,QAAQ,MAAM,uBAAuB;AAGjD;;;;AAIA,OAAO,MAAMC,aAAa,GAAkBD,QAAQ,CAACC,aAAa;AAqDlE;;;;AAIA,OAAO,MAAMC,IAAI,GAASF,QAAQ,CAACE,IAAI;AAEvC;;;;AAIA,OAAO,MAAMC,OAAO,GAAqDH,QAAQ,CAACG,OAAO;AAEzF;;;;AAIA,OAAO,MAAMC,SAAS,GAAiDJ,QAAQ,CAACI,SAAS;AAEzF;;;;;;;AAOA,OAAO,MAAMC,SAAS,GAAuCL,QAAQ,CAACK,SAAS;AAE/E;;;;;;AAMA,OAAO,MAAMC,MAAM,GAAoCN,QAAQ,CAACM,MAAM;AAEtE;;;;;;AAMA,OAAO,MAAMC,SAAS,GAAuCP,QAAQ,CAACO,SAAS;AAE/E;;;;;;AAMA,OAAO,MAAMC,WAAW,GAAyCR,QAAQ,CAACQ,WAAW;AAErF;;;;;;AAMA,OAAO,MAAMC,OAAO,GAehBT,QAAQ,CAACS,OAAO;AAEpB;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAoDV,QAAQ,CAACU,UAAU;AAE9F;;;;;;AAMA,OAAO,MAAMC,SAAS,GAelBX,QAAQ,CAACW,SAAS;AAEtB;;;;;;AAMA,OAAO,MAAMC,GAAG,GAA+CZ,QAAQ,CAACY,GAAG;AAE3E;;;;;;AAMA,OAAO,MAAMC,IAAI,GAAsDb,QAAQ,CAACa,IAAI;AAEpF;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAA8Bd,QAAQ,CAACc,UAAU;AAExE;;;;;;AAMA,OAAO,MAAMC,QAAQ,GAA8Cf,QAAQ,CAACe,QAAQ;AAEpF;;;;;;AAMA,OAAO,MAAMC,KAAK,GAAgDhB,QAAQ,CAACgB,KAAK;AAEhF;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAyBjB,QAAQ,CAACiB,UAAU","ignoreList":[]}

349
_node_modules/effect/dist/esm/FiberMap.js generated vendored Normal file
View File

@@ -0,0 +1,349 @@
import * as Cause from "./Cause.js";
import * as Deferred from "./Deferred.js";
import * as Effect from "./Effect.js";
import * as Exit from "./Exit.js";
import * as Fiber from "./Fiber.js";
import * as FiberId from "./FiberId.js";
import { constFalse, constVoid, dual } from "./Function.js";
import * as HashSet from "./HashSet.js";
import * as Inspectable from "./Inspectable.js";
import * as Iterable from "./Iterable.js";
import * as MutableHashMap from "./MutableHashMap.js";
import * as Option from "./Option.js";
import { pipeArguments } from "./Pipeable.js";
import * as Predicate from "./Predicate.js";
import * as Runtime from "./Runtime.js";
/**
* @since 2.0.0
* @categories type ids
*/
export const TypeId = /*#__PURE__*/Symbol.for("effect/FiberMap");
/**
* @since 2.0.0
* @categories refinements
*/
export const isFiberMap = u => Predicate.hasProperty(u, TypeId);
const Proto = {
[TypeId]: TypeId,
[Symbol.iterator]() {
if (this.state._tag === "Closed") {
return Iterable.empty();
}
return this.state.backing[Symbol.iterator]();
},
toString() {
return Inspectable.format(this.toJSON());
},
toJSON() {
return {
_id: "FiberMap",
state: this.state
};
},
[Inspectable.NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
const unsafeMake = (backing, deferred) => {
const self = Object.create(Proto);
self.state = {
_tag: "Open",
backing
};
self.deferred = deferred;
return self;
};
/**
* A FiberMap can be used to store a collection of fibers, indexed by some key.
* When the associated Scope is closed, all fibers in the map will be interrupted.
*
* You can add fibers to the map using `FiberMap.set` or `FiberMap.run`, and the fibers will
* be automatically removed from the FiberMap when they complete.
*
* @example
* ```ts
* import { Effect, FiberMap } from "effect"
*
* Effect.gen(function*() {
* const map = yield* FiberMap.make<string>()
*
* // run some effects and add the fibers to the map
* yield* FiberMap.run(map, "fiber a", Effect.never)
* yield* FiberMap.run(map, "fiber b", Effect.never)
*
* yield* Effect.sleep(1000)
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories constructors
*/
export const make = () => Effect.acquireRelease(Effect.map(Deferred.make(), deferred => unsafeMake(MutableHashMap.empty(), deferred)), map => Effect.withFiberRuntime(parent => {
const state = map.state;
if (state._tag === "Closed") return Effect.void;
map.state = {
_tag: "Closed"
};
return Fiber.interruptAllAs(Iterable.map(state.backing, ([, fiber]) => fiber), FiberId.combine(parent.id(), internalFiberId)).pipe(Effect.intoDeferred(map.deferred));
}));
/**
* Create an Effect run function that is backed by a FiberMap.
*
* @since 2.0.0
* @categories constructors
*/
export const makeRuntime = () => Effect.flatMap(make(), self => runtime(self)());
/**
* Create an Effect run function that is backed by a FiberMap.
*
* @since 3.13.0
* @categories constructors
*/
export const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
const internalFiberIdId = -1;
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
emptyCase: constFalse,
failCase: constFalse,
dieCase: constFalse,
interruptCase: (_, fiberId) => HashSet.has(FiberId.ids(fiberId), internalFiberIdId),
sequentialCase: (_, left, right) => left || right,
parallelCase: (_, left, right) => left || right
});
/**
* Add a fiber to the FiberMap. When the fiber completes, it will be removed from the FiberMap.
* If the key already exists in the FiberMap, the previous fiber will be interrupted.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeSet = /*#__PURE__*/dual(args => isFiberMap(args[0]), (self, key, fiber, options) => {
if (self.state._tag === "Closed") {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
}
const previous = MutableHashMap.get(self.state.backing, key);
if (previous._tag === "Some") {
if (options?.onlyIfMissing === true) {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
} else if (previous.value === fiber) {
return;
}
previous.value.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
}
MutableHashMap.set(self.state.backing, key, fiber);
fiber.addObserver(exit => {
if (self.state._tag === "Closed") {
return;
}
const current = MutableHashMap.get(self.state.backing, key);
if (Option.isSome(current) && fiber === current.value) {
MutableHashMap.remove(self.state.backing, key);
}
if (Exit.isFailure(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !Cause.isInterruptedOnly(exit.cause))) {
Deferred.unsafeDone(self.deferred, exit);
}
});
});
/**
* Add a fiber to the FiberMap. When the fiber completes, it will be removed from the FiberMap.
* If the key already exists in the FiberMap, the previous fiber will be interrupted.
*
* @since 2.0.0
* @categories combinators
*/
export const set = /*#__PURE__*/dual(args => isFiberMap(args[0]), (self, key, fiber, options) => Effect.fiberIdWith(fiberId => Effect.sync(() => unsafeSet(self, key, fiber, {
...options,
interruptAs: fiberId
}))));
/**
* Retrieve a fiber from the FiberMap.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeGet = /*#__PURE__*/dual(2, (self, key) => self.state._tag === "Closed" ? Option.none() : MutableHashMap.get(self.state.backing, key));
/**
* Retrieve a fiber from the FiberMap.
*
* @since 2.0.0
* @categories combinators
*/
export const get = /*#__PURE__*/dual(2, (self, key) => Effect.suspend(() => unsafeGet(self, key)));
/**
* Check if a key exists in the FiberMap.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeHas = /*#__PURE__*/dual(2, (self, key) => self.state._tag === "Closed" ? false : MutableHashMap.has(self.state.backing, key));
/**
* Check if a key exists in the FiberMap.
*
* @since 2.0.0
* @categories combinators
*/
export const has = /*#__PURE__*/dual(2, (self, key) => Effect.sync(() => unsafeHas(self, key)));
/**
* Remove a fiber from the FiberMap, interrupting it if it exists.
*
* @since 2.0.0
* @categories combinators
*/
export const remove = /*#__PURE__*/dual(2, (self, key) => Effect.withFiberRuntime(removeFiber => {
if (self.state._tag === "Closed") {
return Effect.void;
}
const fiber = MutableHashMap.get(self.state.backing, key);
if (fiber._tag === "None") {
return Effect.void;
}
// will be removed by the observer
return Fiber.interruptAs(fiber.value, FiberId.combine(removeFiber.id(), internalFiberId));
}));
/**
* @since 2.0.0
* @categories combinators
*/
export const clear = self => Effect.withFiberRuntime(clearFiber => {
if (self.state._tag === "Closed") {
return Effect.void;
}
return Effect.forEach(self.state.backing, ([, fiber]) =>
// will be removed by the observer
Fiber.interruptAs(fiber, FiberId.combine(clearFiber.id(), internalFiberId)));
});
const constInterruptedFiber = /*#__PURE__*/function () {
let fiber = undefined;
return () => {
if (fiber === undefined) {
fiber = Effect.runFork(Effect.interrupt);
}
return fiber;
};
}();
/**
* Run an Effect and add the forked fiber to the FiberMap.
* When the fiber completes, it will be removed from the FiberMap.
*
* @since 2.0.0
* @categories combinators
*/
export const run = function () {
const self = arguments[0];
if (Effect.isEffect(arguments[2])) {
return runImpl(self, arguments[1], arguments[2], arguments[3]);
}
const key = arguments[1];
const options = arguments[2];
return effect => runImpl(self, key, effect, options);
};
const runImpl = (self, key, effect, options) => Effect.fiberIdWith(fiberId => {
if (self.state._tag === "Closed") {
return Effect.interrupt;
} else if (options?.onlyIfMissing === true && unsafeHas(self, key)) {
return Effect.sync(constInterruptedFiber);
}
return Effect.tap(Effect.forkDaemon(effect), fiber => unsafeSet(self, key, fiber, {
...options,
interruptAs: fiberId
}));
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberMap.
*
* @example
* ```ts
* import { Context, Effect, FiberMap } from "effect"
*
* interface Users {
* readonly _: unique symbol
* }
* const Users = Context.GenericTag<Users, {
* getAll: Effect.Effect<Array<unknown>>
* }>("Users")
*
* Effect.gen(function*() {
* const map = yield* FiberMap.make<string>()
* const run = yield* FiberMap.runtime(map)<Users>()
*
* // run some effects and add the fibers to the map
* run("effect-a", Effect.andThen(Users, _ => _.getAll))
* run("effect-b", Effect.andThen(Users, _ => _.getAll))
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories combinators
*/
export const runtime = self => () => Effect.map(Effect.runtime(), runtime => {
const runFork = Runtime.runFork(runtime);
return (key, effect, options) => {
if (self.state._tag === "Closed") {
return constInterruptedFiber();
} else if (options?.onlyIfMissing === true && unsafeHas(self, key)) {
return constInterruptedFiber();
}
const fiber = runFork(effect, options);
unsafeSet(self, key, fiber, options);
return fiber;
};
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberMap.
*
* @since 3.13.0
* @categories combinators
*/
export const runtimePromise = self => () => Effect.map(runtime(self)(), runFork => (key, effect, options) => new Promise((resolve, reject) => runFork(key, effect, options).addObserver(exit => {
if (Exit.isSuccess(exit)) {
resolve(exit.value);
} else {
reject(Cause.squash(exit.cause));
}
})));
/**
* @since 2.0.0
* @categories combinators
*/
export const size = self => Effect.sync(() => self.state._tag === "Closed" ? 0 : MutableHashMap.size(self.state.backing));
/**
* Join all fibers in the FiberMap. If any of the Fiber's in the map terminate with a failure,
* the returned Effect will terminate with the first failure that occurred.
*
* @since 2.0.0
* @categories combinators
* @example
* ```ts
* import { Effect, FiberMap } from "effect";
*
* Effect.gen(function* (_) {
* const map = yield* _(FiberMap.make());
* yield* _(FiberMap.set(map, "a", Effect.runFork(Effect.fail("error"))));
*
* // parent fiber will fail with "error"
* yield* _(FiberMap.join(map));
* });
* ```
*/
export const join = self => Deferred.await(self.deferred);
/**
* Wait for the FiberMap to be empty.
*
* @since 3.13.0
* @categories combinators
*/
export const awaitEmpty = self => Effect.whileLoop({
while: () => self.state._tag === "Open" && MutableHashMap.size(self.state.backing) > 0,
body: () => Fiber.await(Iterable.unsafeHead(self)[1]),
step: constVoid
});
//# sourceMappingURL=FiberMap.js.map

1
_node_modules/effect/dist/esm/FiberMap.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

242
_node_modules/effect/dist/esm/FiberRef.js generated vendored Normal file
View File

@@ -0,0 +1,242 @@
import * as core from "./internal/core.js";
import * as fiberRuntime from "./internal/fiberRuntime.js";
import * as query from "./internal/query.js";
import * as Scheduler from "./Scheduler.js";
/**
* @since 2.0.0
* @category symbols
*/
export const FiberRefTypeId = core.FiberRefTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const make = fiberRuntime.fiberRefMake;
/**
* @since 2.0.0
* @category constructors
*/
export const makeWith = fiberRuntime.fiberRefMakeWith;
/**
* @since 2.0.0
* @category constructors
*/
export const makeContext = fiberRuntime.fiberRefMakeContext;
/**
* @since 2.0.0
* @category constructors
*/
export const makeRuntimeFlags = fiberRuntime.fiberRefMakeRuntimeFlags;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMake = core.fiberRefUnsafeMake;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMakeHashSet = core.fiberRefUnsafeMakeHashSet;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMakeContext = core.fiberRefUnsafeMakeContext;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMakeSupervisor = fiberRuntime.fiberRefUnsafeMakeSupervisor;
/**
* @since 2.0.0
* @category constructors
*/
export const unsafeMakePatch = core.fiberRefUnsafeMakePatch;
/**
* @since 2.0.0
* @category getters
*/
export const get = core.fiberRefGet;
/**
* @since 2.0.0
* @category utils
*/
export const getAndSet = core.fiberRefGetAndSet;
/**
* @since 2.0.0
* @category utils
*/
export const getAndUpdate = core.fiberRefGetAndUpdate;
/**
* @since 2.0.0
* @category utils
*/
export const getAndUpdateSome = core.fiberRefGetAndUpdateSome;
/**
* @since 2.0.0
* @category utils
*/
export const getWith = core.fiberRefGetWith;
/**
* @since 2.0.0
* @category utils
*/
export const set = core.fiberRefSet;
const _delete = core.fiberRefDelete;
export {
/**
* @since 2.0.0
* @category utils
*/
_delete as delete };
/**
* @since 2.0.0
* @category utils
*/
export const reset = core.fiberRefReset;
/**
* @since 2.0.0
* @category utils
*/
export const modify = core.fiberRefModify;
/**
* @since 2.0.0
* @category utils
*/
export const modifySome = core.fiberRefModifySome;
/**
* @since 2.0.0
* @category utils
*/
export const update = core.fiberRefUpdate;
/**
* @since 2.0.0
* @category utils
*/
export const updateSome = core.fiberRefUpdateSome;
/**
* @since 2.0.0
* @category utils
*/
export const updateAndGet = core.fiberRefUpdateAndGet;
/**
* @since 2.0.0
* @category utils
*/
export const updateSomeAndGet = core.fiberRefUpdateSomeAndGet;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentConcurrency = core.currentConcurrency;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentRequestBatchingEnabled = core.currentRequestBatching;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentRequestCache = query.currentCache;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentRequestCacheEnabled = query.currentCacheEnabled;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentContext = core.currentContext;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentSchedulingPriority = core.currentSchedulingPriority;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentMaxOpsBeforeYield = core.currentMaxOpsBeforeYield;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const unhandledErrorLogLevel = core.currentUnhandledErrorLogLevel;
/**
* @since 3.17.0
* @category fiberRefs
*/
export const versionMismatchErrorLogLevel = core.currentVersionMismatchErrorLogLevel;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentLogAnnotations = core.currentLogAnnotations;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentLoggers = fiberRuntime.currentLoggers;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentLogLevel = core.currentLogLevel;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentMinimumLogLevel = fiberRuntime.currentMinimumLogLevel;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentLogSpan = core.currentLogSpan;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentRuntimeFlags = fiberRuntime.currentRuntimeFlags;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentScheduler = Scheduler.currentScheduler;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentSupervisor = fiberRuntime.currentSupervisor;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentMetricLabels = core.currentMetricLabels;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentTracerEnabled = core.currentTracerEnabled;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentTracerTimingEnabled = core.currentTracerTimingEnabled;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentTracerSpanAnnotations = core.currentTracerSpanAnnotations;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const currentTracerSpanLinks = core.currentTracerSpanLinks;
/**
* @since 2.0.0
* @category fiberRefs
*/
export const interruptedCause = core.currentInterruptedCause;
//# sourceMappingURL=FiberRef.js.map

1
_node_modules/effect/dist/esm/FiberRef.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FiberRef.js","names":["core","fiberRuntime","query","Scheduler","FiberRefTypeId","make","fiberRefMake","makeWith","fiberRefMakeWith","makeContext","fiberRefMakeContext","makeRuntimeFlags","fiberRefMakeRuntimeFlags","unsafeMake","fiberRefUnsafeMake","unsafeMakeHashSet","fiberRefUnsafeMakeHashSet","unsafeMakeContext","fiberRefUnsafeMakeContext","unsafeMakeSupervisor","fiberRefUnsafeMakeSupervisor","unsafeMakePatch","fiberRefUnsafeMakePatch","get","fiberRefGet","getAndSet","fiberRefGetAndSet","getAndUpdate","fiberRefGetAndUpdate","getAndUpdateSome","fiberRefGetAndUpdateSome","getWith","fiberRefGetWith","set","fiberRefSet","_delete","fiberRefDelete","delete","reset","fiberRefReset","modify","fiberRefModify","modifySome","fiberRefModifySome","update","fiberRefUpdate","updateSome","fiberRefUpdateSome","updateAndGet","fiberRefUpdateAndGet","updateSomeAndGet","fiberRefUpdateSomeAndGet","currentConcurrency","currentRequestBatchingEnabled","currentRequestBatching","currentRequestCache","currentCache","currentRequestCacheEnabled","currentCacheEnabled","currentContext","currentSchedulingPriority","currentMaxOpsBeforeYield","unhandledErrorLogLevel","currentUnhandledErrorLogLevel","versionMismatchErrorLogLevel","currentVersionMismatchErrorLogLevel","currentLogAnnotations","currentLoggers","currentLogLevel","currentMinimumLogLevel","currentLogSpan","currentRuntimeFlags","currentScheduler","currentSupervisor","currentMetricLabels","currentTracerEnabled","currentTracerTimingEnabled","currentTracerSpanAnnotations","currentTracerSpanLinks","interruptedCause","currentInterruptedCause"],"sources":["../../src/FiberRef.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAKA,IAAI,MAAM,oBAAoB;AAC1C,OAAO,KAAKC,YAAY,MAAM,4BAA4B;AAC1D,OAAO,KAAKC,KAAK,MAAM,qBAAqB;AAS5C,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAO3C;;;;AAIA,OAAO,MAAMC,cAAc,GAAkBJ,IAAI,CAACI,cAAc;AAwDhE;;;;AAIA,OAAO,MAAMC,IAAI,GAMqCJ,YAAY,CAACK,YAAY;AAE/E;;;;AAIA,OAAO,MAAMC,QAAQ,GACnBN,YAAY,CAACO,gBAAgB;AAE/B;;;;AAIA,OAAO,MAAMC,WAAW,GAE+CR,YAAY,CAACS,mBAAmB;AAEvG;;;;AAIA,OAAO,MAAMC,gBAAgB,GAEiDV,YAAY,CAACW,wBAAwB;AAEnH;;;;AAIA,OAAO,MAAMC,UAAU,GAMAb,IAAI,CAACc,kBAAkB;AAE9C;;;;AAIA,OAAO,MAAMC,iBAAiB,GAC5Bf,IAAI,CAACgB,yBAAyB;AAEhC;;;;AAIA,OAAO,MAAMC,iBAAiB,GAC5BjB,IAAI,CAACkB,yBAAyB;AAEhC;;;;AAIA,OAAO,MAAM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O,MAAMC,4BAA4B,GACvC7E,IAAI,CAAC6E,4BAA4B;AAEnC;;;;AAIA,OAAO,MAAMC,sBAAsB,GAA2C9E,IAAI,CAAC8E,sBAAsB;AAEzG;;;;AAIA,OAAO,MAAMC,gBAAgB,GAAiC/E,IAAI,CAACgF,uBAAuB","ignoreList":[]}

92
_node_modules/effect/dist/esm/FiberRefs.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
import * as internal from "./internal/fiberRefs.js";
/**
* @since 2.0.0
* @category symbols
*/
export const FiberRefsSym = internal.FiberRefsSym;
const delete_ = internal.delete_;
export {
/**
* Deletes the specified `FiberRef` from the `FibterRefs`.
*
* @since 2.0.0
* @category utils
*/
delete_ as delete };
/**
* Returns a set of each `FiberRef` in this collection.
*
* @since 2.0.0
* @category getters
*/
export const fiberRefs = internal.fiberRefs;
/**
* Forks this collection of fiber refs as the specified child fiber id. This
* will potentially modify the value of the fiber refs, as determined by the
* individual fiber refs that make up the collection.
*
* @since 2.0.0
* @category utils
*/
export const forkAs = internal.forkAs;
/**
* Gets the value of the specified `FiberRef` in this collection of `FiberRef`
* values if it exists or `None` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const get = internal.get;
/**
* Gets the value of the specified `FiberRef` in this collection of `FiberRef`
* values if it exists or the `initial` value of the `FiberRef` otherwise.
*
* @since 2.0.0
* @category getters
*/
export const getOrDefault = internal.getOrDefault;
/**
* Joins this collection of fiber refs to the specified collection, as the
* specified fiber id. This will perform diffing and merging to ensure
* preservation of maximum information from both child and parent refs.
*
* @since 2.0.0
* @category utils
*/
export const joinAs = internal.joinAs;
/**
* Set each ref to either its value or its default.
*
* @since 2.0.0
* @category utils
*/
export const setAll = internal.setAll;
/**
* Updates the value of the specified `FiberRef` using the provided `FiberId`
*
* @since 2.0.0
* @category utils
*/
export const updateAs = internal.updateAs;
/**
* Updates the values of the specified `FiberRef` & value pairs using the provided `FiberId`
*
* @since 2.0.0
* @category utils
*/
export const updateManyAs = internal.updateManyAs;
/**
* Note: it will not copy the provided Map, make sure to provide a fresh one.
*
* @since 2.0.0
* @category unsafe
*/
export const unsafeMake = internal.unsafeMake;
/**
* The empty collection of `FiberRef` values.
*
* @category constructors
* @since 2.0.0
*/
export const empty = internal.empty;
//# sourceMappingURL=FiberRefs.js.map

1
_node_modules/effect/dist/esm/FiberRefs.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FiberRefs.js","names":["internal","FiberRefsSym","delete_","delete","fiberRefs","forkAs","get","getOrDefault","joinAs","setAll","updateAs","updateManyAs","unsafeMake","empty"],"sources":["../../src/FiberRefs.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO,KAAKA,QAAQ,MAAM,yBAAyB;AAInD;;;;AAIA,OAAO,MAAMC,YAAY,GAAkBD,QAAQ,CAACC,YAAY;AAsBhE,MAAMC,OAAO,GAGTF,QAAQ,CAACE,OAAO;AAEpB;AACE;;;;;;AAMAA,OAAO,IAAIC,MAAM;AAGnB;;;;;;AAMA,OAAO,MAAMC,SAAS,GAAiEJ,QAAQ,CAACI,SAAS;AAEzG;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAmBfL,QAAQ,CAACK,MAAM;AAEnB;;;;;;;AAOA,OAAO,MAAMC,GAAG,GAiBZN,QAAQ,CAACM,GAAG;AAEhB;;;;;;;AAOA,OAAO,MAAMC,YAAY,GAiBrBP,QAAQ,CAACO,YAAY;AAEzB;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAmBfR,QAAQ,CAACQ,MAAM;AAEnB;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA6CT,QAAQ,CAACS,MAAM;AAE/E;;;;;;AAMA,OAAO,MAAMC,QAAQ,GA4BjBV,QAAQ,CAACU,QAAQ;AAErB;;;;;;AAMA,OAAO,MAAMC,YAAY,GAgDrBX,QAAQ,CAACW,YAAY;AAEzB;;;;;;AAMA,OAAO,MAAMC,UAAU,GAENZ,QAAQ,CAACY,UAAU;AAEpC;;;;;;AAMA,OAAO,MAAMC,KAAK,GAAoBb,QAAQ,CAACa,KAAK","ignoreList":[]}

32
_node_modules/effect/dist/esm/FiberRefsPatch.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import * as internal from "./internal/fiberRefs/patch.js";
/**
* @since 2.0.0
* @category constructors
*/
export const empty = internal.empty;
/**
* Constructs a patch that describes the changes between the specified
* collections of `FiberRef`
*
* @since 2.0.0
* @category constructors
*/
export const diff = internal.diff;
/**
* Combines this patch and the specified patch to create a new patch that
* describes applying the changes from this patch and the specified patch
* sequentially.
*
* @since 2.0.0
* @category constructors
*/
export const combine = internal.combine;
/**
* Applies the changes described by this patch to the specified collection
* of `FiberRef` values.
*
* @since 2.0.0
* @category destructors
*/
export const patch = internal.patch;
//# sourceMappingURL=FiberRefsPatch.js.map

1
_node_modules/effect/dist/esm/FiberRefsPatch.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FiberRefsPatch.js","names":["internal","empty","diff","combine","patch"],"sources":["../../src/FiberRefsPatch.ts"],"sourcesContent":[null],"mappings":"AAMA,OAAO,KAAKA,QAAQ,MAAM,+BAA+B;AA4DzD;;;;AAIA,OAAO,MAAMC,KAAK,GAAmBD,QAAQ,CAACC,KAAK;AAEnD;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAAqFF,QAAQ,CAACE,IAAI;AAEnH;;;;;;;;AAQA,OAAO,MAAMC,OAAO,GAmBhBH,QAAQ,CAACG,OAAO;AAEpB;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAqBdJ,QAAQ,CAACI,KAAK","ignoreList":[]}

289
_node_modules/effect/dist/esm/FiberSet.js generated vendored Normal file
View File

@@ -0,0 +1,289 @@
/**
* @since 2.0.0
*/
import * as Cause from "./Cause.js";
import * as Deferred from "./Deferred.js";
import * as Effect from "./Effect.js";
import * as Exit from "./Exit.js";
import * as Fiber from "./Fiber.js";
import * as FiberId from "./FiberId.js";
import { constFalse, constVoid, dual } from "./Function.js";
import * as HashSet from "./HashSet.js";
import * as Inspectable from "./Inspectable.js";
import * as Iterable from "./Iterable.js";
import { pipeArguments } from "./Pipeable.js";
import * as Predicate from "./Predicate.js";
import * as Runtime from "./Runtime.js";
/**
* @since 2.0.0
* @categories type ids
*/
export const TypeId = /*#__PURE__*/Symbol.for("effect/FiberSet");
/**
* @since 2.0.0
* @categories refinements
*/
export const isFiberSet = u => Predicate.hasProperty(u, TypeId);
const Proto = {
[TypeId]: TypeId,
[Symbol.iterator]() {
if (this.state._tag === "Closed") {
return Iterable.empty();
}
return this.state.backing[Symbol.iterator]();
},
toString() {
return Inspectable.format(this.toJSON());
},
toJSON() {
return {
_id: "FiberMap",
state: this.state
};
},
[Inspectable.NodeInspectSymbol]() {
return this.toJSON();
},
pipe() {
return pipeArguments(this, arguments);
}
};
const unsafeMake = (backing, deferred) => {
const self = Object.create(Proto);
self.state = {
_tag: "Open",
backing
};
self.deferred = deferred;
return self;
};
/**
* A FiberSet can be used to store a collection of fibers.
* When the associated Scope is closed, all fibers in the set will be interrupted.
*
* You can add fibers to the set using `FiberSet.add` or `FiberSet.run`, and the fibers will
* be automatically removed from the FiberSet when they complete.
*
* @example
* ```ts
* import { Effect, FiberSet } from "effect"
*
* Effect.gen(function*() {
* const set = yield* FiberSet.make()
*
* // run some effects and add the fibers to the set
* yield* FiberSet.run(set, Effect.never)
* yield* FiberSet.run(set, Effect.never)
*
* yield* Effect.sleep(1000)
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories constructors
*/
export const make = () => Effect.acquireRelease(Effect.map(Deferred.make(), deferred => unsafeMake(new Set(), deferred)), set => Effect.withFiberRuntime(parent => {
const state = set.state;
if (state._tag === "Closed") return Effect.void;
set.state = {
_tag: "Closed"
};
const fibers = state.backing;
return Fiber.interruptAllAs(fibers, FiberId.combine(parent.id(), internalFiberId)).pipe(Effect.intoDeferred(set.deferred));
}));
/**
* Create an Effect run function that is backed by a FiberSet.
*
* @since 2.0.0
* @categories constructors
*/
export const makeRuntime = () => Effect.flatMap(make(), self => runtime(self)());
/**
* Create an Effect run function that is backed by a FiberSet.
*
* @since 3.13.0
* @categories constructors
*/
export const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
const internalFiberIdId = -1;
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
emptyCase: constFalse,
failCase: constFalse,
dieCase: constFalse,
interruptCase: (_, fiberId) => HashSet.has(FiberId.ids(fiberId), internalFiberIdId),
sequentialCase: (_, left, right) => left || right,
parallelCase: (_, left, right) => left || right
});
/**
* Add a fiber to the FiberSet. When the fiber completes, it will be removed.
*
* @since 2.0.0
* @categories combinators
*/
export const unsafeAdd = /*#__PURE__*/dual(args => isFiberSet(args[0]), (self, fiber, options) => {
if (self.state._tag === "Closed") {
fiber.unsafeInterruptAsFork(FiberId.combine(options?.interruptAs ?? FiberId.none, internalFiberId));
return;
} else if (self.state.backing.has(fiber)) {
return;
}
self.state.backing.add(fiber);
fiber.addObserver(exit => {
if (self.state._tag === "Closed") {
return;
}
self.state.backing.delete(fiber);
if (Exit.isFailure(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !Cause.isInterruptedOnly(exit.cause))) {
Deferred.unsafeDone(self.deferred, exit);
}
});
});
/**
* Add a fiber to the FiberSet. When the fiber completes, it will be removed.
*
* @since 2.0.0
* @categories combinators
*/
export const add = /*#__PURE__*/dual(args => isFiberSet(args[0]), (self, fiber, options) => Effect.fiberIdWith(fiberId => Effect.sync(() => unsafeAdd(self, fiber, {
...options,
interruptAs: fiberId
}))));
/**
* @since 2.0.0
* @categories combinators
*/
export const clear = self => Effect.withFiberRuntime(clearFiber => {
if (self.state._tag === "Closed") {
return Effect.void;
}
return Effect.forEach(self.state.backing, fiber =>
// will be removed by the observer
Fiber.interruptAs(fiber, FiberId.combine(clearFiber.id(), internalFiberId)));
});
const constInterruptedFiber = /*#__PURE__*/function () {
let fiber = undefined;
return () => {
if (fiber === undefined) {
fiber = Effect.runFork(Effect.interrupt);
}
return fiber;
};
}();
/**
* Fork an Effect and add the forked fiber to the FiberSet.
* When the fiber completes, it will be removed from the FiberSet.
*
* @since 2.0.0
* @categories combinators
*/
export const run = function () {
const self = arguments[0];
if (!Effect.isEffect(arguments[1])) {
const options = arguments[1];
return effect => runImpl(self, effect, options);
}
return runImpl(self, arguments[1], arguments[2]);
};
const runImpl = (self, effect, options) => Effect.fiberIdWith(fiberId => {
if (self.state._tag === "Closed") {
return Effect.sync(constInterruptedFiber);
}
return Effect.tap(Effect.forkDaemon(effect), fiber => unsafeAdd(self, fiber, {
...options,
interruptAs: fiberId
}));
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
*
* @example
* ```ts
* import { Context, Effect, FiberSet } from "effect"
*
* interface Users {
* readonly _: unique symbol
* }
* const Users = Context.GenericTag<Users, {
* getAll: Effect.Effect<Array<unknown>>
* }>("Users")
*
* Effect.gen(function*() {
* const set = yield* FiberSet.make()
* const run = yield* FiberSet.runtime(set)<Users>()
*
* // run some effects and add the fibers to the set
* run(Effect.andThen(Users, _ => _.getAll))
* }).pipe(
* Effect.scoped // The fibers will be interrupted when the scope is closed
* )
* ```
*
* @since 2.0.0
* @categories combinators
*/
export const runtime = self => () => Effect.map(Effect.runtime(), runtime => {
const runFork = Runtime.runFork(runtime);
return (effect, options) => {
if (self.state._tag === "Closed") {
return constInterruptedFiber();
}
const fiber = runFork(effect, options);
unsafeAdd(self, fiber);
return fiber;
};
});
/**
* Capture a Runtime and use it to fork Effect's, adding the forked fibers to the FiberSet.
*
* The returned run function will return Promise's.
*
* @since 3.13.0
* @categories combinators
*/
export const runtimePromise = self => () => Effect.map(runtime(self)(), runFork => (effect, options) => new Promise((resolve, reject) => runFork(effect, options).addObserver(exit => {
if (Exit.isSuccess(exit)) {
resolve(exit.value);
} else {
reject(Cause.squash(exit.cause));
}
})));
/**
* @since 2.0.0
* @categories combinators
*/
export const size = self => Effect.sync(() => self.state._tag === "Closed" ? 0 : self.state.backing.size);
/**
* Join all fibers in the FiberSet. If any of the Fiber's in the set terminate with a failure,
* the returned Effect will terminate with the first failure that occurred.
*
* @since 2.0.0
* @categories combinators
* @example
* ```ts
* import { Effect, FiberSet } from "effect";
*
* Effect.gen(function* (_) {
* const set = yield* _(FiberSet.make());
* yield* _(FiberSet.add(set, Effect.runFork(Effect.fail("error"))));
*
* // parent fiber will fail with "error"
* yield* _(FiberSet.join(set));
* });
* ```
*/
export const join = self => Deferred.await(self.deferred);
/**
* Wait until the fiber set is empty.
*
* @since 3.13.0
* @categories combinators
*/
export const awaitEmpty = self => Effect.whileLoop({
while: () => self.state._tag === "Open" && self.state.backing.size > 0,
body: () => Fiber.await(Iterable.unsafeHead(self)),
step: constVoid
});
//# sourceMappingURL=FiberSet.js.map

1
_node_modules/effect/dist/esm/FiberSet.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

52
_node_modules/effect/dist/esm/FiberStatus.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
import * as internal from "./internal/fiberStatus.js";
/**
* @since 2.0.0
* @category symbols
*/
export const FiberStatusTypeId = internal.FiberStatusTypeId;
/**
* @since 2.0.0
* @category constructors
*/
export const done = internal.done;
/**
* @since 2.0.0
* @category constructors
*/
export const running = internal.running;
/**
* @since 2.0.0
* @category constructors
*/
export const suspended = internal.suspended;
/**
* Returns `true` if the specified value is a `FiberStatus`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isFiberStatus = internal.isFiberStatus;
/**
* Returns `true` if the specified `FiberStatus` is `Done`, `false` otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isDone = internal.isDone;
/**
* Returns `true` if the specified `FiberStatus` is `Running`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isRunning = internal.isRunning;
/**
* Returns `true` if the specified `FiberStatus` is `Suspended`, `false`
* otherwise.
*
* @since 2.0.0
* @category refinements
*/
export const isSuspended = internal.isSuspended;
//# sourceMappingURL=FiberStatus.js.map

1
_node_modules/effect/dist/esm/FiberStatus.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"FiberStatus.js","names":["internal","FiberStatusTypeId","done","running","suspended","isFiberStatus","isDone","isRunning","isSuspended"],"sources":["../../src/FiberStatus.ts"],"sourcesContent":[null],"mappings":"AAKA,OAAO,KAAKA,QAAQ,MAAM,2BAA2B;AAGrD;;;;AAIA,OAAO,MAAMC,iBAAiB,GAAkBD,QAAQ,CAACC,iBAAiB;AA4C1E;;;;AAIA,OAAO,MAAMC,IAAI,GAAgBF,QAAQ,CAACE,IAAI;AAE9C;;;;AAIA,OAAO,MAAMC,OAAO,GAA6DH,QAAQ,CAACG,OAAO;AAEjG;;;;AAIA,OAAO,MAAMC,SAAS,GACpBJ,QAAQ,CAACI,SAAS;AAEpB;;;;;;AAMA,OAAO,MAAMC,aAAa,GAAqCL,QAAQ,CAACK,aAAa;AAErF;;;;;;AAMA,OAAO,MAAMC,MAAM,GAAwCN,QAAQ,CAACM,MAAM;AAE1E;;;;;;;AAOA,OAAO,MAAMC,SAAS,GAA2CP,QAAQ,CAACO,SAAS;AAEnF;;;;;;;AAOA,OAAO,MAAMC,WAAW,GAA6CR,QAAQ,CAACQ,WAAW","ignoreList":[]}

467
_node_modules/effect/dist/esm/Function.js generated vendored Normal file
View File

@@ -0,0 +1,467 @@
/**
* Tests if a value is a `function`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { isFunction } from "effect/Predicate"
*
* assert.deepStrictEqual(isFunction(isFunction), true)
* assert.deepStrictEqual(isFunction("function"), false)
* ```
*
* @category guards
* @since 2.0.0
*/
export const isFunction = input => typeof input === "function";
/**
* Creates a function that can be used in a data-last (aka `pipe`able) or
* data-first style.
*
* The first parameter to `dual` is either the arity of the uncurried function
* or a predicate that determines if the function is being used in a data-first
* or data-last style.
*
* Using the arity is the most common use case, but there are some cases where
* you may want to use a predicate. For example, if you have a function that
* takes an optional argument, you can use a predicate to determine if the
* function is being used in a data-first or data-last style.
*
* You can pass either the arity of the uncurried function or a predicate
* which determines if the function is being used in a data-first or
* data-last style.
*
* **Example** (Using arity to determine data-first or data-last style)
*
* ```ts
* import { dual, pipe } from "effect/Function"
*
* const sum = dual<
* (that: number) => (self: number) => number,
* (self: number, that: number) => number
* >(2, (self, that) => self + that)
*
* console.log(sum(2, 3)) // 5
* console.log(pipe(2, sum(3))) // 5
* ```
*
* **Example** (Using call signatures to define the overloads)
*
* ```ts
* import { dual, pipe } from "effect/Function"
*
* const sum: {
* (that: number): (self: number) => number
* (self: number, that: number): number
* } = dual(2, (self: number, that: number): number => self + that)
*
* console.log(sum(2, 3)) // 5
* console.log(pipe(2, sum(3))) // 5
* ```
*
* **Example** (Using a predicate to determine data-first or data-last style)
*
* ```ts
* import { dual, pipe } from "effect/Function"
*
* const sum = dual<
* (that: number) => (self: number) => number,
* (self: number, that: number) => number
* >(
* (args) => args.length === 2,
* (self, that) => self + that
* )
*
* console.log(sum(2, 3)) // 5
* console.log(pipe(2, sum(3))) // 5
* ```
*
* @since 2.0.0
*/
export const dual = function (arity, body) {
if (typeof arity === "function") {
return function () {
if (arity(arguments)) {
// @ts-expect-error
return body.apply(this, arguments);
}
return self => body(self, ...arguments);
};
}
switch (arity) {
case 0:
case 1:
throw new RangeError(`Invalid arity ${arity}`);
case 2:
return function (a, b) {
if (arguments.length >= 2) {
return body(a, b);
}
return function (self) {
return body(self, a);
};
};
case 3:
return function (a, b, c) {
if (arguments.length >= 3) {
return body(a, b, c);
}
return function (self) {
return body(self, a, b);
};
};
case 4:
return function (a, b, c, d) {
if (arguments.length >= 4) {
return body(a, b, c, d);
}
return function (self) {
return body(self, a, b, c);
};
};
case 5:
return function (a, b, c, d, e) {
if (arguments.length >= 5) {
return body(a, b, c, d, e);
}
return function (self) {
return body(self, a, b, c, d);
};
};
default:
return function () {
if (arguments.length >= arity) {
// @ts-expect-error
return body.apply(this, arguments);
}
const args = arguments;
return function (self) {
return body(self, ...args);
};
};
}
};
/**
* Apply a function to given values.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { pipe, apply } from "effect/Function"
* import { length } from "effect/String"
*
* assert.deepStrictEqual(pipe(length, apply("hello")), 5)
* ```
*
* @since 2.0.0
*/
export const apply = (...a) => self => self(...a);
/**
* The identity function, i.e. A function that returns its input argument.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { identity } from "effect/Function"
*
* assert.deepStrictEqual(identity(5), 5)
* ```
*
* @since 2.0.0
*/
export const identity = a => a;
/**
* A function that ensures that the type of an expression matches some type,
* without changing the resulting type of that expression.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { satisfies } from "effect/Function"
*
* const test1 = satisfies<number>()(5 as const)
* //^? const test: 5
* // @ts-expect-error
* const test2 = satisfies<string>()(5)
* //^? Argument of type 'number' is not assignable to parameter of type 'string'
*
* assert.deepStrictEqual(satisfies<number>()(5), 5)
* ```
*
* @since 2.0.0
*/
export const satisfies = () => b => b;
/**
* Casts the result to the specified type.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { unsafeCoerce, identity } from "effect/Function"
*
* assert.deepStrictEqual(unsafeCoerce, identity)
* ```
*
* @since 2.0.0
*/
export const unsafeCoerce = identity;
/**
* Creates a constant value that never changes.
*
* This is useful when you want to pass a value to a higher-order function (a function that takes another function as its argument)
* and want that inner function to always use the same value, no matter how many times it is called.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constant } from "effect/Function"
*
* const constNull = constant(null)
*
* assert.deepStrictEqual(constNull(), null)
* assert.deepStrictEqual(constNull(), null)
* ```
*
* @since 2.0.0
*/
export const constant = value => () => value;
/**
* A thunk that returns always `true`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constTrue } from "effect/Function"
*
* assert.deepStrictEqual(constTrue(), true)
* ```
*
* @since 2.0.0
*/
export const constTrue = /*#__PURE__*/constant(true);
/**
* A thunk that returns always `false`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constFalse } from "effect/Function"
*
* assert.deepStrictEqual(constFalse(), false)
* ```
*
* @since 2.0.0
*/
export const constFalse = /*#__PURE__*/constant(false);
/**
* A thunk that returns always `null`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constNull } from "effect/Function"
*
* assert.deepStrictEqual(constNull(), null)
* ```
*
* @since 2.0.0
*/
export const constNull = /*#__PURE__*/constant(null);
/**
* A thunk that returns always `undefined`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constUndefined } from "effect/Function"
*
* assert.deepStrictEqual(constUndefined(), undefined)
* ```
*
* @since 2.0.0
*/
export const constUndefined = /*#__PURE__*/constant(undefined);
/**
* A thunk that returns always `void`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { constVoid } from "effect/Function"
*
* assert.deepStrictEqual(constVoid(), undefined)
* ```
*
* @since 2.0.0
*/
export const constVoid = constUndefined;
/**
* Reverses the order of arguments for a curried function.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { flip } from "effect/Function"
*
* const f = (a: number) => (b: string) => a - b.length
*
* assert.deepStrictEqual(flip(f)('aaa')(2), -1)
* ```
*
* @since 2.0.0
*/
export const flip = f => (...b) => (...a) => f(...a)(...b);
/**
* Composes two functions, `ab` and `bc` into a single function that takes in an argument `a` of type `A` and returns a result of type `C`.
* The result is obtained by first applying the `ab` function to `a` and then applying the `bc` function to the result of `ab`.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { compose } from "effect/Function"
*
* const increment = (n: number) => n + 1;
* const square = (n: number) => n * n;
*
* assert.strictEqual(compose(increment, square)(2), 9);
* ```
*
* @since 2.0.0
*/
export const compose = /*#__PURE__*/dual(2, (ab, bc) => a => bc(ab(a)));
/**
* The `absurd` function is a stub for cases where a value of type `never` is encountered in your code,
* meaning that it should be impossible for this code to be executed.
*
* This function is particularly useful when it's necessary to specify that certain cases are impossible.
*
* @since 2.0.0
*/
export const absurd = _ => {
throw new Error("Called `absurd` function which should be uncallable");
};
/**
* Creates a version of this function: instead of `n` arguments, it accepts a single tuple argument.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { tupled } from "effect/Function"
*
* const sumTupled = tupled((x: number, y: number): number => x + y)
*
* assert.deepStrictEqual(sumTupled([1, 2]), 3)
* ```
*
* @since 2.0.0
*/
export const tupled = f => a => f(...a);
/**
* Inverse function of `tupled`
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { untupled } from "effect/Function"
*
* const getFirst = untupled(<A, B>(tuple: [A, B]): A => tuple[0])
*
* assert.deepStrictEqual(getFirst(1, 2), 1)
* ```
*
* @since 2.0.0
*/
export const untupled = f => (...a) => f(a);
export function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
switch (arguments.length) {
case 1:
return a;
case 2:
return ab(a);
case 3:
return bc(ab(a));
case 4:
return cd(bc(ab(a)));
case 5:
return de(cd(bc(ab(a))));
case 6:
return ef(de(cd(bc(ab(a)))));
case 7:
return fg(ef(de(cd(bc(ab(a))))));
case 8:
return gh(fg(ef(de(cd(bc(ab(a)))))));
case 9:
return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
default:
{
let ret = arguments[0];
for (let i = 1; i < arguments.length; i++) {
ret = arguments[i](ret);
}
return ret;
}
}
}
export function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
switch (arguments.length) {
case 1:
return ab;
case 2:
return function () {
return bc(ab.apply(this, arguments));
};
case 3:
return function () {
return cd(bc(ab.apply(this, arguments)));
};
case 4:
return function () {
return de(cd(bc(ab.apply(this, arguments))));
};
case 5:
return function () {
return ef(de(cd(bc(ab.apply(this, arguments)))));
};
case 6:
return function () {
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
};
case 7:
return function () {
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
};
case 8:
return function () {
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
};
case 9:
return function () {
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
};
}
return;
}
/**
* Type hole simulation.
*
* @since 2.0.0
*/
export const hole = /*#__PURE__*/unsafeCoerce(absurd);
/**
* The SK combinator, also known as the "S-K combinator" or "S-combinator", is a fundamental combinator in the
* lambda calculus and the SKI combinator calculus.
*
* This function is useful for discarding the first argument passed to it and returning the second argument.
*
* @example
* ```ts
* import * as assert from "node:assert"
* import { SK } from "effect/Function";
*
* assert.deepStrictEqual(SK(0, "hello"), "hello")
* ```
*
* @since 2.0.0
*/
export const SK = (_, b) => b;
//# sourceMappingURL=Function.js.map

1
_node_modules/effect/dist/esm/Function.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

52
_node_modules/effect/dist/esm/GlobalValue.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
/**
* The `GlobalValue` module ensures that a single instance of a value is created globally,
* even when modules are imported multiple times (e.g., due to mixing CommonJS and ESM builds)
* or during hot-reloading in development environments like Next.js or Remix.
*
* It achieves this by using a versioned global store, identified by a unique `Symbol` tied to
* the current version of the `effect` library. The store holds values that are keyed by an identifier,
* allowing the reuse of previously computed instances across imports or reloads.
*
* This pattern is particularly useful in scenarios where frequent reloading can cause services or
* single-instance objects to be recreated unnecessarily, such as in development environments with hot-reloading.
*
* @since 2.0.0
*/
const globalStoreId = `effect/GlobalValue`;
let globalStore;
/**
* Retrieves or computes a global value associated with the given `id`. If the value for this `id`
* has already been computed, it will be returned from the global store. If it does not exist yet,
* the provided `compute` function will be executed to compute the value, store it, and then return it.
*
* This ensures that even in cases where the module is imported multiple times (e.g., in mixed environments
* like CommonJS and ESM, or during hot-reloading in development), the value is computed only once and reused
* thereafter.
*
* @example
* ```ts
* import { globalValue } from "effect/GlobalValue"
*
* // This cache will persist as long as the module is running,
* // even if reloaded or imported elsewhere
* const myCache = globalValue(
* Symbol.for("myCache"),
* () => new WeakMap<object, number>()
* )
* ```
*
* @since 2.0.0
*/
export const globalValue = (id, compute) => {
if (!globalStore) {
// @ts-expect-error
globalThis[globalStoreId] ??= new Map();
// @ts-expect-error
globalStore = globalThis[globalStoreId];
}
if (!globalStore.has(id)) {
globalStore.set(id, compute());
}
return globalStore.get(id);
};
//# sourceMappingURL=GlobalValue.js.map

1
_node_modules/effect/dist/esm/GlobalValue.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"GlobalValue.js","names":["globalStoreId","globalStore","globalValue","id","compute","globalThis","Map","has","set","get"],"sources":["../../src/GlobalValue.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;AAcA,MAAMA,aAAa,GAAG,oBAAoB;AAE1C,IAAIC,WAA8B;AAElC;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,MAAMC,WAAW,GAAGA,CAAIC,EAAW,EAAEC,OAAgB,KAAO;EACjE,IAAI,CAACH,WAAW,EAAE;IAChB;IACAI,UAAU,CAACL,aAAa,CAAC,KAAK,IAAIM,GAAG,EAAE;IACvC;IACAL,WAAW,GAAGI,UAAU,CAACL,aAAa,CAAsB;EAC9D;EACA,IAAI,CAACC,WAAW,CAACM,GAAG,CAACJ,EAAE,CAAC,EAAE;IACxBF,WAAW,CAACO,GAAG,CAACL,EAAE,EAAEC,OAAO,EAAE,CAAC;EAChC;EACA,OAAOH,WAAW,CAACQ,GAAG,CAACN,EAAE,CAAE;AAC7B,CAAC","ignoreList":[]}

2905
_node_modules/effect/dist/esm/Graph.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
_node_modules/effect/dist/esm/Graph.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

39
_node_modules/effect/dist/esm/GroupBy.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
/**
* @since 2.0.0
*/
import * as internal from "./internal/groupBy.js";
/**
* @since 2.0.0
* @category symbols
*/
export const GroupByTypeId = internal.GroupByTypeId;
/**
* Run the function across all groups, collecting the results in an
* arbitrary order.
*
* @since 2.0.0
* @category destructors
*/
export const evaluate = internal.evaluate;
/**
* Filter the groups to be processed.
*
* @since 2.0.0
* @category utils
*/
export const filter = internal.filter;
/**
* Only consider the first `n` groups found in the `Stream`.
*
* @since 2.0.0
* @category utils
*/
export const first = internal.first;
/**
* Constructs a `GroupBy` from a `Stream`.
*
* @since 2.0.0
* @category constructors
*/
export const make = internal.make;
//# sourceMappingURL=GroupBy.js.map

1
_node_modules/effect/dist/esm/GroupBy.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"GroupBy.js","names":["internal","GroupByTypeId","evaluate","filter","first","make"],"sources":["../../src/GroupBy.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,QAAQ,MAAM,uBAAuB;AAQjD;;;;AAIA,OAAO,MAAMC,aAAa,GAAkBD,QAAQ,CAACC,aAAa;AAsClE;;;;;;;AAOA,OAAO,MAAMC,QAAQ,GAwBjBF,QAAQ,CAACE,QAAQ;AAErB;;;;;;AAMA,OAAO,MAAMC,MAAM,GAefH,QAAQ,CAACG,MAAM;AAEnB;;;;;;AAMA,OAAO,MAAMC,KAAK,GAedJ,QAAQ,CAACI,KAAK;AAElB;;;;;;AAMA,OAAO,MAAMC,IAAI,GAEUL,QAAQ,CAACK,IAAI","ignoreList":[]}

2
_node_modules/effect/dist/esm/HKT.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=HKT.js.map

1
_node_modules/effect/dist/esm/HKT.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"HKT.js","names":[],"sources":["../../src/HKT.ts"],"sourcesContent":[null],"mappings":"","ignoreList":[]}

163
_node_modules/effect/dist/esm/Hash.js generated vendored Normal file
View File

@@ -0,0 +1,163 @@
/**
* @since 2.0.0
*/
import { pipe } from "./Function.js";
import { globalValue } from "./GlobalValue.js";
import { hasProperty } from "./Predicate.js";
import { structuralRegionState } from "./Utils.js";
/** @internal */
const randomHashCache = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap());
/**
* @since 2.0.0
* @category symbols
*/
export const symbol = /*#__PURE__*/Symbol.for("effect/Hash");
/**
* @since 2.0.0
* @category hashing
*/
export const hash = self => {
if (structuralRegionState.enabled === true) {
return 0;
}
switch (typeof self) {
case "number":
return number(self);
case "bigint":
return string(self.toString(10));
case "boolean":
return string(String(self));
case "symbol":
return string(String(self));
case "string":
return string(self);
case "undefined":
return string("undefined");
case "function":
case "object":
{
if (self === null) {
return string("null");
} else if (self instanceof Date) {
return hash(self.toISOString());
} else if (self instanceof URL) {
return hash(self.href);
} else if (isHash(self)) {
return self[symbol]();
} else {
return random(self);
}
}
default:
throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
}
};
/**
* @since 2.0.0
* @category hashing
*/
export const random = self => {
if (!randomHashCache.has(self)) {
randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
}
return randomHashCache.get(self);
};
/**
* @since 2.0.0
* @category hashing
*/
export const combine = b => self => self * 53 ^ b;
/**
* @since 2.0.0
* @category hashing
*/
export const optimize = n => n & 0xbfffffff | n >>> 1 & 0x40000000;
/**
* @since 2.0.0
* @category guards
*/
export const isHash = u => hasProperty(u, symbol);
/**
* @since 2.0.0
* @category hashing
*/
export const number = n => {
if (n !== n || n === Infinity) {
return 0;
}
let h = n | 0;
if (h !== n) {
h ^= n * 0xffffffff;
}
while (n > 0xffffffff) {
h ^= n /= 0xffffffff;
}
return optimize(h);
};
/**
* @since 2.0.0
* @category hashing
*/
export const string = str => {
let h = 5381,
i = str.length;
while (i) {
h = h * 33 ^ str.charCodeAt(--i);
}
return optimize(h);
};
/**
* @since 2.0.0
* @category hashing
*/
export const structureKeys = (o, keys) => {
let h = 12289;
for (let i = 0; i < keys.length; i++) {
h ^= pipe(string(keys[i]), combine(hash(o[keys[i]])));
}
return optimize(h);
};
/**
* @since 2.0.0
* @category hashing
*/
export const structure = o => structureKeys(o, Object.keys(o));
/**
* @since 2.0.0
* @category hashing
*/
export const array = arr => {
let h = 6151;
for (let i = 0; i < arr.length; i++) {
h = pipe(h, combine(hash(arr[i])));
}
return optimize(h);
};
/**
* @since 2.0.0
* @category hashing
*/
export const cached = function () {
if (arguments.length === 1) {
const self = arguments[0];
return function (hash) {
Object.defineProperty(self, symbol, {
value() {
return hash;
},
enumerable: false
});
return hash;
};
}
const self = arguments[0];
const hash = arguments[1];
Object.defineProperty(self, symbol, {
value() {
return hash;
},
enumerable: false
});
return hash;
};
//# sourceMappingURL=Hash.js.map

1
_node_modules/effect/dist/esm/Hash.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Hash.js","names":["pipe","globalValue","hasProperty","structuralRegionState","randomHashCache","Symbol","for","WeakMap","symbol","hash","self","enabled","number","string","toString","String","Date","toISOString","URL","href","isHash","random","Error","has","set","Math","floor","Number","MAX_SAFE_INTEGER","get","combine","b","optimize","n","u","Infinity","h","str","i","length","charCodeAt","structureKeys","o","keys","structure","Object","array","arr","cached","arguments","defineProperty","value","enumerable"],"sources":["../../src/Hash.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,IAAI,QAAQ,eAAe;AACpC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,qBAAqB,QAAQ,YAAY;AAElD;AACA,MAAMC,eAAe,gBAAGH,WAAW,cACjCI,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC,EACzC,MAAM,IAAIC,OAAO,EAAkB,CACpC;AAED;;;;AAIA,OAAO,MAAMC,MAAM,gBAAkBH,MAAM,CAACC,GAAG,CAAC,aAAa,CAAC;AAU9D;;;;AAIA,OAAO,MAAMG,IAAI,GAA+BC,IAAO,IAAI;EACzD,IAAIP,qBAAqB,CAACQ,OAAO,KAAK,IAAI,EAAE;IAC1C,OAAO,CAAC;EACV;EAEA,QAAQ,OAAOD,IAAI;IACjB,KAAK,QAAQ;MACX,OAAOE,MAAM,CAACF,IAAI,CAAC;IACrB,KAAK,QAAQ;MACX,OAAOG,MA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A;MACH,OAAO1C,IAAI;IACb,CAAC;IACD2C,UAAU,EAAE;GACb,CAAC;EAEF,OAAO3C,IAAI;AACb,CAAC","ignoreList":[]}

Some files were not shown because too many files have changed in this diff Show More