Добавлена ДБ
This commit is contained in:
810
node_modules/effect/dist/cjs/Arbitrary.js
generated
vendored
Normal file
810
node_modules/effect/dist/cjs/Arbitrary.js
generated
vendored
Normal file
@@ -0,0 +1,810 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeStringConstraints = exports.makeNumberConstraints = exports.makeLazy = exports.makeDateConstraints = exports.makeBigIntConstraints = exports.makeArrayConstraints = exports.make = exports.getDescription = void 0;
|
||||
var Arr = _interopRequireWildcard(require("./Array.js"));
|
||||
var FastCheck = _interopRequireWildcard(require("./FastCheck.js"));
|
||||
var _GlobalValue = require("./GlobalValue.js");
|
||||
var errors_ = _interopRequireWildcard(require("./internal/schema/errors.js"));
|
||||
var schemaId_ = _interopRequireWildcard(require("./internal/schema/schemaId.js"));
|
||||
var util_ = _interopRequireWildcard(require("./internal/schema/util.js"));
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var Predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
var SchemaAST = _interopRequireWildcard(require("./SchemaAST.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 3.10.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a LazyArbitrary for the `A` type of the provided schema.
|
||||
*
|
||||
* @category arbitrary
|
||||
* @since 3.10.0
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.makeLazy = makeLazy;
|
||||
const make = schema => makeLazy(schema)(FastCheck);
|
||||
/** @internal */
|
||||
exports.make = make;
|
||||
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 */
|
||||
exports.makeStringConstraints = makeStringConstraints;
|
||||
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 */
|
||||
exports.makeNumberConstraints = makeNumberConstraints;
|
||||
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 */
|
||||
exports.makeBigIntConstraints = makeBigIntConstraints;
|
||||
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 */
|
||||
exports.makeArrayConstraints = makeArrayConstraints;
|
||||
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;
|
||||
};
|
||||
exports.makeDateConstraints = makeDateConstraints;
|
||||
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__*/(0, _GlobalValue.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 */
|
||||
const getDescription = exports.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
|
||||
}) : makeNumberConstraints({
|
||||
isInteger: "type" in meta && meta.type === "integer",
|
||||
noNaN: "type" in meta && meta.type === "number" ? true : undefined,
|
||||
noDefaultInfinity: "type" in meta && meta.type === "number" ? true : 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__*/(0, _GlobalValue.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/cjs/Arbitrary.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Arbitrary.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2656
node_modules/effect/dist/cjs/Array.js
generated
vendored
Normal file
2656
node_modules/effect/dist/cjs/Array.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/Array.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Array.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1116
node_modules/effect/dist/cjs/BigDecimal.js
generated
vendored
Normal file
1116
node_modules/effect/dist/cjs/BigDecimal.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/BigDecimal.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/BigDecimal.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
567
node_modules/effect/dist/cjs/BigInt.js
generated
vendored
Normal file
567
node_modules/effect/dist/cjs/BigInt.js
generated
vendored
Normal file
@@ -0,0 +1,567 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeSqrt = exports.unsafeDivide = exports.toNumber = exports.sumAll = exports.sum = exports.subtract = exports.sqrt = exports.sign = exports.multiplyAll = exports.multiply = exports.min = exports.max = exports.lessThanOrEqualTo = exports.lessThan = exports.lcm = exports.isBigInt = exports.increment = exports.greaterThanOrEqualTo = exports.greaterThan = exports.gcd = exports.fromString = exports.fromNumber = exports.divide = exports.decrement = exports.clamp = exports.between = exports.abs = exports.Order = exports.Equivalence = void 0;
|
||||
var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var order = _interopRequireWildcard(require("./Order.js"));
|
||||
var predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
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
|
||||
*/
|
||||
const isBigInt = exports.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
|
||||
*/
|
||||
const sum = exports.sum = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const multiply = exports.multiply = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const subtract = exports.subtract = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const divide = exports.divide = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const unsafeDivide = exports.unsafeDivide = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.increment = increment;
|
||||
const decrement = n => n - bigint1;
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.decrement = decrement;
|
||||
const Equivalence = exports.Equivalence = equivalence.bigint;
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const Order = exports.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
|
||||
*/
|
||||
const lessThan = exports.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
|
||||
*/
|
||||
const lessThanOrEqualTo = exports.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
|
||||
*/
|
||||
const greaterThan = exports.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
|
||||
*/
|
||||
const greaterThanOrEqualTo = exports.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
|
||||
*/
|
||||
const between = exports.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
|
||||
*/
|
||||
const clamp = exports.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
|
||||
*/
|
||||
const min = exports.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
|
||||
*/
|
||||
const max = exports.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.sign = sign;
|
||||
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
|
||||
*/
|
||||
exports.abs = abs;
|
||||
const gcd = exports.gcd = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const lcm = exports.lcm = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.unsafeSqrt = unsafeSqrt;
|
||||
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
|
||||
*/
|
||||
exports.sqrt = sqrt;
|
||||
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
|
||||
*/
|
||||
exports.sumAll = sumAll;
|
||||
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
|
||||
*/
|
||||
exports.multiplyAll = multiplyAll;
|
||||
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
|
||||
*/
|
||||
exports.toNumber = toNumber;
|
||||
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
|
||||
*/
|
||||
exports.fromString = fromString;
|
||||
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();
|
||||
}
|
||||
};
|
||||
exports.fromNumber = fromNumber;
|
||||
//# sourceMappingURL=BigInt.js.map
|
||||
1
node_modules/effect/dist/cjs/BigInt.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/BigInt.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
251
node_modules/effect/dist/cjs/Boolean.js
generated
vendored
Normal file
251
node_modules/effect/dist/cjs/Boolean.js
generated
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.xor = exports.some = exports.or = exports.not = exports.nor = exports.nand = exports.match = exports.isBoolean = exports.implies = exports.every = exports.eqv = exports.and = exports.Order = exports.Equivalence = void 0;
|
||||
var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var order = _interopRequireWildcard(require("./Order.js"));
|
||||
var predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
const isBoolean = exports.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
|
||||
*/
|
||||
const match = exports.match = /*#__PURE__*/(0, _Function.dual)(2, (value, options) => value ? options.onTrue() : options.onFalse());
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const Equivalence = exports.Equivalence = equivalence.boolean;
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const Order = exports.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.not = not;
|
||||
const and = exports.and = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const nand = exports.nand = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const or = exports.or = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const nor = exports.nor = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const xor = exports.xor = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const eqv = exports.eqv = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const implies = exports.implies = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.every = every;
|
||||
const some = collection => {
|
||||
for (const b of collection) {
|
||||
if (b) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
exports.some = some;
|
||||
//# sourceMappingURL=Boolean.js.map
|
||||
1
node_modules/effect/dist/cjs/Boolean.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Boolean.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Boolean.js","names":["equivalence","_interopRequireWildcard","require","_Function","order","predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isBoolean","exports","match","dual","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":";;;;;;AAOA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA2C,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CA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,IAAI,KAAKF,IAAI,GAAGE,IAAI,GAAG,IAAI,CAAC;AAE/C;;;;;;;;;;;;;;AAcO,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;;;;;;;;;;;;;;AAAAtB,OAAA,CAAAoB,KAAA,GAAAA,KAAA;AAcO,MAAMG,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;AAAAtB,OAAA,CAAAuB,IAAA,GAAAA,IAAA","ignoreList":[]}
|
||||
175
node_modules/effect/dist/cjs/Brand.js
generated
vendored
Normal file
175
node_modules/effect/dist/cjs/Brand.js
generated
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.nominal = exports.errors = exports.error = exports.all = exports.RefinedConstructorsTypeId = exports.BrandTypeId = void 0;
|
||||
exports.refined = refined;
|
||||
exports.unbranded = void 0;
|
||||
var Arr = _interopRequireWildcard(require("./Array.js"));
|
||||
var Either = _interopRequireWildcard(require("./Either.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const BrandTypeId = exports.BrandTypeId = /*#__PURE__*/Symbol.for("effect/Brand");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const RefinedConstructorsTypeId = exports.RefinedConstructorsTypeId = /*#__PURE__*/Symbol.for("effect/Brand/Refined");
|
||||
/**
|
||||
* Returns a `BrandErrors` that contains a single `RefinementError`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.error = error;
|
||||
const errors = (...errors) => Arr.flatten(errors);
|
||||
exports.errors = errors;
|
||||
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), _Function.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.nominal = nominal;
|
||||
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: _Function.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
|
||||
*/
|
||||
exports.all = all;
|
||||
const unbranded = exports.unbranded = _Function.unsafeCoerce;
|
||||
//# sourceMappingURL=Brand.js.map
|
||||
1
node_modules/effect/dist/cjs/Brand.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Brand.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Brand.js","names":["Arr","_interopRequireWildcard","require","Either","_Function","Option","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BrandTypeId","exports","Symbol","for","RefinedConstructorsTypeId","error","message","meta","errors","flatten","refined","args","either","length","unbranded","right","left","match","onNone","onSome","assign","getOrThrowWith","identity","option","getRight","is","isRight","nominal","some","_args","all","brands","result","brand","nextResult","isLeft","onLeft","onRight","unsafeCoerce"],"sources":["../../src/Brand.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAkBA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAqC,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAA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MAAM,CAAChB,IAAI,EAAE,GAAGkB,UAAU,CAAClB,IAAI,CAAC,CAAC;MAC5D,CAAC,MAAM;QACLgB,MAAM,GAAGtD,MAAM,CAACyD,MAAM,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAGE,UAAU;MACtD;IACF;IACA,OAAOF,MAAM;EACf,CAAC;EACD;EACA,OAAOnC,MAAM,CAACuB,MAAM,CAAET,IAAI,IACxBjC,MAAM,CAACuC,KAAK,CAACL,MAAM,CAACD,IAAI,CAAC,EAAE;IACzByB,MAAM,EAAGvD,CAAC,IAAI;MACZ,MAAMA,CAAC;IACT,CAAC;IACDwD,OAAO,EAAEf;GACV,CAAC,EAAE;IACJ,CAAClB,yBAAyB,GAAGA,yBAAyB;IACtDmB,MAAM,EAAGZ,IAAS,IAAK/B,MAAM,CAAC4C,QAAQ,CAACZ,MAAM,CAACD,IAAI,CAAC,CAAC;IACpDC,MAAM;IACNa,EAAE,EAAGd,IAAS,IAAkBjC,MAAM,CAACgD,OAAO,CAACd,MAAM,CAACD,IAAI,CAAC;GAC5D,CAAC;AACJ,CAAC;AAED;;;;;;AAAAV,OAAA,CAAA6B,GAAA,GAAAA,GAAA;AAMO,MAAMhB,SAAS,GAAAb,OAAA,CAAAa,SAAA,GAA6DwB,sBAAY","ignoreList":[]}
|
||||
50
node_modules/effect/dist/cjs/Cache.js
generated
vendored
Normal file
50
node_modules/effect/dist/cjs/Cache.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeWith = exports.makeEntryStats = exports.makeCacheStats = exports.make = exports.ConsumerCacheTypeId = exports.CacheTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/cache.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const CacheTypeId = exports.CacheTypeId = internal.CacheTypeId;
|
||||
/**
|
||||
* @since 3.6.4
|
||||
* @category symbols
|
||||
*/
|
||||
const ConsumerCacheTypeId = exports.ConsumerCacheTypeId = internal.ConsumerCacheTypeId;
|
||||
/**
|
||||
* Constructs a new cache with the specified capacity, time to live, and
|
||||
* lookup function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.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
|
||||
*/
|
||||
const makeWith = exports.makeWith = internal.makeWith;
|
||||
/**
|
||||
* Constructs a new `CacheStats` from the specified values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeCacheStats = exports.makeCacheStats = internal.makeCacheStats;
|
||||
/**
|
||||
* Constructs a new `EntryStats` from the specified values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeEntryStats = exports.makeEntryStats = internal.makeEntryStats;
|
||||
//# sourceMappingURL=Cache.js.map
|
||||
1
node_modules/effect/dist/cjs/Cache.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Cache.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Cache.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CacheTypeId","exports","ConsumerCacheTypeId","make","makeWith","makeCacheStats","makeEntryStats"],"sources":["../../src/Cache.ts"],"sourcesContent":[null],"mappings":";;;;;;AAOA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+C,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAK/C;;;;AAIO,MAAMkB,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAkBtB,QAAQ,CAACsB,WAAW;AAQ9D;;;;AAIO,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAkBxB,QAAQ,CAACwB,mBAAmB;AAsK9E;;;;;;;AAOO,MAAMC,IAAI,GAAAF,OAAA,CAAAE,IAAA,GAMkDzB,QAAQ,CAACyB,IAAI;AAEhF;;;;;;;;AAQO,MAAMC,QAAQ,GAAAH,OAAA,CAAAG,QAAA,GAM8C1B,QAAQ,CAAC0B,QAAQ;AAepF;;;;;;AAMO,MAAMC,cAAc,GAAAJ,OAAA,CAAAI,cAAA,GAMT3B,QAAQ,CAAC2B,cAAc;AAYzC;;;;;;AAMO,MAAMC,cAAc,GAAAL,OAAA,CAAAK,cAAA,GAAyC5B,QAAQ,CAAC4B,cAAc","ignoreList":[]}
|
||||
1011
node_modules/effect/dist/cjs/Cause.js
generated
vendored
Normal file
1011
node_modules/effect/dist/cjs/Cause.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/Cause.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Cause.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
889
node_modules/effect/dist/cjs/Channel.js
generated
vendored
Normal file
889
node_modules/effect/dist/cjs/Channel.js
generated
vendored
Normal file
@@ -0,0 +1,889 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toSink = exports.toQueue = exports.toPullIn = exports.toPull = exports.toPubSub = exports.sync = exports.suspend = exports.succeed = exports.splitLines = exports.scopedWith = exports.scoped = exports.runScoped = exports.runDrain = exports.runCollect = exports.run = exports.repeated = exports.readWithCause = exports.readWith = exports.readOrFail = exports.read = exports.provideSomeLayer = exports.provideService = exports.provideLayer = exports.provideContext = exports.pipeToOrFail = exports.pipeTo = exports.orElse = exports.orDieWith = exports.orDie = exports.never = exports.mergeWith = exports.mergeOutWith = exports.mergeOut = exports.mergeMap = exports.mergeAllWith = exports.mergeAllUnboundedWith = exports.mergeAllUnbounded = exports.mergeAll = exports.mapOutEffectPar = exports.mapOutEffect = exports.mapOut = exports.mapInputInEffect = exports.mapInputIn = exports.mapInputErrorEffect = exports.mapInputError = exports.mapInputEffect = exports.mapInputContext = exports.mapInput = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.map = exports.isChannelException = exports.isChannel = exports.interruptWhenDeferred = exports.interruptWhen = exports.identity = exports.fromQueue = exports.fromPubSubScoped = exports.fromPubSub = exports.fromOption = exports.fromInput = exports.fromEither = exports.fromEffect = exports.foldChannel = exports.foldCauseChannel = exports.flatten = exports.flatMap = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.ensuringWith = exports.ensuring = exports.emitCollect = exports.embedInput = exports.drain = exports.doneCollect = exports.contextWithEffect = exports.contextWithChannel = exports.contextWith = exports.context = exports.concatOut = exports.concatMapWithCustom = exports.concatMapWith = exports.concatMap = exports.concatAllWith = exports.concatAll = exports.collect = exports.catchAllCause = exports.catchAll = exports.bufferChunk = exports.buffer = exports.asVoid = exports.as = exports.acquireUseRelease = exports.acquireReleaseOut = exports.ChannelTypeId = exports.ChannelExceptionTypeId = exports.ChannelException = void 0;
|
||||
exports.zipRight = exports.zipLeft = exports.zip = exports.writeChunk = exports.writeAll = exports.write = exports.withSpan = exports.void = exports.updateService = exports.unwrapScopedWith = exports.unwrapScoped = exports.unwrap = exports.toStream = void 0;
|
||||
var channel = _interopRequireWildcard(require("./internal/channel.js"));
|
||||
var core = _interopRequireWildcard(require("./internal/core-stream.js"));
|
||||
var sink = _interopRequireWildcard(require("./internal/sink.js"));
|
||||
var stream = _interopRequireWildcard(require("./internal/stream.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ChannelTypeId = exports.ChannelTypeId = core.ChannelTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ChannelExceptionTypeId = exports.ChannelExceptionTypeId = channel.ChannelExceptionTypeId;
|
||||
/**
|
||||
* @since 3.5.4
|
||||
* @category refinements
|
||||
*/
|
||||
const isChannel = exports.isChannel = core.isChannel;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const acquireUseRelease = exports.acquireUseRelease = channel.acquireUseRelease;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const acquireReleaseOut = exports.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
|
||||
*/
|
||||
const as = exports.as = channel.as;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const asVoid = exports.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
|
||||
*/
|
||||
const buffer = exports.buffer = channel.buffer;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const bufferChunk = exports.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
|
||||
*/
|
||||
const catchAll = exports.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
|
||||
*/
|
||||
const catchAllCause = exports.catchAllCause = core.catchAllCause;
|
||||
/**
|
||||
* Concat sequentially a channel of channels.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const concatAll = exports.concatAll = core.concatAll;
|
||||
/**
|
||||
* Concat sequentially a channel of channels.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const concatAllWith = exports.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
|
||||
*/
|
||||
const concatMap = exports.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
|
||||
*/
|
||||
const concatMapWith = exports.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
|
||||
*/
|
||||
const concatMapWithCustom = exports.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
|
||||
*/
|
||||
const collect = exports.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
|
||||
*/
|
||||
const concatOut = exports.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
|
||||
*/
|
||||
const mapInput = exports.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
|
||||
*/
|
||||
const mapInputEffect = exports.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
|
||||
*/
|
||||
const mapInputError = exports.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
|
||||
*/
|
||||
const mapInputErrorEffect = exports.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
|
||||
*/
|
||||
const mapInputIn = exports.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
|
||||
*/
|
||||
const mapInputInEffect = exports.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
|
||||
*/
|
||||
const doneCollect = exports.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
|
||||
*/
|
||||
const drain = exports.drain = channel.drain;
|
||||
/**
|
||||
* Returns a new channel which connects the given `AsyncInputProducer` as
|
||||
* this channel's input.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const embedInput = exports.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
|
||||
*/
|
||||
const emitCollect = exports.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
|
||||
*/
|
||||
const ensuring = exports.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
|
||||
*/
|
||||
const ensuringWith = exports.ensuringWith = core.ensuringWith;
|
||||
/**
|
||||
* Accesses the whole context of the channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const context = exports.context = channel.context;
|
||||
/**
|
||||
* Accesses the context of the channel with the specified function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const contextWith = exports.contextWith = channel.contextWith;
|
||||
/**
|
||||
* Accesses the context of the channel in the context of a channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const contextWithChannel = exports.contextWithChannel = channel.contextWithChannel;
|
||||
/**
|
||||
* Accesses the context of the channel in the context of an effect.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const contextWithEffect = exports.contextWithEffect = channel.contextWithEffect;
|
||||
/**
|
||||
* Constructs a channel that fails immediately with the specified error.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fail = exports.fail = core.fail;
|
||||
/**
|
||||
* Constructs a channel that succeeds immediately with the specified lazily
|
||||
* evaluated value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const failSync = exports.failSync = core.failSync;
|
||||
/**
|
||||
* Constructs a channel that fails immediately with the specified `Cause`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const failCause = exports.failCause = core.failCause;
|
||||
/**
|
||||
* Constructs a channel that succeeds immediately with the specified lazily
|
||||
* evaluated `Cause`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const failCauseSync = exports.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
|
||||
*/
|
||||
const flatMap = exports.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
|
||||
*/
|
||||
const flatten = exports.flatten = channel.flatten;
|
||||
/**
|
||||
* Folds over the result of this channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const foldChannel = exports.foldChannel = channel.foldChannel;
|
||||
/**
|
||||
* Folds over the result of this channel including any cause of termination.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const foldCauseChannel = exports.foldCauseChannel = core.foldCauseChannel;
|
||||
/**
|
||||
* Use an effect to end a channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromEffect = exports.fromEffect = core.fromEffect;
|
||||
/**
|
||||
* Constructs a channel from an `Either`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromEither = exports.fromEither = channel.fromEither;
|
||||
/**
|
||||
* Construct a `Channel` from an `AsyncInputConsumer`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromInput = exports.fromInput = channel.fromInput;
|
||||
/**
|
||||
* Construct a `Channel` from a `PubSub`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromPubSub = exports.fromPubSub = channel.fromPubSub;
|
||||
/**
|
||||
* Construct a `Channel` from a `PubSub` within a scoped effect.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromPubSubScoped = exports.fromPubSubScoped = channel.fromPubSubScoped;
|
||||
/**
|
||||
* Construct a `Channel` from an `Option`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromOption = exports.fromOption = channel.fromOption;
|
||||
/**
|
||||
* Construct a `Channel` from a `Queue`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromQueue = exports.fromQueue = channel.fromQueue;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const identity = exports.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
|
||||
*/
|
||||
const interruptWhen = exports.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
|
||||
*/
|
||||
const interruptWhenDeferred = exports.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
|
||||
*/
|
||||
const map = exports.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
|
||||
*/
|
||||
const mapEffect = exports.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
|
||||
*/
|
||||
const mapError = exports.mapError = channel.mapError;
|
||||
/**
|
||||
* A more powerful version of `mapError` which also surfaces the `Cause`
|
||||
* of the channel failure.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const mapErrorCause = exports.mapErrorCause = channel.mapErrorCause;
|
||||
/**
|
||||
* Maps the output of this channel using the specified function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const mapOut = exports.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
|
||||
*/
|
||||
const mapOutEffect = exports.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
|
||||
*/
|
||||
const mapOutEffectPar = exports.mapOutEffectPar = channel.mapOutEffectPar;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const mergeAll = exports.mergeAll = channel.mergeAll;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const mergeAllUnbounded = exports.mergeAllUnbounded = channel.mergeAllUnbounded;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const mergeAllUnboundedWith = exports.mergeAllUnboundedWith = channel.mergeAllUnboundedWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const mergeAllWith = exports.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
|
||||
*/
|
||||
const mergeMap = exports.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
|
||||
*/
|
||||
const mergeOut = exports.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
|
||||
*/
|
||||
const mergeOutWith = exports.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
|
||||
*/
|
||||
const mergeWith = exports.mergeWith = channel.mergeWith;
|
||||
/**
|
||||
* Returns a channel that never completes
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const never = exports.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
|
||||
*/
|
||||
const orDie = exports.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
|
||||
*/
|
||||
const orDieWith = exports.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
|
||||
*/
|
||||
const orElse = exports.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
|
||||
*/
|
||||
const pipeTo = exports.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
|
||||
*/
|
||||
const pipeToOrFail = exports.pipeToOrFail = channel.pipeToOrFail;
|
||||
/**
|
||||
* Provides the channel with its required context, which eliminates its
|
||||
* dependency on `Env`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const provideContext = exports.provideContext = core.provideContext;
|
||||
/**
|
||||
* Provides a layer to the channel, which translates it to another level.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const provideLayer = exports.provideLayer = channel.provideLayer;
|
||||
/**
|
||||
* Transforms the context being provided to the channel with the specified
|
||||
* function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const mapInputContext = exports.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
|
||||
*/
|
||||
const provideSomeLayer = exports.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
|
||||
*/
|
||||
const provideService = exports.provideService = channel.provideService;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const read = exports.read = channel.read;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const readOrFail = exports.readOrFail = core.readOrFail;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const readWith = exports.readWith = core.readWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const readWithCause = exports.readWithCause = core.readWithCause;
|
||||
/**
|
||||
* Creates a channel which repeatedly runs this channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const repeated = exports.repeated = channel.repeated;
|
||||
/**
|
||||
* Runs a channel until the end is received.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const run = exports.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
|
||||
*/
|
||||
const runCollect = exports.runCollect = channel.runCollect;
|
||||
/**
|
||||
* Runs a channel until the end is received.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const runDrain = exports.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
|
||||
*/
|
||||
const runScoped = exports.runScoped = channel.runScoped;
|
||||
/**
|
||||
* Use a scoped effect to emit an output element.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const scoped = exports.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
|
||||
*/
|
||||
const scopedWith = exports.scopedWith = channel.scopedWith;
|
||||
/**
|
||||
* Splits strings on newlines. Handles both Windows newlines (`\r\n`) and UNIX
|
||||
* newlines (`\n`).
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category combinators
|
||||
*/
|
||||
const splitLines = exports.splitLines = channel.splitLines;
|
||||
/**
|
||||
* Constructs a channel that succeeds immediately with the specified value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const succeed = exports.succeed = core.succeed;
|
||||
/**
|
||||
* Lazily constructs a channel from the given side effect.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const suspend = exports.suspend = core.suspend;
|
||||
/**
|
||||
* Constructs a channel that succeeds immediately with the specified lazy value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const sync = exports.sync = core.sync;
|
||||
/**
|
||||
* Converts a `Channel` to a `PubSub`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toPubSub = exports.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
|
||||
*/
|
||||
const toPull = exports.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
|
||||
*/
|
||||
const toPullIn = exports.toPullIn = channel.toPullIn;
|
||||
/**
|
||||
* Converts a `Channel` to a `Queue`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toQueue = exports.toQueue = channel.toQueue;
|
||||
/** Converts this channel to a `Sink`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toSink = exports.toSink = sink.channelToSink;
|
||||
/**
|
||||
* Converts this channel to a `Stream`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toStream = exports.toStream = stream.channelToStream;
|
||||
const void_ = exports.void = core.void;
|
||||
/**
|
||||
* Constructs a `Channel` from an effect that will result in a `Channel` if
|
||||
* successful.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unwrap = exports.unwrap = channel.unwrap;
|
||||
/**
|
||||
* Constructs a `Channel` from a scoped effect that will result in a
|
||||
* `Channel` if successful.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unwrapScoped = exports.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
|
||||
*/
|
||||
const unwrapScopedWith = exports.unwrapScopedWith = channel.unwrapScopedWith;
|
||||
/**
|
||||
* Updates a service in the context of this channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const updateService = exports.updateService = channel.updateService;
|
||||
/**
|
||||
* Wraps the channel with a new span for tracing.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category tracing
|
||||
*/
|
||||
const withSpan = exports.withSpan = channel.withSpan;
|
||||
/**
|
||||
* Writes a single value to the channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const write = exports.write = core.write;
|
||||
/**
|
||||
* Writes a sequence of values to the channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const writeAll = exports.writeAll = channel.writeAll;
|
||||
/**
|
||||
* Writes a `Chunk` of values to the channel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const writeChunk = exports.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
|
||||
*/
|
||||
const zip = exports.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
|
||||
*/
|
||||
const zipLeft = exports.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
|
||||
*/
|
||||
const zipRight = exports.zipRight = channel.zipRight;
|
||||
/**
|
||||
* Represents a generic checked exception which occurs when a `Channel` is
|
||||
* executed.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category errors
|
||||
*/
|
||||
const ChannelException = exports.ChannelException = channel.ChannelException;
|
||||
/**
|
||||
* Returns `true` if the specified value is an `ChannelException`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isChannelException = exports.isChannelException = channel.isChannelException;
|
||||
//# sourceMappingURL=Channel.js.map
|
||||
1
node_modules/effect/dist/cjs/Channel.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Channel.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
72
node_modules/effect/dist/cjs/ChildExecutorDecision.js
generated
vendored
Normal file
72
node_modules/effect/dist/cjs/ChildExecutorDecision.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.match = exports.isYield = exports.isContinue = exports.isClose = exports.isChildExecutorDecision = exports.Yield = exports.Continue = exports.Close = exports.ChildExecutorDecisionTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/channel/childExecutorDecision.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ChildExecutorDecisionTypeId = exports.ChildExecutorDecisionTypeId = internal.ChildExecutorDecisionTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const Continue = exports.Continue = internal.Continue;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const Close = exports.Close = internal.Close;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const Yield = exports.Yield = internal.Yield;
|
||||
/**
|
||||
* Returns `true` if the specified value is a `ChildExecutorDecision`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isChildExecutorDecision = exports.isChildExecutorDecision = internal.isChildExecutorDecision;
|
||||
/**
|
||||
* Returns `true` if the specified `ChildExecutorDecision` is a `Continue`,
|
||||
* `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isContinue = exports.isContinue = internal.isContinue;
|
||||
/**
|
||||
* Returns `true` if the specified `ChildExecutorDecision` is a `Close`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isClose = exports.isClose = internal.isClose;
|
||||
/**
|
||||
* Returns `true` if the specified `ChildExecutorDecision` is a `Yield`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isYield = exports.isYield = internal.isYield;
|
||||
/**
|
||||
* Folds over a `ChildExecutorDecision` to produce a value of type `A`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const match = exports.match = internal.match;
|
||||
//# sourceMappingURL=ChildExecutorDecision.js.map
|
||||
1
node_modules/effect/dist/cjs/ChildExecutorDecision.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ChildExecutorDecision.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ChildExecutorDecision.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChildExecutorDecisionTypeId","exports","Continue","Close","Yield","isChildExecutorDecision","isContinue","isClose","isYield","match"],"sources":["../../src/ChildExecutorDecision.ts"],"sourcesContent":[null],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuE,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CA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;;;;AAOO,MAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAsD5B,QAAQ,CAAC4B,UAAU;AAEhG;;;;;;;AAOO,MAAMC,OAAO,GAAAN,OAAA,CAAAM,OAAA,GAAmD7B,QAAQ,CAAC6B,OAAO;AAEvF;;;;;;;AAOO,MAAMC,OAAO,GAAAP,OAAA,CAAAO,OAAA,GAAmD9B,QAAQ,CAAC8B,OAAO;AAEvF;;;;;;AAMO,MAAMC,KAAK,GAAAR,OAAA,CAAAQ,KAAA,GA4Bd/B,QAAQ,CAAC+B,KAAK","ignoreList":[]}
|
||||
1114
node_modules/effect/dist/cjs/Chunk.js
generated
vendored
Normal file
1114
node_modules/effect/dist/cjs/Chunk.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/Chunk.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Chunk.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
node_modules/effect/dist/cjs/Clock.js
generated
vendored
Normal file
45
node_modules/effect/dist/cjs/Clock.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.sleep = exports.make = exports.currentTimeNanos = exports.currentTimeMillis = exports.clockWith = exports.ClockTypeId = exports.Clock = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/clock.js"));
|
||||
var defaultServices = _interopRequireWildcard(require("./internal/defaultServices.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ClockTypeId = exports.ClockTypeId = internal.ClockTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = internal.make;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const sleep = exports.sleep = defaultServices.sleep;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const currentTimeMillis = exports.currentTimeMillis = defaultServices.currentTimeMillis;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const currentTimeNanos = exports.currentTimeNanos = defaultServices.currentTimeNanos;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const clockWith = exports.clockWith = defaultServices.clockWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const Clock = exports.Clock = internal.clockTag;
|
||||
//# sourceMappingURL=Clock.js.map
|
||||
1
node_modules/effect/dist/cjs/Clock.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Clock.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Clock.js","names":["internal","_interopRequireWildcard","require","defaultServices","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ClockTypeId","exports","make","sleep","currentTimeMillis","currentTimeNanos","clockWith","Clock","clockTag"],"sources":["../../src/Clock.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,uBAAA,CAAAC,OAAA;AAAgE,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,O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CAACwB,iBAAiB;AAEzF;;;;AAIO,MAAMC,gBAAgB,GAAAJ,OAAA,CAAAI,gBAAA,GAA0BzB,eAAe,CAACyB,gBAAgB;AAEvF;;;;AAIO,MAAMC,SAAS,GAAAL,OAAA,CAAAK,SAAA,GACpB1B,eAAe,CAAC0B,SAAS;AAE3B;;;;AAIO,MAAMC,KAAK,GAAAN,OAAA,CAAAM,KAAA,GAA8B9B,QAAQ,CAAC+B,QAAQ","ignoreList":[]}
|
||||
328
node_modules/effect/dist/cjs/Config.js
generated
vendored
Normal file
328
node_modules/effect/dist/cjs/Config.js
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zipWith = exports.zip = exports.withDescription = exports.withDefault = exports.validate = exports.url = exports.unwrap = exports.sync = exports.suspend = exports.succeed = exports.string = exports.secret = exports.repeat = exports.redacted = exports.primitive = exports.port = exports.orElseIf = exports.orElse = exports.option = exports.number = exports.nonEmptyString = exports.nested = exports.mapOrFail = exports.mapAttempt = exports.map = exports.logLevel = exports.literal = exports.isConfig = exports.integer = exports.hashSet = exports.hashMap = exports.fail = exports.duration = exports.date = exports.chunk = exports.branded = exports.boolean = exports.array = exports.all = exports.ConfigTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/config.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ConfigTypeId = exports.ConfigTypeId = internal.ConfigTypeId;
|
||||
/**
|
||||
* Constructs a config from a tuple / struct / arguments of configs.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const all = exports.all = internal.all;
|
||||
/**
|
||||
* Constructs a config for an array of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const array = exports.array = internal.array;
|
||||
/**
|
||||
* Constructs a config for a boolean value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const boolean = exports.boolean = internal.boolean;
|
||||
/**
|
||||
* Constructs a config for a network port [1, 65535].
|
||||
*
|
||||
* @since 3.16.0
|
||||
* @category constructors
|
||||
*/
|
||||
const port = exports.port = internal.port;
|
||||
/**
|
||||
* Constructs a config for an URL value.
|
||||
*
|
||||
* @since 3.11.0
|
||||
* @category constructors
|
||||
*/
|
||||
const url = exports.url = internal.url;
|
||||
/**
|
||||
* Constructs a config for a sequence of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const chunk = exports.chunk = internal.chunk;
|
||||
/**
|
||||
* Constructs a config for a date value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const date = exports.date = internal.date;
|
||||
/**
|
||||
* Constructs a config that fails with the specified message.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fail = exports.fail = internal.fail;
|
||||
/**
|
||||
* Constructs a config for a float value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const number = exports.number = internal.number;
|
||||
/**
|
||||
* Constructs a config for a integer value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const integer = exports.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
|
||||
*/
|
||||
const literal = exports.literal = internal.literal;
|
||||
/**
|
||||
* Constructs a config for a `LogLevel` value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const logLevel = exports.logLevel = internal.logLevel;
|
||||
/**
|
||||
* Constructs a config for a duration value.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @category constructors
|
||||
*/
|
||||
const duration = exports.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
|
||||
*/
|
||||
const isConfig = exports.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
|
||||
*/
|
||||
const map = exports.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
|
||||
*/
|
||||
const mapAttempt = exports.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
|
||||
*/
|
||||
const mapOrFail = exports.mapOrFail = internal.mapOrFail;
|
||||
/**
|
||||
* Returns a config that has this configuration nested as a property of the
|
||||
* specified name.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const nested = exports.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
|
||||
*/
|
||||
const orElse = exports.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
|
||||
*/
|
||||
const orElseIf = exports.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
|
||||
*/
|
||||
const option = exports.option = internal.option;
|
||||
/**
|
||||
* Constructs a new primitive config.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const primitive = exports.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
|
||||
*/
|
||||
const repeat = exports.repeat = internal.repeat;
|
||||
/**
|
||||
* Constructs a config for a secret value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
* @deprecated
|
||||
*/
|
||||
const secret = exports.secret = internal.secret;
|
||||
/**
|
||||
* Constructs a config for a redacted value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const redacted = exports.redacted = internal.redacted;
|
||||
/**
|
||||
* Constructs a config for a branded value.
|
||||
*
|
||||
* @since 3.16.0
|
||||
* @category constructors
|
||||
*/
|
||||
const branded = exports.branded = internal.branded;
|
||||
/**
|
||||
* Constructs a config for a sequence of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const hashSet = exports.hashSet = internal.hashSet;
|
||||
/**
|
||||
* Constructs a config for a string value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const string = exports.string = internal.string;
|
||||
/**
|
||||
* Constructs a config for a non-empty string value.
|
||||
*
|
||||
* @since 3.7.0
|
||||
* @category constructors
|
||||
*/
|
||||
const nonEmptyString = exports.nonEmptyString = internal.nonEmptyString;
|
||||
/**
|
||||
* Constructs a config which contains the specified value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const succeed = exports.succeed = internal.succeed;
|
||||
/**
|
||||
* Lazily constructs a config.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const suspend = exports.suspend = internal.suspend;
|
||||
/**
|
||||
* Constructs a config which contains the specified lazy value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const sync = exports.sync = internal.sync;
|
||||
/**
|
||||
* Constructs a config for a sequence of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const hashMap = exports.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
|
||||
*/
|
||||
const unwrap = exports.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
|
||||
*/
|
||||
const validate = exports.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
|
||||
*/
|
||||
const withDefault = exports.withDefault = internal.withDefault;
|
||||
/**
|
||||
* Adds a description to this configuration, which is intended for humans.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const withDescription = exports.withDescription = internal.withDescription;
|
||||
/**
|
||||
* Returns a config that is the composition of this config and the specified
|
||||
* config.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zip = exports.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
|
||||
*/
|
||||
const zipWith = exports.zipWith = internal.zipWith;
|
||||
//# sourceMappingURL=Config.js.map
|
||||
1
node_modules/effect/dist/cjs/Config.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Config.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Config.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ConfigTypeId","exports","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,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,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OAAO;AAErF;;;;;;AAMO,MAAMC,IAAI,GAAAhC,OAAA,CAAAgC,IAAA,GAAwCvD,QAAQ,CAACuD,IAAI;AAEtE;;;;;;AAMO,MAAMC,OAAO,GAAAjC,OAAA,CAAAiC,OAAA,GAAgFxD,QAAQ,CAACwD,OAAO;AAEpH;;;;;;;;;;;;;;;;AAgBO,MAAMC,MAAM,GAAAlC,OAAA,CAAAkC,MAAA,GAA8CzD,QAAQ,CAACyD,MAAM;AAEhF;;;;;;;AAOO,MAAMC,QAAQ,GAAAnC,OAAA,CAAAmC,QAAA,GAuDjB1D,QAAQ,CAAC0D,QAAQ;AAErB;;;;;;;AAOO,MAAMC,WAAW,GAAApC,OAAA,CAAAoC,WAAA,GAiBpB3D,QAAQ,CAAC2D,WAAW;AAExB;;;;;;AAMO,MAAMC,eAAe,GAAArC,OAAA,CAAAqC,eAAA,GAexB5D,QAAQ,CAAC4D,eAAe;AAE5B;;;;;;;AAOO,MAAMC,GAAG,GAAAtC,OAAA,CAAAsC,GAAA,GAiBZ7D,QAAQ,CAAC6D,GAAG;AAEhB;;;;;;;AAOO,MAAMC,OAAO,GAAAvC,OAAA,CAAAuC,OAAA,GAiBhB9D,QAAQ,CAAC8D,OAAO","ignoreList":[]}
|
||||
114
node_modules/effect/dist/cjs/ConfigError.js
generated
vendored
Normal file
114
node_modules/effect/dist/cjs/ConfigError.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.reduceWithContext = exports.prefixed = exports.isUnsupported = exports.isSourceUnavailable = exports.isOr = exports.isMissingDataOnly = exports.isMissingData = exports.isInvalidData = exports.isConfigError = exports.isAnd = exports.Unsupported = exports.SourceUnavailable = exports.Or = exports.MissingData = exports.InvalidData = exports.ConfigErrorTypeId = exports.And = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/configError.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ConfigErrorTypeId = exports.ConfigErrorTypeId = internal.ConfigErrorTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const And = exports.And = internal.And;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const Or = exports.Or = internal.Or;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const MissingData = exports.MissingData = internal.MissingData;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const InvalidData = exports.InvalidData = internal.InvalidData;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const SourceUnavailable = exports.SourceUnavailable = internal.SourceUnavailable;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const Unsupported = exports.Unsupported = internal.Unsupported;
|
||||
/**
|
||||
* Returns `true` if the specified value is a `ConfigError`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isConfigError = exports.isConfigError = internal.isConfigError;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is an `And`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isAnd = exports.isAnd = internal.isAnd;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is an `Or`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isOr = exports.isOr = internal.isOr;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is an `InvalidData`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isInvalidData = exports.isInvalidData = internal.isInvalidData;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is an `MissingData`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isMissingData = exports.isMissingData = internal.isMissingData;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` contains only `MissingData` errors, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @categer getters
|
||||
*/
|
||||
const isMissingDataOnly = exports.isMissingDataOnly = internal.isMissingDataOnly;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is a `SourceUnavailable`,
|
||||
* `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isSourceUnavailable = exports.isSourceUnavailable = internal.isSourceUnavailable;
|
||||
/**
|
||||
* Returns `true` if the specified `ConfigError` is an `Unsupported`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isUnsupported = exports.isUnsupported = internal.isUnsupported;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const prefixed = exports.prefixed = internal.prefixed;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const reduceWithContext = exports.reduceWithContext = internal.reduceWithContext;
|
||||
//# sourceMappingURL=ConfigError.js.map
|
||||
1
node_modules/effect/dist/cjs/ConfigError.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ConfigError.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ConfigError.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ConfigErrorTypeId","exports","And","Or","MissingData","InvalidData","SourceUnavailable","Unsupported","isConfigError","isAnd","isOr","isInvalidData","isMissingData","isMissingDataOnly","isSourceUnavailable","isUnsupported","prefixed","reduceWithContext"],"sources":["../../src/ConfigError.ts"],"sourcesContent":[null],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAqD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,C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iBAAiB,GAAAZ,OAAA,CAAAY,iBAAA,GAAmCnC,QAAQ,CAACmC,iBAAiB;AAE3F;;;;;;;AAOO,MAAMC,mBAAmB,GAAAb,OAAA,CAAAa,mBAAA,GAAqDpC,QAAQ,CAACoC,mBAAmB;AAEjH;;;;;;;AAOO,MAAMC,aAAa,GAAAd,OAAA,CAAAc,aAAA,GAA+CrC,QAAQ,CAACqC,aAAa;AAE/F;;;;AAIO,MAAMC,QAAQ,GAAAf,OAAA,CAAAe,QAAA,GAWjBtC,QAAQ,CAACsC,QAAQ;AAErB;;;;AAIO,MAAMC,iBAAiB,GAAAhB,OAAA,CAAAgB,iBAAA,GAW1BvC,QAAQ,CAACuC,iBAAiB","ignoreList":[]}
|
||||
173
node_modules/effect/dist/cjs/ConfigProvider.js
generated
vendored
Normal file
173
node_modules/effect/dist/cjs/ConfigProvider.js
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.within = exports.upperCase = exports.unnested = exports.snakeCase = exports.orElse = exports.nested = exports.mapInputPath = exports.makeFlat = exports.make = exports.lowerCase = exports.kebabCase = exports.fromMap = exports.fromJson = exports.fromFlat = exports.fromEnv = exports.constantCase = exports.FlatConfigProviderTypeId = exports.ConfigProviderTypeId = exports.ConfigProvider = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/configProvider.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const ConfigProviderTypeId = exports.ConfigProviderTypeId = internal.ConfigProviderTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FlatConfigProviderTypeId = exports.FlatConfigProviderTypeId = internal.FlatConfigProviderTypeId;
|
||||
/**
|
||||
* The service tag for `ConfigProvider`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const ConfigProvider = exports.ConfigProvider = internal.configProviderTag;
|
||||
/**
|
||||
* Creates a new config provider.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = internal.make;
|
||||
/**
|
||||
* Creates a new flat config provider.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeFlat = exports.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
|
||||
*/
|
||||
const fromEnv = exports.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
|
||||
*/
|
||||
const fromFlat = exports.fromFlat = internal.fromFlat;
|
||||
/**
|
||||
* Constructs a new `ConfigProvider` from a JSON object.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromJson = exports.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
|
||||
*/
|
||||
const fromMap = exports.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
|
||||
*/
|
||||
const constantCase = exports.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
|
||||
*/
|
||||
const mapInputPath = exports.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
|
||||
*/
|
||||
const kebabCase = exports.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
|
||||
*/
|
||||
const lowerCase = exports.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
|
||||
*/
|
||||
const nested = exports.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
|
||||
*/
|
||||
const orElse = exports.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
|
||||
*/
|
||||
const unnested = exports.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
|
||||
*/
|
||||
const snakeCase = exports.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
|
||||
*/
|
||||
const upperCase = exports.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
|
||||
*/
|
||||
const within = exports.within = internal.within;
|
||||
//# sourceMappingURL=ConfigProvider.js.map
|
||||
1
node_modules/effect/dist/cjs/ConfigProvider.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ConfigProvider.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ConfigProvider.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ConfigProviderTypeId","exports","FlatConfigProviderTypeId","ConfigProvider","configProviderTag","make","makeFlat","fromEnv","fromFlat","fromJson","fromMap","constantCase","mapInputPath","kebabCase","lowerCase","nested","orElse","unnested","snakeCase","upperCase","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,QAAQ,GAAAhB,OAAA,CAAAgB,QAAA,GAqBjBvC,QAAQ,CAACuC,QAAQ;AAErB;;;;;;;;;AASO,MAAMC,SAAS,GAAAjB,OAAA,CAAAiB,SAAA,GAA6CxC,QAAQ,CAACwC,SAAS;AAErF;;;;;;;;;AASO,MAAMC,SAAS,GAAAlB,OAAA,CAAAkB,SAAA,GAA6CzC,QAAQ,CAACyC,SAAS;AAErF;;;;;;;AAOO,MAAMC,MAAM,GAAAnB,OAAA,CAAAmB,MAAA,GAqBf1C,QAAQ,CAAC0C,MAAM","ignoreList":[]}
|
||||
38
node_modules/effect/dist/cjs/ConfigProviderPathPatch.js
generated
vendored
Normal file
38
node_modules/effect/dist/cjs/ConfigProviderPathPatch.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unnested = exports.nested = exports.mapName = exports.empty = exports.andThen = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/configProvider/pathPatch.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const empty = exports.empty = internal.empty;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const andThen = exports.andThen = internal.andThen;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const mapName = exports.mapName = internal.mapName;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const nested = exports.nested = internal.nested;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unnested = exports.unnested = internal.unnested;
|
||||
//# sourceMappingURL=ConfigProviderPathPatch.js.map
|
||||
1
node_modules/effect/dist/cjs/ConfigProviderPathPatch.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ConfigProviderPathPatch.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ConfigProviderPathPatch.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","empty","exports","andThen","mapName","nested","unnested"],"sources":["../../src/ConfigProviderPathPatch.ts"],"sourcesContent":[null],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAkE,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAHlE;;;;AA2DA;;;;AAIO,MAAMkB,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAActB,QAAQ,CAACsB,KAAK;AAE9C;;;;AAIO,MAAME,OAAO,GAAAD,OAAA,CAAAC,OAAA,GAWhBxB,QAAQ,CAACwB,OAAO;AAEpB;;;;AAIO,MAAMC,OAAO,GAAAF,OAAA,CAAAE,OAAA,GAWhBzB,QAAQ,CAACyB,OAAO;AAEpB;;;;AAIO,MAAMC,MAAM,GAAAH,OAAA,CAAAG,MAAA,GAWf1B,QAAQ,CAAC0B,MAAM;AAEnB;;;;AAIO,MAAMC,QAAQ,GAAAJ,OAAA,CAAAI,QAAA,GAWjB3B,QAAQ,CAAC2B,QAAQ","ignoreList":[]}
|
||||
125
node_modules/effect/dist/cjs/Console.js
generated
vendored
Normal file
125
node_modules/effect/dist/cjs/Console.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.withTime = exports.withGroup = exports.withConsole = exports.warn = exports.trace = exports.timeLog = exports.time = exports.table = exports.setConsole = exports.log = exports.info = exports.group = exports.error = exports.dirxml = exports.dir = exports.debug = exports.countReset = exports.count = exports.consoleWith = exports.clear = exports.assert = exports.TypeId = exports.Console = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/console.js"));
|
||||
var defaultConsole = _interopRequireWildcard(require("./internal/defaultServices/console.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category type ids
|
||||
*/
|
||||
const TypeId = exports.TypeId = defaultConsole.TypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category context
|
||||
*/
|
||||
const Console = exports.Console = defaultConsole.consoleTag;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category default services
|
||||
*/
|
||||
const withConsole = exports.withConsole = internal.withConsole;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category default services
|
||||
*/
|
||||
const setConsole = exports.setConsole = internal.setConsole;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const consoleWith = exports.consoleWith = internal.consoleWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const assert = exports.assert = internal.assert;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const clear = exports.clear = internal.clear;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const count = exports.count = internal.count;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const countReset = exports.countReset = internal.countReset;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const debug = exports.debug = internal.debug;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const dir = exports.dir = internal.dir;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const dirxml = exports.dirxml = internal.dirxml;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const error = exports.error = internal.error;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const group = exports.group = internal.group;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const info = exports.info = internal.info;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const log = exports.log = internal.log;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const table = exports.table = internal.table;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const time = exports.time = internal.time;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const timeLog = exports.timeLog = internal.timeLog;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const trace = exports.trace = internal.trace;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const warn = exports.warn = internal.warn;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const withGroup = exports.withGroup = internal.withGroup;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category accessor
|
||||
*/
|
||||
const withTime = exports.withTime = internal.withTime;
|
||||
//# sourceMappingURL=Console.js.map
|
||||
1
node_modules/effect/dist/cjs/Console.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Console.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Console.js","names":["internal","_interopRequireWildcard","require","defaultConsole","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","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,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,uBAAA,CAAAC,OAAA;AAAuE,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CA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A,GAEgBtC,QAAQ,CAACsC,KAAK;AAEhD;;;;AAIO,MAAMC,IAAI,GAAAf,OAAA,CAAAe,IAAA,GAAkDvC,QAAQ,CAACuC,IAAI;AAEhF;;;;AAIO,MAAMC,GAAG,GAAAhB,OAAA,CAAAgB,GAAA,GAAkDxC,QAAQ,CAACwC,GAAG;AAE9E;;;;AAIO,MAAMC,KAAK,GAAAjB,OAAA,CAAAiB,KAAA,GAA2EzC,QAAQ,CAACyC,KAAK;AAE3G;;;;AAIO,MAAMC,IAAI,GAAAlB,OAAA,CAAAkB,IAAA,GAA+D1C,QAAQ,CAAC0C,IAAI;AAE7F;;;;AAIO,MAAMC,OAAO,GAAAnB,OAAA,CAAAmB,OAAA,GAAkE3C,QAAQ,CAAC2C,OAAO;AAEtG;;;;AAIO,MAAMC,KAAK,GAAApB,OAAA,CAAAoB,KAAA,GAAkD5C,QAAQ,CAAC4C,KAAK;AAElF;;;;AAIO,MAAMC,IAAI,GAAArB,OAAA,CAAAqB,IAAA,GAAkD7C,QAAQ,CAAC6C,IAAI;AAEhF;;;;AAIO,MAAMC,SAAS,GAAAtB,OAAA,CAAAsB,SAAA,GAsBlB9C,QAAQ,CAAC8C,SAAS;AAEtB;;;;AAIO,MAAMC,QAAQ,GAAAvB,OAAA,CAAAuB,QAAA,GAWjB/C,QAAQ,CAAC+C,QAAQ","ignoreList":[]}
|
||||
359
node_modules/effect/dist/cjs/Context.js
generated
vendored
Normal file
359
node_modules/effect/dist/cjs/Context.js
generated
vendored
Normal file
@@ -0,0 +1,359 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeMake = exports.unsafeGet = exports.pick = exports.omit = exports.mergeAll = exports.merge = exports.make = exports.isTag = exports.isReference = exports.isContext = exports.getOrElse = exports.getOption = exports.get = exports.empty = exports.add = exports.Tag = exports.Reference = exports.GenericTag = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/context.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
const TagTypeId = internal.TagTypeId;
|
||||
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
|
||||
*/
|
||||
const GenericTag = exports.GenericTag = internal.makeGenericTag;
|
||||
const TypeId = internal.TypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMake = exports.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
|
||||
*/
|
||||
const isContext = exports.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
|
||||
*/
|
||||
const isTag = exports.isTag = internal.isTag;
|
||||
/**
|
||||
* Checks if the provided argument is a `Reference`.
|
||||
*
|
||||
* @since 3.11.0
|
||||
* @category guards
|
||||
* @experimental
|
||||
*/
|
||||
const isReference = exports.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
|
||||
*/
|
||||
const empty = exports.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
|
||||
*/
|
||||
const make = exports.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
|
||||
*/
|
||||
const add = exports.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
|
||||
*/
|
||||
const get = exports.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
|
||||
*/
|
||||
const getOrElse = exports.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
|
||||
*/
|
||||
const unsafeGet = exports.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
|
||||
*/
|
||||
const getOption = exports.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
|
||||
*/
|
||||
const merge = exports.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
|
||||
*/
|
||||
const mergeAll = exports.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
|
||||
*/
|
||||
const pick = exports.pick = internal.pick;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const omit = exports.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
|
||||
*/
|
||||
const Tag = exports.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
|
||||
*/
|
||||
const Reference = exports.Reference = internal.Reference;
|
||||
//# sourceMappingURL=Context.js.map
|
||||
1
node_modules/effect/dist/cjs/Context.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Context.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Context.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TagTypeId","ReferenceTypeId","GenericTag","exports","makeGenericTag","TypeId","unsafeMake","makeContext","isContext","isTag","isReference","empty","make","add","getOrElse","unsafeGet","getOption","merge","mergeAll","pick","omit","Tag","Reference"],"sources":["../../src/Context.ts"],"sourcesContent":[null],"mappings":";;;;;;AAYA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,C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
Normal file
@@ -0,0 +1,583 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeParse = exports.sequence = exports.parse = exports.next = exports.match = exports.make = exports.isParseError = exports.isCron = exports.equals = exports.TypeId = exports.ParseErrorTypeId = exports.ParseError = exports.Equivalence = void 0;
|
||||
var Arr = _interopRequireWildcard(require("./Array.js"));
|
||||
var Data = _interopRequireWildcard(require("./Data.js"));
|
||||
var Either = _interopRequireWildcard(require("./Either.js"));
|
||||
var Equal = _interopRequireWildcard(require("./Equal.js"));
|
||||
var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var Hash = _interopRequireWildcard(require("./Hash.js"));
|
||||
var _Inspectable = require("./Inspectable.js");
|
||||
var dateTime = _interopRequireWildcard(require("./internal/dateTime.js"));
|
||||
var N = _interopRequireWildcard(require("./Number.js"));
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
var _Predicate = require("./Predicate.js");
|
||||
var String = _interopRequireWildcard(require("./String.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("effect/Cron");
|
||||
const CronProto = {
|
||||
[TypeId]: TypeId,
|
||||
[Equal.symbol](that) {
|
||||
return isCron(that) && equals(this, that);
|
||||
},
|
||||
[Hash.symbol]() {
|
||||
return (0, _Function.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 (0, _Inspectable.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)
|
||||
};
|
||||
},
|
||||
[_Inspectable.NodeInspectSymbol]() {
|
||||
return this.toJSON();
|
||||
},
|
||||
pipe() {
|
||||
return (0, _Pipeable.pipeArguments)(this, arguments);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Checks if a given value is a `Cron` instance.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category guards
|
||||
*/
|
||||
const isCron = u => (0, _Predicate.hasProperty)(u, TypeId);
|
||||
/**
|
||||
* Creates a `Cron` instance.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.isCron = isCron;
|
||||
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;
|
||||
};
|
||||
exports.make = make;
|
||||
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
|
||||
*/
|
||||
const ParseErrorTypeId = exports.ParseErrorTypeId = /*#__PURE__*/Symbol.for("effect/Cron/errors/ParseError");
|
||||
/**
|
||||
* Represents a checked exception which occurs when decoding fails.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category models
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.ParseError = ParseError;
|
||||
const isParseError = u => (0, _Predicate.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
|
||||
*/
|
||||
exports.isParseError = isParseError;
|
||||
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
|
||||
*/
|
||||
exports.parse = parse;
|
||||
const unsafeParse = (cron, tz) => Either.getOrThrowWith(parse(cron, tz), _Function.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
|
||||
*/
|
||||
exports.unsafeParse = unsafeParse;
|
||||
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);
|
||||
};
|
||||
exports.match = match;
|
||||
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
|
||||
*/
|
||||
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 ? _Function.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
|
||||
*/
|
||||
exports.next = next;
|
||||
const sequence = function* (cron, startFrom) {
|
||||
while (true) {
|
||||
yield startFrom = next(cron, startFrom);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.sequence = sequence;
|
||||
const Equivalence = exports.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
|
||||
*/
|
||||
const equals = exports.equals = /*#__PURE__*/(0, _Function.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/cjs/Cron.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Cron.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
291
node_modules/effect/dist/cjs/Data.js
generated
vendored
Normal file
291
node_modules/effect/dist/cjs/Data.js
generated
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeStruct = exports.unsafeArray = exports.tuple = exports.taggedEnum = exports.tagged = exports.struct = exports.case = exports.array = exports.TaggedError = exports.TaggedClass = exports.Structural = exports.Error = exports.Class = void 0;
|
||||
var core = _interopRequireWildcard(require("./internal/core.js"));
|
||||
var internal = _interopRequireWildcard(require("./internal/data.js"));
|
||||
var _effectable = require("./internal/effectable.js");
|
||||
var Predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
const struct = exports.struct = internal.struct;
|
||||
/**
|
||||
* @category constructors
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const unsafeStruct = as => Object.setPrototypeOf(as, _effectable.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
|
||||
*/
|
||||
exports.unsafeStruct = unsafeStruct;
|
||||
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
|
||||
*/
|
||||
exports.tuple = tuple;
|
||||
const array = as => unsafeArray(as.slice(0));
|
||||
/**
|
||||
* @category constructors
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.array = array;
|
||||
const unsafeArray = as => Object.setPrototypeOf(as, internal.ArrayProto);
|
||||
exports.unsafeArray = unsafeArray;
|
||||
const _case = () => args => args === undefined ? Object.create(_effectable.StructuralPrototype) : struct(args);
|
||||
exports.case = _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
|
||||
*/
|
||||
const tagged = tag => args => {
|
||||
const value = args === undefined ? Object.create(_effectable.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
|
||||
*/
|
||||
exports.tagged = tagged;
|
||||
const Class = exports.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
|
||||
*/
|
||||
const TaggedClass = tag => {
|
||||
class Base extends Class {
|
||||
_tag = tag;
|
||||
}
|
||||
return Base;
|
||||
};
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.TaggedClass = TaggedClass;
|
||||
const Structural = exports.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
|
||||
*/
|
||||
const taggedEnum = () => new Proxy({}, {
|
||||
get(_target, tag, _receiver) {
|
||||
if (tag === "$is") {
|
||||
return Predicate.isTagged;
|
||||
} else if (tag === "$match") {
|
||||
return taggedMatch;
|
||||
}
|
||||
return tagged(tag);
|
||||
}
|
||||
});
|
||||
exports.taggedEnum = taggedEnum;
|
||||
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
|
||||
*/
|
||||
const Error = exports.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
|
||||
*/
|
||||
const TaggedError = tag => {
|
||||
const O = {
|
||||
BaseEffectError: class extends Error {
|
||||
_tag = tag;
|
||||
}
|
||||
};
|
||||
O.BaseEffectError.prototype.name = tag;
|
||||
return O.BaseEffectError;
|
||||
};
|
||||
exports.TaggedError = TaggedError;
|
||||
//# sourceMappingURL=Data.js.map
|
||||
1
node_modules/effect/dist/cjs/Data.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Data.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Data.js","names":["core","_interopRequireWildcard","require","internal","_effectable","Predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","struct","exports","unsafeStruct","as","setPrototypeOf","StructuralPrototype","tuple","unsafeArray","array","slice","ArrayProto","_case","args","undefined","create","case","tagged","tag","value","_tag","Class","Structural","TaggedClass","Base","taggedEnum","Proxy","_target","_receiver","isTagged","taggedMatch","arguments","length","cases","Error","plainArgsSymbol","Symbol","for","O","BaseEffectError","YieldableError","constructor","message","cause","assign","enumerable","toJSON","TaggedError","prototype","name"],"sources":["../../src/Data.ts"],"sourcesContent":[null],"mappings":";;;;;;AAIA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA2C,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,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ist/cjs/DateTime.js
generated
vendored
Normal file
1066
node_modules/effect/dist/cjs/DateTime.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/DateTime.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/DateTime.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/effect/dist/cjs/DefaultServices.js
generated
vendored
Normal file
19
node_modules/effect/dist/cjs/DefaultServices.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.liveServices = exports.currentServices = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/defaultServices.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const liveServices = exports.liveServices = internal.liveServices;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentServices = exports.currentServices = internal.currentServices;
|
||||
//# sourceMappingURL=DefaultServices.js.map
|
||||
1
node_modules/effect/dist/cjs/DefaultServices.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/DefaultServices.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"DefaultServices.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","liveServices","exports","currentServices"],"sources":["../../src/DefaultServices.ts"],"sourcesContent":[null],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAyD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAezD;;;;AAIO,MAAMkB,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAqCtB,QAAQ,CAACsB,YAAY;AAEnF;;;;AAIO,MAAME,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAwDxB,QAAQ,CAACwB,eAAe","ignoreList":[]}
|
||||
167
node_modules/effect/dist/cjs/Deferred.js
generated
vendored
Normal file
167
node_modules/effect/dist/cjs/Deferred.js
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeMake = exports.unsafeDone = exports.sync = exports.succeed = exports.poll = exports.makeAs = exports.make = exports.isDone = exports.interruptWith = exports.interrupt = exports.failSync = exports.failCauseSync = exports.failCause = exports.fail = exports.done = exports.dieSync = exports.die = exports.completeWith = exports.complete = exports.await = exports.DeferredTypeId = void 0;
|
||||
var core = _interopRequireWildcard(require("./internal/core.js"));
|
||||
var internal = _interopRequireWildcard(require("./internal/deferred.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const DeferredTypeId = exports.DeferredTypeId = internal.DeferredTypeId;
|
||||
/**
|
||||
* Creates a new `Deferred`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = core.deferredMake;
|
||||
/**
|
||||
* Creates a new `Deferred` from the specified `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeAs = exports.makeAs = core.deferredMakeAs;
|
||||
const _await = exports.await = core.deferredAwait;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
const complete = exports.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
|
||||
*/
|
||||
const completeWith = exports.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
|
||||
*/
|
||||
const done = exports.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
|
||||
*/
|
||||
const fail = exports.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
|
||||
*/
|
||||
const failSync = exports.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
|
||||
*/
|
||||
const failCause = exports.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
|
||||
*/
|
||||
const failCauseSync = exports.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
|
||||
*/
|
||||
const die = exports.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
|
||||
*/
|
||||
const dieSync = exports.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
|
||||
*/
|
||||
const interrupt = exports.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
|
||||
*/
|
||||
const interruptWith = exports.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
|
||||
*/
|
||||
const isDone = exports.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
|
||||
*/
|
||||
const poll = exports.poll = core.deferredPoll;
|
||||
/**
|
||||
* Completes the `Deferred` with the specified value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const succeed = exports.succeed = core.deferredSucceed;
|
||||
/**
|
||||
* Completes the `Deferred` with the specified lazily evaluated value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const sync = exports.sync = core.deferredSync;
|
||||
/**
|
||||
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category unsafe
|
||||
*/
|
||||
const unsafeMake = exports.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
|
||||
*/
|
||||
const unsafeDone = exports.unsafeDone = core.deferredUnsafeDone;
|
||||
//# sourceMappingURL=Deferred.js.map
|
||||
1
node_modules/effect/dist/cjs/Deferred.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Deferred.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Deferred.js","names":["core","_interopRequireWildcard","require","internal","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DeferredTypeId","exports","make","deferredMake","makeAs","deferredMakeAs","_await","await","deferredAwait","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,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,uBAAA,CAAAC,OAAA;AAAkD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IA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A,CAAAoC,IAAA,GAeb5D,IAAI,CAAC6D,YAAY;AAErB;;;;;;AAMO,MAAMC,UAAU,GAAAtC,OAAA,CAAAsC,UAAA,GAA+D9D,IAAI,CAAC+D,kBAAkB;AAE7G;;;;;;;AAOO,MAAMC,UAAU,GAAAxC,OAAA,CAAAwC,UAAA,GAAsEhE,IAAI,CAACiE,kBAAkB","ignoreList":[]}
|
||||
140
node_modules/effect/dist/cjs/Differ.js
generated
vendored
Normal file
140
node_modules/effect/dist/cjs/Differ.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zip = exports.updateWith = exports.update = exports.transform = exports.readonlyArray = exports.patch = exports.orElseEither = exports.make = exports.hashSet = exports.hashMap = exports.environment = exports.empty = exports.diff = exports.combine = exports.chunk = exports.TypeId = void 0;
|
||||
var Dual = _interopRequireWildcard(require("./Function.js"));
|
||||
var internal = _interopRequireWildcard(require("./internal/differ.js"));
|
||||
var ChunkPatch = _interopRequireWildcard(require("./internal/differ/chunkPatch.js"));
|
||||
var ContextPatch = _interopRequireWildcard(require("./internal/differ/contextPatch.js"));
|
||||
var HashMapPatch = _interopRequireWildcard(require("./internal/differ/hashMapPatch.js"));
|
||||
var HashSetPatch = _interopRequireWildcard(require("./internal/differ/hashSetPatch.js"));
|
||||
var OrPatch = _interopRequireWildcard(require("./internal/differ/orPatch.js"));
|
||||
var ReadonlyArrayPatch = _interopRequireWildcard(require("./internal/differ/readonlyArrayPatch.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbol
|
||||
*/
|
||||
const TypeId = exports.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
|
||||
*/
|
||||
const empty = self => self.empty;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category patch
|
||||
*/
|
||||
exports.empty = empty;
|
||||
const diff = exports.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
|
||||
*/
|
||||
const combine = exports.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
|
||||
*/
|
||||
const patch = exports.patch = /*#__PURE__*/Dual.dual(3, (self, patch, oldValue) => self.patch(patch, oldValue));
|
||||
/**
|
||||
* Constructs a new `Differ`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = internal.make;
|
||||
/**
|
||||
* Constructs a differ that knows how to diff `Env` values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const environment = exports.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
|
||||
*/
|
||||
const chunk = exports.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
|
||||
*/
|
||||
const hashMap = exports.hashMap = internal.hashMap;
|
||||
/**
|
||||
* Constructs a differ that knows how to diff a `HashSet` of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const hashSet = exports.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
|
||||
*/
|
||||
const orElseEither = exports.orElseEither = internal.orElseEither;
|
||||
/**
|
||||
* Constructs a differ that knows how to diff a `ReadonlyArray` of values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const readonlyArray = exports.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
|
||||
*/
|
||||
const transform = exports.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
|
||||
*/
|
||||
const update = exports.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
|
||||
*/
|
||||
const updateWith = exports.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
|
||||
*/
|
||||
const zip = exports.zip = internal.zip;
|
||||
//# sourceMappingURL=Differ.js.map
|
||||
1
node_modules/effect/dist/cjs/Differ.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Differ.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Differ.js","names":["Dual","_interopRequireWildcard","require","internal","ChunkPatch","ContextPatch","HashMapPatch","HashSetPatch","OrPatch","ReadonlyArrayPatch","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","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,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,uBAAA,CAAAC,OAAA;AAA6E,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,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AAtB,OAAA,CAAAsB,OAAA,GAGhBjD,QAAQ,CAACiD,OAAO;AAEpB;;;;;;AAMO,MAAMC,YAAY,GAAAvB,OAAA,CAAAuB,YAAA,GAuBrBlD,QAAQ,CAACkD,YAAY;AAEzB;;;;;;AAMO,MAAMC,aAAa,GAAAxB,OAAA,CAAAwB,aAAA,GAEoDnD,QAAQ,CAACmD,aAAa;AAEpG;;;;;;AAMO,MAAMC,SAAS,GAAAzB,OAAA,CAAAyB,SAAA,GA0BlBpD,QAAQ,CAACoD,SAAS;AAEtB;;;;;;;;AAQO,MAAMC,MAAM,GAAA1B,OAAA,CAAA0B,MAAA,GAAoCrD,QAAQ,CAACqD,MAAM;AAEtE;;;;;;AAMO,MAAMC,UAAU,GAAA3B,OAAA,CAAA2B,UAAA,GAAwDtD,QAAQ,CAACsD,UAAU;AAElG;;;;;;AAMO,MAAMC,GAAG,GAAA5B,OAAA,CAAA4B,GAAA,GAuBZvD,QAAQ,CAACuD,GAAG","ignoreList":[]}
|
||||
737
node_modules/effect/dist/cjs/Duration.js
generated
vendored
Normal file
737
node_modules/effect/dist/cjs/Duration.js
generated
vendored
Normal file
@@ -0,0 +1,737 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zero = exports.weeks = exports.unsafeToNanos = exports.unsafeFormatIso = exports.unsafeDivide = exports.toWeeks = exports.toSeconds = exports.toNanos = exports.toMinutes = exports.toMillis = exports.toHrTime = exports.toHours = exports.toDays = exports.times = exports.sum = exports.subtract = exports.seconds = exports.parts = exports.nanos = exports.minutes = exports.min = exports.millis = exports.micros = exports.max = exports.matchWith = exports.match = exports.lessThanOrEqualTo = exports.lessThan = exports.isZero = exports.isFinite = exports.isDuration = exports.infinity = exports.hours = exports.greaterThanOrEqualTo = exports.greaterThan = exports.fromIso = exports.formatIso = exports.format = exports.equals = exports.divide = exports.decodeUnknown = exports.decode = exports.days = exports.clamp = exports.between = exports.Order = exports.Equivalence = void 0;
|
||||
var Equal = _interopRequireWildcard(require("./Equal.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var Hash = _interopRequireWildcard(require("./Hash.js"));
|
||||
var _Inspectable = require("./Inspectable.js");
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var order = _interopRequireWildcard(require("./Order.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
var _Predicate = require("./Predicate.js");
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
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
|
||||
*/
|
||||
const decode = input => {
|
||||
if (isDuration(input)) {
|
||||
return input;
|
||||
} else if ((0, _Predicate.isNumber)(input)) {
|
||||
return millis(input);
|
||||
} else if ((0, _Predicate.isBigInt)(input)) {
|
||||
return nanos(input);
|
||||
} else if (Array.isArray(input) && input.length === 2 && input.every(_Predicate.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 ((0, _Predicate.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
|
||||
*/
|
||||
exports.decode = decode;
|
||||
const decodeUnknown = exports.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"
|
||||
};
|
||||
}
|
||||
},
|
||||
[_Inspectable.NodeInspectSymbol]() {
|
||||
return this.toJSON();
|
||||
},
|
||||
pipe() {
|
||||
return (0, _Pipeable.pipeArguments)(this, arguments);
|
||||
}
|
||||
};
|
||||
const make = input => {
|
||||
const duration = Object.create(DurationProto);
|
||||
if ((0, _Predicate.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
|
||||
*/
|
||||
const isDuration = u => (0, _Predicate.hasProperty)(u, TypeId);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category guards
|
||||
*/
|
||||
exports.isDuration = isDuration;
|
||||
const isFinite = self => self.value._tag !== "Infinity";
|
||||
/**
|
||||
* @since 3.5.0
|
||||
* @category guards
|
||||
*/
|
||||
exports.isFinite = isFinite;
|
||||
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
|
||||
*/
|
||||
exports.isZero = isZero;
|
||||
const zero = exports.zero = /*#__PURE__*/make(0);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const infinity = exports.infinity = /*#__PURE__*/make(Infinity);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const nanos = nanos => make(nanos);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.nanos = nanos;
|
||||
const micros = micros => make(micros * bigint1e3);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.micros = micros;
|
||||
const millis = millis => make(millis);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.millis = millis;
|
||||
const seconds = seconds => make(seconds * 1000);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.seconds = seconds;
|
||||
const minutes = minutes => make(minutes * 60_000);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.minutes = minutes;
|
||||
const hours = hours => make(hours * 3_600_000);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.hours = hours;
|
||||
const days = days => make(days * 86_400_000);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.days = days;
|
||||
const weeks = weeks => make(weeks * 604_800_000);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.weeks = weeks;
|
||||
const toMillis = self => match(self, {
|
||||
onMillis: millis => millis,
|
||||
onNanos: nanos => Number(nanos) / 1_000_000
|
||||
});
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.toMillis = toMillis;
|
||||
const toSeconds = self => match(self, {
|
||||
onMillis: millis => millis / 1_000,
|
||||
onNanos: nanos => Number(nanos) / 1_000_000_000
|
||||
});
|
||||
/**
|
||||
* @since 3.8.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.toSeconds = toSeconds;
|
||||
const toMinutes = self => match(self, {
|
||||
onMillis: millis => millis / 60_000,
|
||||
onNanos: nanos => Number(nanos) / 60_000_000_000
|
||||
});
|
||||
/**
|
||||
* @since 3.8.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.toMinutes = toMinutes;
|
||||
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
|
||||
*/
|
||||
exports.toHours = toHours;
|
||||
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
|
||||
*/
|
||||
exports.toDays = toDays;
|
||||
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
|
||||
*/
|
||||
exports.toWeeks = toWeeks;
|
||||
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
|
||||
*/
|
||||
exports.toNanos = toNanos;
|
||||
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
|
||||
*/
|
||||
exports.unsafeToNanos = unsafeToNanos;
|
||||
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
|
||||
*/
|
||||
exports.toHrTime = toHrTime;
|
||||
const match = exports.match = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const matchWith = exports.matchWith = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const Order = exports.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
|
||||
*/
|
||||
const between = exports.between = /*#__PURE__*/order.between(/*#__PURE__*/order.mapInput(Order, decode));
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const Equivalence = (self, that) => matchWith(self, that, {
|
||||
onMillis: (self, that) => self === that,
|
||||
onNanos: (self, that) => self === that
|
||||
});
|
||||
exports.Equivalence = Equivalence;
|
||||
const _min = /*#__PURE__*/order.min(Order);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const min = exports.min = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => _min(decode(self), decode(that)));
|
||||
const _max = /*#__PURE__*/order.max(Order);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category order
|
||||
*/
|
||||
const max = exports.max = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => _max(decode(self), decode(that)));
|
||||
const _clamp = /*#__PURE__*/order.clamp(Order);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category order
|
||||
*/
|
||||
const clamp = exports.clamp = /*#__PURE__*/(0, _Function.dual)(2, (self, options) => _clamp(decode(self), {
|
||||
minimum: decode(options.minimum),
|
||||
maximum: decode(options.maximum)
|
||||
}));
|
||||
/**
|
||||
* @since 2.4.19
|
||||
* @category math
|
||||
*/
|
||||
const divide = exports.divide = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const unsafeDivide = exports.unsafeDivide = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const times = exports.times = /*#__PURE__*/(0, _Function.dual)(2, (self, times) => match(self, {
|
||||
onMillis: millis => make(millis * times),
|
||||
onNanos: nanos => make(nanos * BigInt(times))
|
||||
}));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category math
|
||||
*/
|
||||
const subtract = exports.subtract = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const sum = exports.sum = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const lessThan = exports.lessThan = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => matchWith(self, that, {
|
||||
onMillis: (self, that) => self < that,
|
||||
onNanos: (self, that) => self < that
|
||||
}));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category predicates
|
||||
*/
|
||||
const lessThanOrEqualTo = exports.lessThanOrEqualTo = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => matchWith(self, that, {
|
||||
onMillis: (self, that) => self <= that,
|
||||
onNanos: (self, that) => self <= that
|
||||
}));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category predicates
|
||||
*/
|
||||
const greaterThan = exports.greaterThan = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => matchWith(self, that, {
|
||||
onMillis: (self, that) => self > that,
|
||||
onNanos: (self, that) => self > that
|
||||
}));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category predicates
|
||||
*/
|
||||
const greaterThanOrEqualTo = exports.greaterThanOrEqualTo = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => matchWith(self, that, {
|
||||
onMillis: (self, that) => self >= that,
|
||||
onNanos: (self, that) => self >= that
|
||||
}));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category predicates
|
||||
*/
|
||||
const equals = exports.equals = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => Equivalence(decode(self), decode(that)));
|
||||
/**
|
||||
* Converts a `Duration` to its parts.
|
||||
*
|
||||
* @since 3.8.0
|
||||
* @category conversions
|
||||
*/
|
||||
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"
|
||||
* ```
|
||||
*/
|
||||
exports.parts = parts;
|
||||
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
|
||||
*/
|
||||
exports.format = format;
|
||||
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
|
||||
*/
|
||||
exports.unsafeFormatIso = unsafeFormatIso;
|
||||
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
|
||||
*/
|
||||
exports.formatIso = formatIso;
|
||||
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));
|
||||
};
|
||||
exports.fromIso = fromIso;
|
||||
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/cjs/Duration.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Duration.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10642
node_modules/effect/dist/cjs/Effect.js
generated
vendored
Normal file
10642
node_modules/effect/dist/cjs/Effect.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/effect/dist/cjs/Effect.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Effect.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
node_modules/effect/dist/cjs/Effectable.js
generated
vendored
Normal file
58
node_modules/effect/dist/cjs/Effectable.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.StructuralCommitPrototype = exports.StructuralClass = exports.StreamTypeId = exports.SinkTypeId = exports.EffectTypeId = exports.EffectPrototype = exports.CommitPrototype = exports.Class = exports.ChannelTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/effectable.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category type ids
|
||||
*/
|
||||
const EffectTypeId = exports.EffectTypeId = internal.EffectTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category type ids
|
||||
*/
|
||||
const StreamTypeId = exports.StreamTypeId = internal.StreamTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category type ids
|
||||
*/
|
||||
const SinkTypeId = exports.SinkTypeId = internal.SinkTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category type ids
|
||||
*/
|
||||
const ChannelTypeId = exports.ChannelTypeId = internal.ChannelTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category prototypes
|
||||
*/
|
||||
const EffectPrototype = exports.EffectPrototype = internal.EffectPrototype;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category prototypes
|
||||
*/
|
||||
const CommitPrototype = exports.CommitPrototype = internal.CommitPrototype;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category prototypes
|
||||
*/
|
||||
const StructuralCommitPrototype = exports.StructuralCommitPrototype = internal.StructuralCommitPrototype;
|
||||
const Base = internal.Base;
|
||||
const StructuralBase = internal.StructuralBase;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
class Class extends Base {}
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
exports.Class = Class;
|
||||
class StructuralClass extends StructuralBase {}
|
||||
exports.StructuralClass = StructuralClass;
|
||||
//# sourceMappingURL=Effectable.js.map
|
||||
1
node_modules/effect/dist/cjs/Effectable.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Effectable.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Effectable.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EffectTypeId","exports","StreamTypeId","SinkTypeId","ChannelTypeId","EffectPrototype","CommitPrototype","StructuralCommitPrototype","Base","StructuralBase","Class","StructuralClass"],"sources":["../../src/Effectable.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAIpD;;;;AAIO,MAAMkB,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAwBtB,QAAQ,CAACsB,YAAY;AAQtE;;;;AAIO,MAAME,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAAwBxB,QAAQ,CAACwB,YAAY;AAQtE;;;;AAIO,MAAMC,UAAU,GAAAF,OAAA,CAAAE,UAAA,GAAoBzB,QAAQ,CAACyB,UAAU;AAQ9D;;;;AAIO,MAAMC,aAAa,GAAAH,OAAA,CAAAG,aAAA,GAA0B1B,QAAQ,CAAC0B,aAAa;AAgB1E;;;;AAIO,MAAMC,eAAe,GAAAJ,OAAA,CAAAI,eAAA,GAAyB3B,QAAQ,CAAC2B,eAAe;AAE7E;;;;AAIO,MAAMC,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAyB5B,QAAQ,CAAC4B,eAAe;AAE7E;;;;AAIO,MAAMC,yBAAyB,GAAAN,OAAA,CAAAM,yBAAA,GAAyB7B,QAAQ,CAAC6B,yBAAyB;AAEjG,MAAMC,IAAI,GAAoB9B,QAAQ,CAAC8B,IAAI;AAC3C,MAAMC,cAAc,GAAoB/B,QAAQ,CAAC+B,cAAc;AAE/D;;;;AAIM,MAAgBC,KAA+B,SAAQF,IAAa;AAO1E;;;;AAAAP,OAAA,CAAAS,KAAA,GAAAA,KAAA;AAIM,MAAgBC,eAAyC,SAAQF,cAAuB;AAAAR,OAAA,CAAAU,eAAA,GAAAA,eAAA","ignoreList":[]}
|
||||
654
node_modules/effect/dist/cjs/Either.js
generated
vendored
Normal file
654
node_modules/effect/dist/cjs/Either.js
generated
vendored
Normal file
@@ -0,0 +1,654 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zipWith = exports.void = exports.try = exports.transposeOption = exports.transposeMapOption = exports.right = exports.orElse = exports.merge = exports.match = exports.mapLeft = exports.mapBoth = exports.map = exports.liftPredicate = exports.let = exports.left = exports.isRight = exports.isLeft = exports.isEither = exports.getRight = exports.getOrUndefined = exports.getOrThrowWith = exports.getOrThrow = exports.getOrNull = exports.getOrElse = exports.getLeft = exports.getEquivalence = exports.gen = exports.fromOption = exports.fromNullable = exports.flip = exports.flatMap = exports.filterOrLeft = exports.bindTo = exports.bind = exports.ap = exports.andThen = exports.all = exports.TypeId = exports.Do = void 0;
|
||||
var Equivalence = _interopRequireWildcard(require("./Equivalence.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var doNotation = _interopRequireWildcard(require("./internal/doNotation.js"));
|
||||
var either = _interopRequireWildcard(require("./internal/either.js"));
|
||||
var option_ = _interopRequireWildcard(require("./internal/option.js"));
|
||||
var _Predicate = require("./Predicate.js");
|
||||
var Gen = _interopRequireWildcard(require("./Utils.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category symbols
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const TypeId = exports.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
|
||||
*/
|
||||
const right = exports.right = either.right;
|
||||
const void_ = exports.void = /*#__PURE__*/right(void 0);
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
const left = exports.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
|
||||
*/
|
||||
const fromNullable = exports.fromNullable = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const fromOption = exports.fromOption = either.fromOption;
|
||||
const try_ = evaluate => {
|
||||
if ((0, _Predicate.isFunction)(evaluate)) {
|
||||
try {
|
||||
return right(evaluate());
|
||||
} catch (e) {
|
||||
return left(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return right(evaluate.try());
|
||||
} catch (e) {
|
||||
return left(evaluate.catch(e));
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.try = 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
|
||||
*/
|
||||
const isEither = exports.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
|
||||
*/
|
||||
const isLeft = exports.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
|
||||
*/
|
||||
const isRight = exports.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
|
||||
*/
|
||||
const getRight = exports.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
|
||||
*/
|
||||
const getLeft = exports.getLeft = either.getLeft;
|
||||
/**
|
||||
* @category equivalence
|
||||
* @since 2.0.0
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.getEquivalence = getEquivalence;
|
||||
const mapBoth = exports.mapBoth = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const mapLeft = exports.mapLeft = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const map = exports.map = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const match = exports.match = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const liftPredicate = exports.liftPredicate = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const filterOrLeft = exports.filterOrLeft = /*#__PURE__*/(0, _Function.dual)(3, (self, predicate, orLeftWith) => flatMap(self, r => predicate(r) ? right(r) : left(orLeftWith(r))));
|
||||
/**
|
||||
* @category getters
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const merge = exports.merge = /*#__PURE__*/match({
|
||||
onLeft: _Function.identity,
|
||||
onRight: _Function.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
|
||||
*/
|
||||
const getOrElse = exports.getOrElse = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const getOrNull = exports.getOrNull = /*#__PURE__*/getOrElse(_Function.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
|
||||
*/
|
||||
const getOrUndefined = exports.getOrUndefined = /*#__PURE__*/getOrElse(_Function.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
|
||||
*/
|
||||
const getOrThrowWith = exports.getOrThrowWith = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const getOrThrow = exports.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
|
||||
*/
|
||||
const orElse = exports.orElse = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => isLeft(self) ? that(self.left) : right(self.right));
|
||||
/**
|
||||
* @category sequencing
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const flatMap = exports.flatMap = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const andThen = exports.andThen = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => flatMap(self, a => {
|
||||
const b = (0, _Predicate.isFunction)(f) ? f(a) : f;
|
||||
return isEither(b) ? b : right(b);
|
||||
}));
|
||||
/**
|
||||
* @category zipping
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const zipWith = exports.zipWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, f) => flatMap(self, r => map(that, r2 => f(r, r2))));
|
||||
/**
|
||||
* @category combining
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const ap = exports.ap = /*#__PURE__*/(0, _Function.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
|
||||
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
|
||||
*/
|
||||
exports.all = all;
|
||||
const flip = self => isLeft(self) ? right(self.left) : left(self.right);
|
||||
exports.flip = flip;
|
||||
const adapter = /*#__PURE__*/Gen.adapter();
|
||||
/**
|
||||
* @category generators
|
||||
* @since 2.0.0
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.gen = gen;
|
||||
const Do = exports.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
|
||||
*/
|
||||
const bind = exports.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
|
||||
*/
|
||||
const bindTo = exports.bindTo = /*#__PURE__*/doNotation.bindTo(map);
|
||||
const let_ = exports.let = /*#__PURE__*/doNotation.let_(map);
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.transposeOption = transposeOption;
|
||||
const transposeMapOption = exports.transposeMapOption = /*#__PURE__*/(0, _Function.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/cjs/Either.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Either.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
155
node_modules/effect/dist/cjs/Encoding.js
generated
vendored
Normal file
155
node_modules/effect/dist/cjs/Encoding.js
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isEncodeException = exports.isDecodeException = exports.encodeUriComponent = exports.encodeHex = exports.encodeBase64Url = exports.encodeBase64 = exports.decodeUriComponent = exports.decodeHexString = exports.decodeHex = exports.decodeBase64UrlString = exports.decodeBase64Url = exports.decodeBase64String = exports.decodeBase64 = exports.EncodeExceptionTypeId = exports.EncodeException = exports.DecodeExceptionTypeId = exports.DecodeException = void 0;
|
||||
var Either = _interopRequireWildcard(require("./Either.js"));
|
||||
var Base64 = _interopRequireWildcard(require("./internal/encoding/base64.js"));
|
||||
var Base64Url = _interopRequireWildcard(require("./internal/encoding/base64Url.js"));
|
||||
var Common = _interopRequireWildcard(require("./internal/encoding/common.js"));
|
||||
var Hex = _interopRequireWildcard(require("./internal/encoding/hex.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* This module provides encoding & decoding functionality for:
|
||||
*
|
||||
* - base64 (RFC4648)
|
||||
* - base64 (URL)
|
||||
* - hex
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Encodes the given value into a base64 (RFC4648) `string`.
|
||||
*
|
||||
* @category encoding
|
||||
* @since 2.0.0
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.encodeBase64 = encodeBase64;
|
||||
const decodeBase64 = str => Base64.decode(str);
|
||||
/**
|
||||
* Decodes a base64 (RFC4648) encoded `string` into a UTF-8 `string`.
|
||||
*
|
||||
* @category decoding
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.decodeBase64 = decodeBase64;
|
||||
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
|
||||
*/
|
||||
exports.decodeBase64String = decodeBase64String;
|
||||
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
|
||||
*/
|
||||
exports.encodeBase64Url = encodeBase64Url;
|
||||
const decodeBase64Url = str => Base64Url.decode(str);
|
||||
/**
|
||||
* Decodes a base64 (URL) encoded `string` into a UTF-8 `string`.
|
||||
*
|
||||
* @category decoding
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.decodeBase64Url = decodeBase64Url;
|
||||
const decodeBase64UrlString = str => Either.map(decodeBase64Url(str), _ => Common.decoder.decode(_));
|
||||
/**
|
||||
* Encodes the given value into a hex `string`.
|
||||
*
|
||||
* @category encoding
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.decodeBase64UrlString = decodeBase64UrlString;
|
||||
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
|
||||
*/
|
||||
exports.encodeHex = encodeHex;
|
||||
const decodeHex = str => Hex.decode(str);
|
||||
/**
|
||||
* Decodes a hex encoded `string` into a UTF-8 `string`.
|
||||
*
|
||||
* @category decoding
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.decodeHex = decodeHex;
|
||||
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
|
||||
*/
|
||||
exports.decodeHexString = decodeHexString;
|
||||
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
|
||||
*/
|
||||
exports.encodeUriComponent = encodeUriComponent;
|
||||
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
|
||||
*/
|
||||
exports.decodeUriComponent = decodeUriComponent;
|
||||
const DecodeExceptionTypeId = exports.DecodeExceptionTypeId = Common.DecodeExceptionTypeId;
|
||||
/**
|
||||
* Creates a checked exception which occurs when decoding fails.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category errors
|
||||
*/
|
||||
const DecodeException = exports.DecodeException = Common.DecodeException;
|
||||
/**
|
||||
* Returns `true` if the specified value is an `DecodeException`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isDecodeException = exports.isDecodeException = Common.isDecodeException;
|
||||
/**
|
||||
* @since 3.12.0
|
||||
* @category symbols
|
||||
*/
|
||||
const EncodeExceptionTypeId = exports.EncodeExceptionTypeId = Common.EncodeExceptionTypeId;
|
||||
/**
|
||||
* Creates a checked exception which occurs when encoding fails.
|
||||
*
|
||||
* @since 3.12.0
|
||||
* @category errors
|
||||
*/
|
||||
const EncodeException = exports.EncodeException = Common.EncodeException;
|
||||
/**
|
||||
* Returns `true` if the specified value is an `EncodeException`, `false` otherwise.
|
||||
*
|
||||
* @since 3.12.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isEncodeException = exports.isEncodeException = Common.isEncodeException;
|
||||
//# sourceMappingURL=Encoding.js.map
|
||||
1
node_modules/effect/dist/cjs/Encoding.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Encoding.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Encoding.js","names":["Either","_interopRequireWildcard","require","Base64","Base64Url","Common","Hex","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","encodeBase64","input","encode","encoder","exports","decodeBase64","str","decode","decodeBase64String","map","_","decoder","encodeBase64Url","decodeBase64Url","decodeBase64UrlString","encodeHex","decodeHex","decodeHexString","encodeUriComponent","try","encodeURIComponent","catch","EncodeException","Error","message","decodeUriComponent","decodeURIComponent","DecodeException","DecodeExceptionTypeId","isDecodeException","EncodeExceptionTypeId","isEncodeException"],"sources":["../../src/Encoding.ts"],"sourcesContent":[null],"mappings":";;;;;;AASA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAiD,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA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EAClCe,KAAK,EAAGxC,CAAC,IAAK8C,eAAe,CAACrB,GAAG,EAAEzB,CAAC,YAAY0C,KAAK,GAAG1C,CAAC,CAAC2C,OAAO,GAAG,eAAe;CACpF,CAAC;AAEJ;;;;AAAApB,OAAA,CAAAqB,kBAAA,GAAAA,kBAAA;AAIO,MAAMG,qBAAqB,GAAAxB,OAAA,CAAAwB,qBAAA,GAAkBjD,MAAM,CAACiD,qBAAqB;AAqBhF;;;;;;AAMO,MAAMD,eAAe,GAAAvB,OAAA,CAAAuB,eAAA,GAAyDhD,MAAM,CAACgD,eAAe;AAE3G;;;;;;AAMO,MAAME,iBAAiB,GAAAzB,OAAA,CAAAyB,iBAAA,GAAyClD,MAAM,CAACkD,iBAAiB;AAE/F;;;;AAIO,MAAMC,qBAAqB,GAAA1B,OAAA,CAAA0B,qBAAA,GAAkBnD,MAAM,CAACmD,qBAAqB;AAqBhF;;;;;;AAMO,MAAMR,eAAe,GAAAlB,OAAA,CAAAkB,eAAA,GAAyD3C,MAAM,CAAC2C,eAAe;AAE3G;;;;;;AAMO,MAAMS,iBAAiB,GAAA3B,OAAA,CAAA2B,iBAAA,GAAyCpD,MAAM,CAACoD,iBAAiB","ignoreList":[]}
|
||||
79
node_modules/effect/dist/cjs/Equal.js
generated
vendored
Normal file
79
node_modules/effect/dist/cjs/Equal.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.equals = equals;
|
||||
exports.symbol = exports.isEqual = exports.equivalence = void 0;
|
||||
var Hash = _interopRequireWildcard(require("./Hash.js"));
|
||||
var _Predicate = require("./Predicate.js");
|
||||
var _Utils = require("./Utils.js");
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const symbol = exports.symbol = /*#__PURE__*/Symbol.for("effect/Equal");
|
||||
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 _Utils.structuralRegionState.enabled && _Utils.structuralRegionState.tester ? _Utils.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 (_Utils.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 _Utils.structuralRegionState.tester ? _Utils.structuralRegionState.tester(self, that) : false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return _Utils.structuralRegionState.tester ? _Utils.structuralRegionState.tester(self, that) : false;
|
||||
}
|
||||
}
|
||||
return _Utils.structuralRegionState.enabled && _Utils.structuralRegionState.tester ? _Utils.structuralRegionState.tester(self, that) : false;
|
||||
}
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category guards
|
||||
*/
|
||||
const isEqual = u => (0, _Predicate.hasProperty)(u, symbol);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category instances
|
||||
*/
|
||||
exports.isEqual = isEqual;
|
||||
const equivalence = () => equals;
|
||||
exports.equivalence = equivalence;
|
||||
//# sourceMappingURL=Equal.js.map
|
||||
1
node_modules/effect/dist/cjs/Equal.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Equal.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Equal.js","names":["Hash","_interopRequireWildcard","require","_Predicate","_Utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","symbol","exports","Symbol","for","equals","arguments","length","self","compareBoth","that","selfType","isEqual","hash","structuralRegionState","enabled","tester","Date","toISOString","URL","href","Array","isArray","every","v","getPrototypeOf","prototype","keysSelf","keys","keysThat","key","u","hasProperty","equivalence"],"sources":["../../src/Equal.ts"],"sourcesContent":[null],"mappings":";;;;;;;AAIA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAkD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SA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WAAA","ignoreList":[]}
|
||||
181
node_modules/effect/dist/cjs/Equivalence.js
generated
vendored
Normal file
181
node_modules/effect/dist/cjs/Equivalence.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.tuple = exports.symbol = exports.struct = exports.string = exports.strict = exports.productMany = exports.product = exports.number = exports.mapInput = exports.make = exports.combineMany = exports.combineAll = exports.combine = exports.boolean = exports.bigint = exports.array = exports.all = exports.Date = void 0;
|
||||
var _Function = require("./Function.js");
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category constructors
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const make = isEquivalent => (self, that) => self === that || isEquivalent(self, that);
|
||||
exports.make = make;
|
||||
const isStrictEquivalent = (x, y) => x === y;
|
||||
/**
|
||||
* Return an `Equivalence` that uses strict equality (===) to compare values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const strict = () => isStrictEquivalent;
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.strict = strict;
|
||||
const string = exports.string = /*#__PURE__*/strict();
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const number = exports.number = /*#__PURE__*/strict();
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const boolean = exports.boolean = /*#__PURE__*/strict();
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const bigint = exports.bigint = /*#__PURE__*/strict();
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const symbol = exports.symbol = /*#__PURE__*/strict();
|
||||
/**
|
||||
* @category combining
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const combine = exports.combine = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => make((x, y) => self(x, y) && that(x, y)));
|
||||
/**
|
||||
* @category combining
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const combineMany = exports.combineMany = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const combineAll = collection => combineMany(isAlwaysEquivalent, collection);
|
||||
/**
|
||||
* @category mapping
|
||||
* @since 2.0.0
|
||||
*/
|
||||
exports.combineAll = combineAll;
|
||||
const mapInput = exports.mapInput = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => make((x, y) => self(f(x), f(y))));
|
||||
/**
|
||||
* @category instances
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const Date = exports.Date = /*#__PURE__*/mapInput(number, date => date.getTime());
|
||||
/**
|
||||
* @category combining
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const product = exports.product = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => make(([xa, xb], [ya, yb]) => self(xa, ya) && that(xb, yb)));
|
||||
/**
|
||||
* @category combining
|
||||
* @since 2.0.0
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.all = all;
|
||||
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
|
||||
*/
|
||||
exports.productMany = productMany;
|
||||
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
|
||||
*/
|
||||
exports.tuple = tuple;
|
||||
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
|
||||
*/
|
||||
exports.array = array;
|
||||
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;
|
||||
});
|
||||
};
|
||||
exports.struct = struct;
|
||||
//# sourceMappingURL=Equivalence.js.map
|
||||
1
node_modules/effect/dist/cjs/Equivalence.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Equivalence.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Equivalence.js","names":["_Function","require","make","isEquivalent","self","that","exports","isStrictEquivalent","x","y","strict","string","number","boolean","bigint","symbol","combine","dual","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":";;;;;;AAOA,IAAAA,SAAA,GAAAC,OAAA;AAPA;;;;;;;;AA0BA;;;;AAIO,MAAMC,IAAI,GAAOC,YAA2C,IAAqB,CAACC,IAAO,EAAEC,IAAO,KACvGD,IAAI,KAAKC,IAAI,IAAIF,YAAY,CAACC,IAAI,EAAEC,IAAI,CAAC;AAAAC,OAAA,CAAAJ,IAAA,GAAAA,IAAA;AAE3C,MAAMK,kBAAkB,GAAGA,CAACC,CAAU,EAAEC,CAAU,KAAKD,CAAC,KAAKC,CAAC;AAE9D;;;;;;AAMO,MAAMC,MAAM,GAA4BA,CAAA,KAAMH,kBAAkB;AAEvE;;;;AAAAD,OAAA,CAAAI,MAAA,GAAAA,MAAA;AAIO,MAAMC,MAAM,GAAAL,OAAA,CAAAK,MAAA,gBAAwBD,MAAM,EAAE;AAEnD;;;;AAIO,MAAME,MAAM,GAAAN,OAAA,CAAAM,MAAA,gBAAwBF,MAAM,EAAE;AAEnD;;;;AAIO,MAAMG,OAAO,GAAAP,OAAA,CAAAO,OAAA,gBAAyBH,MAAM,EAAE;AAErD;;;;AAIO,MAAMI,MAAM,GAAAR,OAAA,CAAAQ,MAAA,gBAAwBJ,MAAM,EAAE;AAEnD;;;;AAIO,MAAMK,MAAM,GAAAT,OAAA,CAAAS,MAAA,gBAAwBL,MAAM,EAAE;AAEnD;;;;AAI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,KAAK;MACd;IACF;IACA,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC;AAAA/C,OAAA,CAAA2C,MAAA,GAAAA,MAAA","ignoreList":[]}
|
||||
108
node_modules/effect/dist/cjs/ExecutionPlan.js
generated
vendored
Normal file
108
node_modules/effect/dist/cjs/ExecutionPlan.js
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.merge = exports.make = exports.isExecutionPlan = exports.TypeId = void 0;
|
||||
var Effect = _interopRequireWildcard(require("./Effect.js"));
|
||||
var internal = _interopRequireWildcard(require("./internal/executionPlan.js"));
|
||||
var Layer = _interopRequireWildcard(require("./Layer.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 3.16.0
|
||||
* @category Symbols
|
||||
* @experimental
|
||||
*/
|
||||
const TypeId = exports.TypeId = internal.TypeId;
|
||||
/**
|
||||
* @since 3.16.0
|
||||
* @category Guards
|
||||
* @experimental
|
||||
*/
|
||||
const isExecutionPlan = exports.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 AiLanguageModel } from "@effect/ai"
|
||||
* import type { Layer } from "effect"
|
||||
* import { Effect, ExecutionPlan, Schedule } from "effect"
|
||||
*
|
||||
* declare const layerBad: Layer.Layer<AiLanguageModel.AiLanguageModel>
|
||||
* declare const layerGood: Layer.Layer<AiLanguageModel.AiLanguageModel>
|
||||
*
|
||||
* 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,
|
||||
* AiLanguageModel.AiLanguageModel
|
||||
* >
|
||||
* const withPlan: Effect.Effect<void> = Effect.withExecutionPlan(effect, ThePlan)
|
||||
* ```
|
||||
*
|
||||
* @since 3.16.0
|
||||
* @category Constructors
|
||||
* @experimental
|
||||
*/
|
||||
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
|
||||
};
|
||||
}));
|
||||
exports.make = make;
|
||||
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 (0, _Pipeable.pipeArguments)(this, arguments);
|
||||
}
|
||||
};
|
||||
const makeProto = steps => {
|
||||
const self = Object.create(Proto);
|
||||
self.steps = steps;
|
||||
return self;
|
||||
};
|
||||
/**
|
||||
* @since 3.16.0
|
||||
* @category Combining
|
||||
* @experimental
|
||||
*/
|
||||
const merge = (...plans) => makeProto(plans.flatMap(plan => plan.steps));
|
||||
exports.merge = merge;
|
||||
//# sourceMappingURL=ExecutionPlan.js.map
|
||||
1
node_modules/effect/dist/cjs/ExecutionPlan.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ExecutionPlan.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExecutionPlan.js","names":["Effect","_interopRequireWildcard","require","internal","Layer","_Pipeable","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","exports","isExecutionPlan","make","steps","makeProto","map","options","attempts","Error","schedule","while","input","suspend","result","succeed","undefined","provide","Proto","withRequirements","self","contextWith","context","step","isLayer","succeedContext","pipe","pipeArguments","arguments","create","merge","plans","flatMap","plan"],"sources":["../../src/ExecutionPlan.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AAA6C,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA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;EACjCE,IAAI,CAAChB,KAAK,GAAGA,KAAK;EAClB,OAAOgB,IAAI;AACb,CAAC;AAED;;;;;AAKO,MAAMU,KAAK,GAAGA,CACnB,GAAGC,KAAY,KAMX1B,SAAS,CAAC0B,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAAC7B,KAAK,CAAQ,CAAC;AAAAH,OAAA,CAAA6B,KAAA,GAAAA,KAAA","ignoreList":[]}
|
||||
62
node_modules/effect/dist/cjs/ExecutionStrategy.js
generated
vendored
Normal file
62
node_modules/effect/dist/cjs/ExecutionStrategy.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.sequential = exports.parallelN = exports.parallel = exports.match = exports.isSequential = exports.isParallelN = exports.isParallel = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/executionStrategy.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* Execute effects sequentially.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const sequential = exports.sequential = internal.sequential;
|
||||
/**
|
||||
* Execute effects in parallel.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const parallel = exports.parallel = internal.parallel;
|
||||
/**
|
||||
* Execute effects in parallel, up to the specified number of concurrent fibers.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const parallelN = exports.parallelN = internal.parallelN;
|
||||
/**
|
||||
* Returns `true` if the specified `ExecutionStrategy` is an instance of
|
||||
* `Sequential`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isSequential = exports.isSequential = internal.isSequential;
|
||||
/**
|
||||
* Returns `true` if the specified `ExecutionStrategy` is an instance of
|
||||
* `Sequential`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isParallel = exports.isParallel = internal.isParallel;
|
||||
/**
|
||||
* Returns `true` if the specified `ExecutionStrategy` is an instance of
|
||||
* `Sequential`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isParallelN = exports.isParallelN = internal.isParallelN;
|
||||
/**
|
||||
* Folds over the specified `ExecutionStrategy` using the provided case
|
||||
* functions.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const match = exports.match = internal.match;
|
||||
//# sourceMappingURL=ExecutionStrategy.js.map
|
||||
1
node_modules/effect/dist/cjs/ExecutionStrategy.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/ExecutionStrategy.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExecutionStrategy.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","sequential","exports","parallel","parallelN","isSequential","isParallel","isParallelN","match"],"sources":["../../src/ExecutionStrategy.ts"],"sourcesContent":[null],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA2D,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,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AAU,GAAAJ,OAAA,CAAAI,UAAA,GAAkD3B,QAAQ,CAAC2B,UAAU;AAE5F;;;;;;;AAOO,MAAMC,WAAW,GAAAL,OAAA,CAAAK,WAAA,GAAmD5B,QAAQ,CAAC4B,WAAW;AAE/F;;;;;;;AAOO,MAAMC,KAAK,GAAAN,OAAA,CAAAM,KAAA,GA8Bd7B,QAAQ,CAAC6B,KAAK","ignoreList":[]}
|
||||
256
node_modules/effect/dist/cjs/Exit.js
generated
vendored
Normal file
256
node_modules/effect/dist/cjs/Exit.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zipWith = exports.zipRight = exports.zipParRight = exports.zipParLeft = exports.zipPar = exports.zipLeft = exports.zip = exports.void = exports.succeed = exports.matchEffect = exports.match = exports.mapErrorCause = exports.mapError = exports.mapBoth = exports.map = exports.isSuccess = exports.isInterrupted = exports.isFailure = exports.isExit = exports.interrupt = exports.getOrElse = exports.fromOption = exports.fromEither = exports.forEachEffect = exports.flatten = exports.flatMapEffect = exports.flatMap = exports.failCause = exports.fail = exports.exists = exports.die = exports.causeOption = exports.asVoid = exports.as = exports.all = void 0;
|
||||
var core = _interopRequireWildcard(require("./internal/core.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* Returns `true` if the specified value is an `Exit`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isExit = exports.isExit = core.exitIsExit;
|
||||
/**
|
||||
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isFailure = exports.isFailure = core.exitIsFailure;
|
||||
/**
|
||||
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isSuccess = exports.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
|
||||
*/
|
||||
const isInterrupted = exports.isInterrupted = core.exitIsInterrupted;
|
||||
/**
|
||||
* Maps the `Success` value of the specified exit to the provided constant
|
||||
* value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const as = exports.as = core.exitAs;
|
||||
/**
|
||||
* Maps the `Success` value of the specified exit to a void.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const asVoid = exports.asVoid = core.exitAsVoid;
|
||||
/**
|
||||
* Returns a `Some<Cause<E>>` if the specified exit is a `Failure`, `None`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const causeOption = exports.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
|
||||
*/
|
||||
const all = exports.all = core.exitCollectAll;
|
||||
/**
|
||||
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const die = exports.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
|
||||
*/
|
||||
const exists = exports.exists = core.exitExists;
|
||||
/**
|
||||
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
||||
* `E`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fail = exports.fail = core.exitFail;
|
||||
/**
|
||||
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const failCause = exports.failCause = core.exitFailCause;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category sequencing
|
||||
*/
|
||||
const flatMap = exports.flatMap = core.exitFlatMap;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category sequencing
|
||||
*/
|
||||
const flatMapEffect = exports.flatMapEffect = core.exitFlatMapEffect;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category sequencing
|
||||
*/
|
||||
const flatten = exports.flatten = core.exitFlatten;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category traversing
|
||||
*/
|
||||
const forEachEffect = exports.forEachEffect = core.exitForEachEffect;
|
||||
/**
|
||||
* Converts an `Either<R, L>` into an `Exit<R, L>`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category conversions
|
||||
*/
|
||||
const fromEither = exports.fromEither = core.exitFromEither;
|
||||
/**
|
||||
* Converts an `Option<A>` into an `Exit<void, A>`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category conversions
|
||||
*/
|
||||
const fromOption = exports.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
|
||||
*/
|
||||
const getOrElse = exports.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
|
||||
*/
|
||||
const interrupt = exports.interrupt = core.exitInterrupt;
|
||||
/**
|
||||
* Maps over the `Success` value of the specified exit using the provided
|
||||
* function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const map = exports.map = core.exitMap;
|
||||
/**
|
||||
* Maps over the `Success` and `Failure` cases of the specified exit using the
|
||||
* provided functions.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const mapBoth = exports.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
|
||||
*/
|
||||
const mapError = exports.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
|
||||
*/
|
||||
const mapErrorCause = exports.mapErrorCause = core.exitMapErrorCause;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const match = exports.match = core.exitMatch;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const matchEffect = exports.matchEffect = core.exitMatchEffect;
|
||||
/**
|
||||
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const succeed = exports.succeed = core.exitSucceed;
|
||||
const void_ = exports.void = core.exitVoid;
|
||||
/**
|
||||
* Sequentially zips the this result with the specified result or else returns
|
||||
* the failed `Cause<E | E2>`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zip = exports.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
|
||||
*/
|
||||
const zipLeft = exports.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
|
||||
*/
|
||||
const zipRight = exports.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
|
||||
*/
|
||||
const zipPar = exports.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
|
||||
*/
|
||||
const zipParLeft = exports.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
|
||||
*/
|
||||
const zipParRight = exports.zipParRight = core.exitZipParRight;
|
||||
/**
|
||||
* Zips this exit together with that exit using the specified combination
|
||||
* functions.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zipWith = exports.zipWith = core.exitZipWith;
|
||||
//# sourceMappingURL=Exit.js.map
|
||||
1
node_modules/effect/dist/cjs/Exit.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Exit.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Exit.js","names":["core","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isExit","exports","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_","void","exitVoid","zip","exitZip","zipLeft","exitZipLeft","zipRight","exitZipRight","zipPar","exitZipPar","zipParLeft","exitZipParLeft","zipParRight","exitZipParRight","zipWith","exitZipWith"],"sources":["../../src/Exit.ts"],"sourcesContent":[null],"mappings":";;;;;;AAQA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA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;;;;;;;AAOO,MAAMC,aAAa,GAAA9C,OAAA,CAAA8C,aAAA,GAiBtBrE,IAAI,CAACsE,iBAAiB;AAE1B;;;;AAIO,MAAMC,KAAK,GAAAhD,OAAA,CAAAgD,KAAA,GAgBdvE,IAAI,CAACwE,SAAS;AAElB;;;;AAIO,MAAMC,WAAW,GAAAlD,OAAA,CAAAkD,WAAA,GAsBpBzE,IAAI,CAAC0E,eAAe;AAExB;;;;;;AAMO,MAAMC,OAAO,GAAApD,OAAA,CAAAoD,OAAA,GAA6B3E,IAAI,CAAC4E,WAAW;AAEjE,MAAMC,KAAK,GAAAtD,OAAA,CAAAuD,IAAA,GAAe9E,IAAI,CAAC+E,QAAQ;AAWvC;;;;;;;AAOO,MAAMC,GAAG,GAAAzD,OAAA,CAAAyD,GAAA,GAiBZhF,IAAI,CAACiF,OAAO;AAEhB;;;;;;;AAOO,MAAMC,OAAO,GAAA3D,OAAA,CAAA2D,OAAA,GAiBhBlF,IAAI,CAACmF,WAAW;AAEpB;;;;;;;AAOO,MAAMC,QAAQ,GAAA7D,OAAA,CAAA6D,QAAA,GAiBjBpF,IAAI,CAACqF,YAAY;AAErB;;;;;;;AAOO,MAAMC,MAAM,GAAA/D,OAAA,CAAA+D,MAAA,GAiBftF,IAAI,CAACuF,UAAU;AAEnB;;;;;;;AAOO,MAAMC,UAAU,GAAAjE,OAAA,CAAAiE,UAAA,GAiBnBxF,IAAI,CAACyF,cAAc;AAEvB;;;;;;;AAOO,MAAMC,WAAW,GAAAnE,OAAA,CAAAmE,WAAA,GAiBpB1F,IAAI,CAAC2F,eAAe;AAExB;;;;;;;AAOO,MAAMC,OAAO,GAAArE,OAAA,CAAAqE,OAAA,GA8BhB5F,IAAI,CAAC6F,WAAW","ignoreList":[]}
|
||||
17
node_modules/effect/dist/cjs/FastCheck.js
generated
vendored
Normal file
17
node_modules/effect/dist/cjs/FastCheck.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _fastCheck = require("fast-check");
|
||||
Object.keys(_fastCheck).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _fastCheck[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _fastCheck[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=FastCheck.js.map
|
||||
1
node_modules/effect/dist/cjs/FastCheck.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FastCheck.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FastCheck.js","names":["_fastCheck","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/FastCheck.ts"],"sourcesContent":[null],"mappings":";;;;;AAQA,IAAAA,UAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,UAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,UAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,UAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
||||
340
node_modules/effect/dist/cjs/Fiber.js
generated
vendored
Normal file
340
node_modules/effect/dist/cjs/Fiber.js
generated
vendored
Normal file
@@ -0,0 +1,340 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zip = exports.void = exports.unsafeRoots = exports.succeed = exports.status = exports.scoped = exports.roots = exports.pretty = exports.poll = exports.orElseEither = exports.orElse = exports.never = exports.match = exports.mapFiber = exports.mapEffect = exports.map = exports.joinAll = exports.join = exports.isRuntimeFiber = exports.isFiber = exports.interrupted = exports.interruptFork = exports.interruptAsFork = exports.interruptAs = exports.interruptAllAs = exports.interruptAll = exports.interrupt = exports.inheritAll = exports.id = exports.getCurrentFiber = exports.fromEffect = exports.failCause = exports.fail = exports.dumpAll = exports.dump = exports.done = exports.children = exports.awaitAll = exports.await = exports.all = exports.RuntimeFiberTypeId = exports.Order = exports.FiberTypeId = void 0;
|
||||
var core = _interopRequireWildcard(require("./internal/core.js"));
|
||||
var circular = _interopRequireWildcard(require("./internal/effect/circular.js"));
|
||||
var internal = _interopRequireWildcard(require("./internal/fiber.js"));
|
||||
var fiberRuntime = _interopRequireWildcard(require("./internal/fiberRuntime.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FiberTypeId = exports.FiberTypeId = internal.FiberTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const RuntimeFiberTypeId = exports.RuntimeFiberTypeId = internal.RuntimeFiberTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category instances
|
||||
*/
|
||||
const Order = exports.Order = internal.Order;
|
||||
/**
|
||||
* Returns `true` if the specified value is a `Fiber`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isFiber = exports.isFiber = internal.isFiber;
|
||||
/**
|
||||
* Returns `true` if the specified `Fiber` is a `RuntimeFiber`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isRuntimeFiber = exports.isRuntimeFiber = internal.isRuntimeFiber;
|
||||
/**
|
||||
* The identity of the fiber.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const id = exports.id = internal.id;
|
||||
const _await = exports.await = internal._await;
|
||||
/**
|
||||
* Awaits on all fibers to be completed, successfully or not.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const awaitAll = exports.awaitAll = fiberRuntime.fiberAwaitAll;
|
||||
/**
|
||||
* Retrieves the immediate children of the fiber.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const children = exports.children = internal.children;
|
||||
/**
|
||||
* Collects all fibers into a single fiber producing an in-order list of the
|
||||
* results.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const all = exports.all = fiberRuntime.fiberAll;
|
||||
/**
|
||||
* A fiber that is done with the specified `Exit` value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const done = exports.done = internal.done;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const dump = exports.dump = internal.dump;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const dumpAll = exports.dumpAll = internal.dumpAll;
|
||||
/**
|
||||
* A fiber that has already failed with the specified value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fail = exports.fail = internal.fail;
|
||||
/**
|
||||
* Creates a `Fiber` that has already failed with the specified cause.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const failCause = exports.failCause = internal.failCause;
|
||||
/**
|
||||
* Lifts an `Effect` into a `Fiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category conversions
|
||||
*/
|
||||
const fromEffect = exports.fromEffect = internal.fromEffect;
|
||||
/**
|
||||
* Gets the current fiber if one is running.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utilities
|
||||
*/
|
||||
const getCurrentFiber = exports.getCurrentFiber = internal.getCurrentFiber;
|
||||
/**
|
||||
* Inherits values from all `FiberRef` instances into current fiber. This
|
||||
* will resume immediately.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const inheritAll = exports.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
|
||||
*/
|
||||
const interrupt = exports.interrupt = core.interruptFiber;
|
||||
/**
|
||||
* Constructrs a `Fiber` that is already interrupted.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const interrupted = exports.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
|
||||
*/
|
||||
const interruptAs = exports.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
|
||||
*/
|
||||
const interruptAsFork = exports.interruptAsFork = internal.interruptAsFork;
|
||||
/**
|
||||
* Interrupts all fibers, awaiting their interruption.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category interruption
|
||||
*/
|
||||
const interruptAll = exports.interruptAll = internal.interruptAll;
|
||||
/**
|
||||
* Interrupts all fibers as by the specified fiber, awaiting their
|
||||
* interruption.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category interruption
|
||||
*/
|
||||
const interruptAllAs = exports.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
|
||||
*/
|
||||
const interruptFork = exports.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
|
||||
*/
|
||||
const join = exports.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
|
||||
*/
|
||||
const joinAll = exports.joinAll = fiberRuntime.fiberJoinAll;
|
||||
/**
|
||||
* Maps over the value the Fiber computes.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const map = exports.map = internal.map;
|
||||
/**
|
||||
* Effectually maps over the value the fiber computes.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const mapEffect = exports.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
|
||||
*/
|
||||
const mapFiber = exports.mapFiber = internal.mapFiber;
|
||||
/**
|
||||
* Folds over the `Fiber` or `RuntimeFiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const match = exports.match = internal.match;
|
||||
/**
|
||||
* A fiber that never fails or succeeds.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const never = exports.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
|
||||
*/
|
||||
const orElse = exports.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
|
||||
*/
|
||||
const orElseEither = exports.orElseEither = internal.orElseEither;
|
||||
/**
|
||||
* Tentatively observes the fiber, but returns immediately if it is not
|
||||
* already done.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const poll = exports.poll = internal.poll;
|
||||
/**
|
||||
* Pretty-prints a `RuntimeFiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const pretty = exports.pretty = internal.pretty;
|
||||
/**
|
||||
* Returns a chunk containing all root fibers.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const roots = exports.roots = internal.roots;
|
||||
/**
|
||||
* Returns a chunk containing all root fibers.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeRoots = exports.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
|
||||
*/
|
||||
const scoped = exports.scoped = fiberRuntime.fiberScoped;
|
||||
/**
|
||||
* Returns the `FiberStatus` of a `RuntimeFiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const status = exports.status = internal.status;
|
||||
/**
|
||||
* Returns a fiber that has already succeeded with the specified value.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const succeed = exports.succeed = internal.succeed;
|
||||
const void_ = exports.void = internal.void;
|
||||
/**
|
||||
* Zips this fiber and the specified fiber together, producing a tuple of
|
||||
* their output.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zip = exports.zip = circular.zipFiber;
|
||||
/**
|
||||
* Same as `zip` but discards the output of that `Fiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zipLeft = exports.zipLeft = circular.zipLeftFiber;
|
||||
/**
|
||||
* Same as `zip` but discards the output of this `Fiber`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category zipping
|
||||
*/
|
||||
const zipRight = exports.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
|
||||
*/
|
||||
const zipWith = exports.zipWith = circular.zipWithFiber;
|
||||
//# sourceMappingURL=Fiber.js.map
|
||||
1
node_modules/effect/dist/cjs/Fiber.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Fiber.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
328
node_modules/effect/dist/cjs/FiberHandle.js
generated
vendored
Normal file
328
node_modules/effect/dist/cjs/FiberHandle.js
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeSet = exports.unsafeGet = exports.set = exports.runtimePromise = exports.runtime = exports.run = exports.makeRuntimePromise = exports.makeRuntime = exports.make = exports.join = exports.isFiberHandle = exports.get = exports.clear = exports.awaitEmpty = exports.TypeId = void 0;
|
||||
var Cause = _interopRequireWildcard(require("./Cause.js"));
|
||||
var Deferred = _interopRequireWildcard(require("./Deferred.js"));
|
||||
var Effect = _interopRequireWildcard(require("./Effect.js"));
|
||||
var Exit = _interopRequireWildcard(require("./Exit.js"));
|
||||
var Fiber = _interopRequireWildcard(require("./Fiber.js"));
|
||||
var FiberId = _interopRequireWildcard(require("./FiberId.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var HashSet = _interopRequireWildcard(require("./HashSet.js"));
|
||||
var Inspectable = _interopRequireWildcard(require("./Inspectable.js"));
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
var Predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
var Runtime = _interopRequireWildcard(require("./Runtime.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories type ids
|
||||
*/
|
||||
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("effect/FiberHandle");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories refinements
|
||||
*/
|
||||
const isFiberHandle = u => Predicate.hasProperty(u, TypeId);
|
||||
exports.isFiberHandle = isFiberHandle;
|
||||
const Proto = {
|
||||
[TypeId]: TypeId,
|
||||
toString() {
|
||||
return Inspectable.format(this.toJSON());
|
||||
},
|
||||
toJSON() {
|
||||
return {
|
||||
_id: "FiberHandle",
|
||||
state: this.state
|
||||
};
|
||||
},
|
||||
[Inspectable.NodeInspectSymbol]() {
|
||||
return this.toJSON();
|
||||
},
|
||||
pipe() {
|
||||
return (0, _Pipeable.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.make = make;
|
||||
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
|
||||
*/
|
||||
exports.makeRuntime = makeRuntime;
|
||||
const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
|
||||
exports.makeRuntimePromise = makeRuntimePromise;
|
||||
const internalFiberIdId = -1;
|
||||
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
|
||||
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
|
||||
emptyCase: _Function.constFalse,
|
||||
failCase: _Function.constFalse,
|
||||
dieCase: _Function.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
|
||||
*/
|
||||
const unsafeSet = exports.unsafeSet = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const set = exports.set = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.unsafeGet = unsafeGet;
|
||||
const get = self => Effect.suspend(() => unsafeGet(self));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories combinators
|
||||
*/
|
||||
exports.get = get;
|
||||
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;
|
||||
}
|
||||
}));
|
||||
}));
|
||||
exports.clear = clear;
|
||||
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
|
||||
*/
|
||||
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);
|
||||
};
|
||||
exports.run = run;
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.runtime = runtime;
|
||||
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));
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
exports.runtimePromise = runtimePromise;
|
||||
const join = self => Deferred.await(self.deferred);
|
||||
/**
|
||||
* Wait for the fiber in the FiberHandle to complete.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @categories combinators
|
||||
*/
|
||||
exports.join = join;
|
||||
const awaitEmpty = self => Effect.suspend(() => {
|
||||
if (self.state._tag === "Closed" || self.state.fiber === undefined) {
|
||||
return Effect.void;
|
||||
}
|
||||
return Fiber.await(self.state.fiber);
|
||||
});
|
||||
exports.awaitEmpty = awaitEmpty;
|
||||
//# sourceMappingURL=FiberHandle.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberHandle.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberHandle.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
122
node_modules/effect/dist/cjs/FiberId.js
generated
vendored
Normal file
122
node_modules/effect/dist/cjs/FiberId.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeMake = exports.toSet = exports.toOption = exports.threadName = exports.runtime = exports.none = exports.make = exports.isRuntime = exports.isNone = exports.isFiberId = exports.isComposite = exports.ids = exports.getOrElse = exports.composite = exports.combineAll = exports.combine = exports.FiberIdTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/fiberId.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FiberIdTypeId = exports.FiberIdTypeId = internal.FiberIdTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const none = exports.none = internal.none;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const runtime = exports.runtime = internal.runtime;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const composite = exports.composite = internal.composite;
|
||||
/**
|
||||
* Returns `true` if the specified unknown value is a `FiberId`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isFiberId = exports.isFiberId = internal.isFiberId;
|
||||
/**
|
||||
* Returns `true` if the `FiberId` is a `None`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isNone = exports.isNone = internal.isNone;
|
||||
/**
|
||||
* Returns `true` if the `FiberId` is a `Runtime`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isRuntime = exports.isRuntime = internal.isRuntime;
|
||||
/**
|
||||
* Returns `true` if the `FiberId` is a `Composite`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isComposite = exports.isComposite = internal.isComposite;
|
||||
/**
|
||||
* Combine two `FiberId`s.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const combine = exports.combine = internal.combine;
|
||||
/**
|
||||
* Combines a set of `FiberId`s into a single `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const combineAll = exports.combineAll = internal.combineAll;
|
||||
/**
|
||||
* Returns this `FiberId` if it is not `None`, otherwise returns that `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const getOrElse = exports.getOrElse = internal.getOrElse;
|
||||
/**
|
||||
* Get the set of identifiers for this `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const ids = exports.ids = internal.ids;
|
||||
/**
|
||||
* Creates a new `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.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
|
||||
*/
|
||||
const threadName = exports.threadName = internal.threadName;
|
||||
/**
|
||||
* Convert a `FiberId` into an `Option<FiberId>`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toOption = exports.toOption = internal.toOption;
|
||||
/**
|
||||
* Convert a `FiberId` into a `HashSet<FiberId>`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const toSet = exports.toSet = internal.toSet;
|
||||
/**
|
||||
* Unsafely creates a new `FiberId`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category unsafe
|
||||
*/
|
||||
const unsafeMake = exports.unsafeMake = internal.unsafeMake;
|
||||
//# sourceMappingURL=FiberId.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberId.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberId.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FiberId.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FiberIdTypeId","exports","none","runtime","composite","isFiberId","isNone","isRuntime","isComposite","combine","combineAll","getOrElse","ids","make","threadName","toOption","toSet","unsafeMake"],"sources":["../../src/FiberId.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAGjD;;;;AAIO,MAAMkB,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAA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AAc,QAAA,GAA8CrC,QAAQ,CAACqC,QAAQ;AAEpF;;;;;;AAMO,MAAMC,KAAK,GAAAf,OAAA,CAAAe,KAAA,GAAgDtC,QAAQ,CAACsC,KAAK;AAEhF;;;;;;AAMO,MAAMC,UAAU,GAAAhB,OAAA,CAAAgB,UAAA,GAAyBvC,QAAQ,CAACuC,UAAU","ignoreList":[]}
|
||||
367
node_modules/effect/dist/cjs/FiberMap.js
generated
vendored
Normal file
367
node_modules/effect/dist/cjs/FiberMap.js
generated
vendored
Normal file
@@ -0,0 +1,367 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeSet = exports.unsafeHas = exports.unsafeGet = exports.size = exports.set = exports.runtimePromise = exports.runtime = exports.run = exports.remove = exports.makeRuntimePromise = exports.makeRuntime = exports.make = exports.join = exports.isFiberMap = exports.has = exports.get = exports.clear = exports.awaitEmpty = exports.TypeId = void 0;
|
||||
var Cause = _interopRequireWildcard(require("./Cause.js"));
|
||||
var Deferred = _interopRequireWildcard(require("./Deferred.js"));
|
||||
var Effect = _interopRequireWildcard(require("./Effect.js"));
|
||||
var Exit = _interopRequireWildcard(require("./Exit.js"));
|
||||
var Fiber = _interopRequireWildcard(require("./Fiber.js"));
|
||||
var FiberId = _interopRequireWildcard(require("./FiberId.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var HashSet = _interopRequireWildcard(require("./HashSet.js"));
|
||||
var Inspectable = _interopRequireWildcard(require("./Inspectable.js"));
|
||||
var Iterable = _interopRequireWildcard(require("./Iterable.js"));
|
||||
var MutableHashMap = _interopRequireWildcard(require("./MutableHashMap.js"));
|
||||
var Option = _interopRequireWildcard(require("./Option.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
var Predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
var Runtime = _interopRequireWildcard(require("./Runtime.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories type ids
|
||||
*/
|
||||
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("effect/FiberMap");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories refinements
|
||||
*/
|
||||
const isFiberMap = u => Predicate.hasProperty(u, TypeId);
|
||||
exports.isFiberMap = isFiberMap;
|
||||
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 (0, _Pipeable.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.make = make;
|
||||
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
|
||||
*/
|
||||
exports.makeRuntime = makeRuntime;
|
||||
const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
|
||||
exports.makeRuntimePromise = makeRuntimePromise;
|
||||
const internalFiberIdId = -1;
|
||||
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
|
||||
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
|
||||
emptyCase: _Function.constFalse,
|
||||
failCase: _Function.constFalse,
|
||||
dieCase: _Function.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
|
||||
*/
|
||||
const unsafeSet = exports.unsafeSet = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const set = exports.set = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const unsafeGet = exports.unsafeGet = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const get = exports.get = /*#__PURE__*/(0, _Function.dual)(2, (self, key) => Effect.suspend(() => unsafeGet(self, key)));
|
||||
/**
|
||||
* Check if a key exists in the FiberMap.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @categories combinators
|
||||
*/
|
||||
const unsafeHas = exports.unsafeHas = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const has = exports.has = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const remove = exports.remove = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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)));
|
||||
});
|
||||
exports.clear = clear;
|
||||
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
|
||||
*/
|
||||
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);
|
||||
};
|
||||
exports.run = run;
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.runtime = runtime;
|
||||
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
|
||||
*/
|
||||
exports.runtimePromise = runtimePromise;
|
||||
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));
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
exports.size = size;
|
||||
const join = self => Deferred.await(self.deferred);
|
||||
/**
|
||||
* Wait for the FiberMap to be empty.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @categories combinators
|
||||
*/
|
||||
exports.join = join;
|
||||
const awaitEmpty = self => Effect.whileLoop({
|
||||
while: () => self.state._tag === "Open" && MutableHashMap.size(self.state.backing) > 0,
|
||||
body: () => Fiber.await(Iterable.unsafeHead(self)[1]),
|
||||
step: _Function.constVoid
|
||||
});
|
||||
exports.awaitEmpty = awaitEmpty;
|
||||
//# sourceMappingURL=FiberMap.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberMap.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberMap.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
238
node_modules/effect/dist/cjs/FiberRef.js
generated
vendored
Normal file
238
node_modules/effect/dist/cjs/FiberRef.js
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.updateSomeAndGet = exports.updateSome = exports.updateAndGet = exports.update = exports.unsafeMakeSupervisor = exports.unsafeMakePatch = exports.unsafeMakeHashSet = exports.unsafeMakeContext = exports.unsafeMake = exports.unhandledErrorLogLevel = exports.set = exports.reset = exports.modifySome = exports.modify = exports.makeWith = exports.makeRuntimeFlags = exports.makeContext = exports.make = exports.interruptedCause = exports.getWith = exports.getAndUpdateSome = exports.getAndUpdate = exports.getAndSet = exports.get = exports.delete = exports.currentTracerTimingEnabled = exports.currentTracerSpanLinks = exports.currentTracerSpanAnnotations = exports.currentTracerEnabled = exports.currentSupervisor = exports.currentSchedulingPriority = exports.currentScheduler = exports.currentRuntimeFlags = exports.currentRequestCacheEnabled = exports.currentRequestCache = exports.currentRequestBatchingEnabled = exports.currentMinimumLogLevel = exports.currentMetricLabels = exports.currentMaxOpsBeforeYield = exports.currentLoggers = exports.currentLogSpan = exports.currentLogLevel = exports.currentLogAnnotations = exports.currentContext = exports.currentConcurrency = exports.FiberRefTypeId = void 0;
|
||||
var core = _interopRequireWildcard(require("./internal/core.js"));
|
||||
var fiberRuntime = _interopRequireWildcard(require("./internal/fiberRuntime.js"));
|
||||
var query = _interopRequireWildcard(require("./internal/query.js"));
|
||||
var Scheduler = _interopRequireWildcard(require("./Scheduler.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FiberRefTypeId = exports.FiberRefTypeId = core.FiberRefTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = fiberRuntime.fiberRefMake;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeWith = exports.makeWith = fiberRuntime.fiberRefMakeWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeContext = exports.makeContext = fiberRuntime.fiberRefMakeContext;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const makeRuntimeFlags = exports.makeRuntimeFlags = fiberRuntime.fiberRefMakeRuntimeFlags;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMake = exports.unsafeMake = core.fiberRefUnsafeMake;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMakeHashSet = exports.unsafeMakeHashSet = core.fiberRefUnsafeMakeHashSet;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMakeContext = exports.unsafeMakeContext = core.fiberRefUnsafeMakeContext;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMakeSupervisor = exports.unsafeMakeSupervisor = fiberRuntime.fiberRefUnsafeMakeSupervisor;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const unsafeMakePatch = exports.unsafeMakePatch = core.fiberRefUnsafeMakePatch;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const get = exports.get = core.fiberRefGet;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const getAndSet = exports.getAndSet = core.fiberRefGetAndSet;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const getAndUpdate = exports.getAndUpdate = core.fiberRefGetAndUpdate;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const getAndUpdateSome = exports.getAndUpdateSome = core.fiberRefGetAndUpdateSome;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const getWith = exports.getWith = core.fiberRefGetWith;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const set = exports.set = core.fiberRefSet;
|
||||
const _delete = exports.delete = core.fiberRefDelete;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const reset = exports.reset = core.fiberRefReset;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const modify = exports.modify = core.fiberRefModify;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const modifySome = exports.modifySome = core.fiberRefModifySome;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const update = exports.update = core.fiberRefUpdate;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const updateSome = exports.updateSome = core.fiberRefUpdateSome;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const updateAndGet = exports.updateAndGet = core.fiberRefUpdateAndGet;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const updateSomeAndGet = exports.updateSomeAndGet = core.fiberRefUpdateSomeAndGet;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentConcurrency = exports.currentConcurrency = core.currentConcurrency;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentRequestBatchingEnabled = exports.currentRequestBatchingEnabled = core.currentRequestBatching;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentRequestCache = exports.currentRequestCache = query.currentCache;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentRequestCacheEnabled = exports.currentRequestCacheEnabled = query.currentCacheEnabled;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentContext = exports.currentContext = core.currentContext;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentSchedulingPriority = exports.currentSchedulingPriority = core.currentSchedulingPriority;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentMaxOpsBeforeYield = exports.currentMaxOpsBeforeYield = core.currentMaxOpsBeforeYield;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const unhandledErrorLogLevel = exports.unhandledErrorLogLevel = core.currentUnhandledErrorLogLevel;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentLogAnnotations = exports.currentLogAnnotations = core.currentLogAnnotations;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentLoggers = exports.currentLoggers = fiberRuntime.currentLoggers;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentLogLevel = exports.currentLogLevel = core.currentLogLevel;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentMinimumLogLevel = exports.currentMinimumLogLevel = fiberRuntime.currentMinimumLogLevel;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentLogSpan = exports.currentLogSpan = core.currentLogSpan;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentRuntimeFlags = exports.currentRuntimeFlags = fiberRuntime.currentRuntimeFlags;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentScheduler = exports.currentScheduler = Scheduler.currentScheduler;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentSupervisor = exports.currentSupervisor = fiberRuntime.currentSupervisor;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentMetricLabels = exports.currentMetricLabels = core.currentMetricLabels;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentTracerEnabled = exports.currentTracerEnabled = core.currentTracerEnabled;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentTracerTimingEnabled = exports.currentTracerTimingEnabled = core.currentTracerTimingEnabled;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentTracerSpanAnnotations = exports.currentTracerSpanAnnotations = core.currentTracerSpanAnnotations;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const currentTracerSpanLinks = exports.currentTracerSpanLinks = core.currentTracerSpanLinks;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category fiberRefs
|
||||
*/
|
||||
const interruptedCause = exports.interruptedCause = core.currentInterruptedCause;
|
||||
//# sourceMappingURL=FiberRef.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberRef.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberRef.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
91
node_modules/effect/dist/cjs/FiberRefs.js
generated
vendored
Normal file
91
node_modules/effect/dist/cjs/FiberRefs.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.updateManyAs = exports.updateAs = exports.unsafeMake = exports.setAll = exports.joinAs = exports.getOrDefault = exports.get = exports.forkAs = exports.fiberRefs = exports.empty = exports.delete = exports.FiberRefsSym = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/fiberRefs.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FiberRefsSym = exports.FiberRefsSym = internal.FiberRefsSym;
|
||||
const delete_ = exports.delete = internal.delete_;
|
||||
/**
|
||||
* Returns a set of each `FiberRef` in this collection.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const fiberRefs = exports.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
|
||||
*/
|
||||
const forkAs = exports.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
|
||||
*/
|
||||
const get = exports.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
|
||||
*/
|
||||
const getOrDefault = exports.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
|
||||
*/
|
||||
const joinAs = exports.joinAs = internal.joinAs;
|
||||
/**
|
||||
* Set each ref to either its value or its default.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const setAll = exports.setAll = internal.setAll;
|
||||
/**
|
||||
* Updates the value of the specified `FiberRef` using the provided `FiberId`
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const updateAs = exports.updateAs = internal.updateAs;
|
||||
/**
|
||||
* Updates the values of the specified `FiberRef` & value pairs using the provided `FiberId`
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const updateManyAs = exports.updateManyAs = internal.updateManyAs;
|
||||
/**
|
||||
* Note: it will not copy the provided Map, make sure to provide a fresh one.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category unsafe
|
||||
*/
|
||||
const unsafeMake = exports.unsafeMake = internal.unsafeMake;
|
||||
/**
|
||||
* The empty collection of `FiberRef` values.
|
||||
*
|
||||
* @category constructors
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const empty = exports.empty = internal.empty;
|
||||
//# sourceMappingURL=FiberRefs.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberRefs.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberRefs.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FiberRefs.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FiberRefsSym","exports","delete_","delete","fiberRefs","forkAs","getOrDefault","joinAs","setAll","updateAs","updateManyAs","unsafeMake","empty"],"sources":["../../src/FiberRefs.ts"],"sourcesContent":[null],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,uBAA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;;AAQO,MAAMC,MAAM,GAAAJ,OAAA,CAAAI,MAAA,GAmBf3B,QAAQ,CAAC2B,MAAM;AAEnB;;;;;;;AAOO,MAAMZ,GAAG,GAAAQ,OAAA,CAAAR,GAAA,GAiBZf,QAAQ,CAACe,GAAG;AAEhB;;;;;;;AAOO,MAAMa,YAAY,GAAAL,OAAA,CAAAK,YAAA,GAiBrB5B,QAAQ,CAAC4B,YAAY;AAEzB;;;;;;;;AAQO,MAAMC,MAAM,GAAAN,OAAA,CAAAM,MAAA,GAmBf7B,QAAQ,CAAC6B,MAAM;AAEnB;;;;;;AAMO,MAAMC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAA6C9B,QAAQ,CAAC8B,MAAM;AAE/E;;;;;;AAMO,MAAMC,QAAQ,GAAAR,OAAA,CAAAQ,QAAA,GA4BjB/B,QAAQ,CAAC+B,QAAQ;AAErB;;;;;;AAMO,MAAMC,YAAY,GAAAT,OAAA,CAAAS,YAAA,GAgDrBhC,QAAQ,CAACgC,YAAY;AAEzB;;;;;;AAMO,MAAMC,UAAU,GAAAV,OAAA,CAAAU,UAAA,GAENjC,QAAQ,CAACiC,UAAU;AAEpC;;;;;;AAMO,MAAMC,KAAK,GAAAX,OAAA,CAAAW,KAAA,GAAoBlC,QAAQ,CAACkC,KAAK","ignoreList":[]}
|
||||
39
node_modules/effect/dist/cjs/FiberRefsPatch.js
generated
vendored
Normal file
39
node_modules/effect/dist/cjs/FiberRefsPatch.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.patch = exports.empty = exports.diff = exports.combine = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/fiberRefs/patch.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const empty = exports.empty = internal.empty;
|
||||
/**
|
||||
* Constructs a patch that describes the changes between the specified
|
||||
* collections of `FiberRef`
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const diff = exports.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
|
||||
*/
|
||||
const combine = exports.combine = internal.combine;
|
||||
/**
|
||||
* Applies the changes described by this patch to the specified collection
|
||||
* of `FiberRef` values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const patch = exports.patch = internal.patch;
|
||||
//# sourceMappingURL=FiberRefsPatch.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberRefsPatch.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberRefsPatch.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FiberRefsPatch.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","empty","exports","diff","combine","patch"],"sources":["../../src/FiberRefsPatch.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAyD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD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KAAK","ignoreList":[]}
|
||||
308
node_modules/effect/dist/cjs/FiberSet.js
generated
vendored
Normal file
308
node_modules/effect/dist/cjs/FiberSet.js
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.unsafeAdd = exports.size = exports.runtimePromise = exports.runtime = exports.run = exports.makeRuntimePromise = exports.makeRuntime = exports.make = exports.join = exports.isFiberSet = exports.clear = exports.awaitEmpty = exports.add = exports.TypeId = void 0;
|
||||
var Cause = _interopRequireWildcard(require("./Cause.js"));
|
||||
var Deferred = _interopRequireWildcard(require("./Deferred.js"));
|
||||
var Effect = _interopRequireWildcard(require("./Effect.js"));
|
||||
var Exit = _interopRequireWildcard(require("./Exit.js"));
|
||||
var Fiber = _interopRequireWildcard(require("./Fiber.js"));
|
||||
var FiberId = _interopRequireWildcard(require("./FiberId.js"));
|
||||
var _Function = require("./Function.js");
|
||||
var HashSet = _interopRequireWildcard(require("./HashSet.js"));
|
||||
var Inspectable = _interopRequireWildcard(require("./Inspectable.js"));
|
||||
var Iterable = _interopRequireWildcard(require("./Iterable.js"));
|
||||
var _Pipeable = require("./Pipeable.js");
|
||||
var Predicate = _interopRequireWildcard(require("./Predicate.js"));
|
||||
var Runtime = _interopRequireWildcard(require("./Runtime.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories type ids
|
||||
*/
|
||||
const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("effect/FiberSet");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @categories refinements
|
||||
*/
|
||||
const isFiberSet = u => Predicate.hasProperty(u, TypeId);
|
||||
exports.isFiberSet = isFiberSet;
|
||||
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 (0, _Pipeable.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.make = make;
|
||||
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
|
||||
*/
|
||||
exports.makeRuntime = makeRuntime;
|
||||
const makeRuntimePromise = () => Effect.flatMap(make(), self => runtimePromise(self)());
|
||||
exports.makeRuntimePromise = makeRuntimePromise;
|
||||
const internalFiberIdId = -1;
|
||||
const internalFiberId = /*#__PURE__*/FiberId.make(internalFiberIdId, 0);
|
||||
const isInternalInterruption = /*#__PURE__*/Cause.reduceWithContext(undefined, {
|
||||
emptyCase: _Function.constFalse,
|
||||
failCase: _Function.constFalse,
|
||||
dieCase: _Function.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
|
||||
*/
|
||||
const unsafeAdd = exports.unsafeAdd = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
const add = exports.add = /*#__PURE__*/(0, _Function.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
|
||||
*/
|
||||
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)));
|
||||
});
|
||||
exports.clear = clear;
|
||||
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
|
||||
*/
|
||||
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]);
|
||||
};
|
||||
exports.run = run;
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.runtime = runtime;
|
||||
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
|
||||
*/
|
||||
exports.runtimePromise = runtimePromise;
|
||||
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));
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
exports.size = size;
|
||||
const join = self => Deferred.await(self.deferred);
|
||||
/**
|
||||
* Wait until the fiber set is empty.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @categories combinators
|
||||
*/
|
||||
exports.join = join;
|
||||
const awaitEmpty = self => Effect.whileLoop({
|
||||
while: () => self.state._tag === "Open" && self.state.backing.size > 0,
|
||||
body: () => Fiber.await(Iterable.unsafeHead(self)),
|
||||
step: _Function.constVoid
|
||||
});
|
||||
exports.awaitEmpty = awaitEmpty;
|
||||
//# sourceMappingURL=FiberSet.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberSet.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberSet.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/effect/dist/cjs/FiberStatus.js
generated
vendored
Normal file
59
node_modules/effect/dist/cjs/FiberStatus.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.suspended = exports.running = exports.isSuspended = exports.isRunning = exports.isFiberStatus = exports.isDone = exports.done = exports.FiberStatusTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/fiberStatus.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const FiberStatusTypeId = exports.FiberStatusTypeId = internal.FiberStatusTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const done = exports.done = internal.done;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const running = exports.running = internal.running;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const suspended = exports.suspended = internal.suspended;
|
||||
/**
|
||||
* Returns `true` if the specified value is a `FiberStatus`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isFiberStatus = exports.isFiberStatus = internal.isFiberStatus;
|
||||
/**
|
||||
* Returns `true` if the specified `FiberStatus` is `Done`, `false` otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isDone = exports.isDone = internal.isDone;
|
||||
/**
|
||||
* Returns `true` if the specified `FiberStatus` is `Running`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isRunning = exports.isRunning = internal.isRunning;
|
||||
/**
|
||||
* Returns `true` if the specified `FiberStatus` is `Suspended`, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isSuspended = exports.isSuspended = internal.isSuspended;
|
||||
//# sourceMappingURL=FiberStatus.js.map
|
||||
1
node_modules/effect/dist/cjs/FiberStatus.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/FiberStatus.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FiberStatus.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FiberStatusTypeId","exports","done","running","suspended","isFiberStatus","isDone","isRunning","isSuspended"],"sources":["../../src/FiberStatus.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAqD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAA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GAAAP,OAAA,CAAAO,WAAA,GAA6C9B,QAAQ,CAAC8B,WAAW","ignoreList":[]}
|
||||
488
node_modules/effect/dist/cjs/Function.js
generated
vendored
Normal file
488
node_modules/effect/dist/cjs/Function.js
generated
vendored
Normal file
@@ -0,0 +1,488 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.flip = exports.dual = exports.constant = exports.constVoid = exports.constUndefined = exports.constTrue = exports.constNull = exports.constFalse = exports.compose = exports.apply = exports.absurd = exports.SK = void 0;
|
||||
exports.flow = flow;
|
||||
exports.isFunction = exports.identity = exports.hole = void 0;
|
||||
exports.pipe = pipe;
|
||||
exports.untupled = exports.unsafeCoerce = exports.tupled = exports.satisfies = void 0;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.isFunction = isFunction;
|
||||
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
|
||||
*/
|
||||
exports.dual = dual;
|
||||
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
|
||||
*/
|
||||
exports.apply = apply;
|
||||
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
|
||||
*/
|
||||
exports.identity = identity;
|
||||
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
|
||||
*/
|
||||
exports.satisfies = satisfies;
|
||||
const unsafeCoerce = exports.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.constant = constant;
|
||||
const constTrue = exports.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
|
||||
*/
|
||||
const constFalse = exports.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
|
||||
*/
|
||||
const constNull = exports.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
|
||||
*/
|
||||
const constUndefined = exports.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
|
||||
*/
|
||||
const constVoid = exports.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.flip = flip;
|
||||
const compose = exports.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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
exports.absurd = absurd;
|
||||
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
|
||||
*/
|
||||
exports.tupled = tupled;
|
||||
const untupled = f => (...a) => f(a);
|
||||
exports.untupled = untupled;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
*/
|
||||
const hole = exports.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
|
||||
*/
|
||||
const SK = (_, b) => b;
|
||||
exports.SK = SK;
|
||||
//# sourceMappingURL=Function.js.map
|
||||
1
node_modules/effect/dist/cjs/Function.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Function.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
62
node_modules/effect/dist/cjs/GlobalValue.js
generated
vendored
Normal file
62
node_modules/effect/dist/cjs/GlobalValue.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.globalValue = void 0;
|
||||
var version = _interopRequireWildcard(require("./internal/version.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* 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/globalStoreId/${/*#__PURE__*/version.getCurrentVersion()}`;
|
||||
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
|
||||
*/
|
||||
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);
|
||||
};
|
||||
exports.globalValue = globalValue;
|
||||
//# sourceMappingURL=GlobalValue.js.map
|
||||
1
node_modules/effect/dist/cjs/GlobalValue.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/GlobalValue.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GlobalValue.js","names":["version","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","globalStoreId","getCurrentVersion","globalStore","globalValue","id","compute","globalThis","Map","exports"],"sources":["../../src/GlobalValue.ts"],"sourcesContent":[null],"mappings":";;;;;;AAcA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAdhD;;;;;;;;;;;;;;;AAgBA,MAAMkB,aAAa,GAAG,iDAAoCtB,OAAO,CAACuB,iBAAiB,EAAE,EAAE;AAEvF,IAAIC,WAA8B;AAElC;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAMC,WAAW,GAAGA,CAAIC,EAAW,EAAEC,OAAgB,KAAO;EACjE,IAAI,CAACH,WAAW,EAAE;IAChB;IACAI,UAAU,CAACN,aAAa,CAAC,KAAK,IAAIO,GAAG,EAAE;IACvC;IACAL,WAAW,GAAGI,UAAU,CAACN,aAAa,CAAsB;EAC9D;EACA,IAAI,CAACE,WAAW,CAACV,GAAG,CAACY,EAAE,CAAC,EAAE;IACxBF,WAAW,CAACR,GAAG,CAACU,EAAE,EAAEC,OAAO,EAAE,CAAC;EAChC;EACA,OAAOH,WAAW,CAACT,GAAG,CAACW,EAAE,CAAE;AAC7B,CAAC;AAAAI,OAAA,CAAAL,WAAA,GAAAA,WAAA","ignoreList":[]}
|
||||
47
node_modules/effect/dist/cjs/GroupBy.js
generated
vendored
Normal file
47
node_modules/effect/dist/cjs/GroupBy.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.make = exports.first = exports.filter = exports.evaluate = exports.GroupByTypeId = void 0;
|
||||
var internal = _interopRequireWildcard(require("./internal/groupBy.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const GroupByTypeId = exports.GroupByTypeId = internal.GroupByTypeId;
|
||||
/**
|
||||
* Run the function across all groups, collecting the results in an
|
||||
* arbitrary order.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category destructors
|
||||
*/
|
||||
const evaluate = exports.evaluate = internal.evaluate;
|
||||
/**
|
||||
* Filter the groups to be processed.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const filter = exports.filter = internal.filter;
|
||||
/**
|
||||
* Only consider the first `n` groups found in the `Stream`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category utils
|
||||
*/
|
||||
const first = exports.first = internal.first;
|
||||
/**
|
||||
* Constructs a `GroupBy` from a `Stream`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = internal.make;
|
||||
//# sourceMappingURL=GroupBy.js.map
|
||||
1
node_modules/effect/dist/cjs/GroupBy.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/GroupBy.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GroupBy.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GroupByTypeId","exports","evaluate","filter","first","make"],"sources":["../../src/GroupBy.ts"],"sourcesContent":[null],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6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AAG,KAAA,GAed1B,QAAQ,CAAC0B,KAAK;AAElB;;;;;;AAMO,MAAMC,IAAI,GAAAJ,OAAA,CAAAI,IAAA,GAEU3B,QAAQ,CAAC2B,IAAI","ignoreList":[]}
|
||||
6
node_modules/effect/dist/cjs/HKT.js
generated
vendored
Normal file
6
node_modules/effect/dist/cjs/HKT.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=HKT.js.map
|
||||
1
node_modules/effect/dist/cjs/HKT.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/HKT.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"HKT.js","names":[],"sources":["../../src/HKT.ts"],"sourcesContent":[null],"mappings":"","ignoreList":[]}
|
||||
181
node_modules/effect/dist/cjs/Hash.js
generated
vendored
Normal file
181
node_modules/effect/dist/cjs/Hash.js
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.symbol = exports.structureKeys = exports.structure = exports.string = exports.random = exports.optimize = exports.number = exports.isHash = exports.hash = exports.combine = exports.cached = exports.array = void 0;
|
||||
var _Function = require("./Function.js");
|
||||
var _GlobalValue = require("./GlobalValue.js");
|
||||
var _Predicate = require("./Predicate.js");
|
||||
var _Utils = require("./Utils.js");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
/** @internal */
|
||||
const randomHashCache = /*#__PURE__*/(0, _GlobalValue.globalValue)(/*#__PURE__*/Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap());
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category symbols
|
||||
*/
|
||||
const symbol = exports.symbol = /*#__PURE__*/Symbol.for("effect/Hash");
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
const hash = self => {
|
||||
if (_Utils.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
|
||||
*/
|
||||
exports.hash = hash;
|
||||
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
|
||||
*/
|
||||
exports.random = random;
|
||||
const combine = b => self => self * 53 ^ b;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
exports.combine = combine;
|
||||
const optimize = n => n & 0xbfffffff | n >>> 1 & 0x40000000;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category guards
|
||||
*/
|
||||
exports.optimize = optimize;
|
||||
const isHash = u => (0, _Predicate.hasProperty)(u, symbol);
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
exports.isHash = isHash;
|
||||
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
|
||||
*/
|
||||
exports.number = number;
|
||||
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
|
||||
*/
|
||||
exports.string = string;
|
||||
const structureKeys = (o, keys) => {
|
||||
let h = 12289;
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
h ^= (0, _Function.pipe)(string(keys[i]), combine(hash(o[keys[i]])));
|
||||
}
|
||||
return optimize(h);
|
||||
};
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
exports.structureKeys = structureKeys;
|
||||
const structure = o => structureKeys(o, Object.keys(o));
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
exports.structure = structure;
|
||||
const array = arr => {
|
||||
let h = 6151;
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
h = (0, _Function.pipe)(h, combine(hash(arr[i])));
|
||||
}
|
||||
return optimize(h);
|
||||
};
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category hashing
|
||||
*/
|
||||
exports.array = array;
|
||||
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;
|
||||
};
|
||||
exports.cached = cached;
|
||||
//# sourceMappingURL=Hash.js.map
|
||||
1
node_modules/effect/dist/cjs/Hash.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/Hash.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Hash.js","names":["_Function","require","_GlobalValue","_Predicate","_Utils","randomHashCache","globalValue","Symbol","for","WeakMap","symbol","exports","hash","self","structuralRegionState","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","hasProperty","Infinity","h","str","i","length","charCodeAt","structureKeys","o","keys","pipe","structure","Object","array","arr","cached","arguments","defineProperty","value","enumerable"],"sources":["../../src/Hash.ts"],"sourcesContent":[null],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AANA;;;;AAQA;AACA,MAAMI,eAAe,gBAAG,IAAAC,wBAAW,eACjCC,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC,EACzC,MAAM,IAAIC,OAAO,EAAkB,CACpC;AAED;;;;AAIO,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,gBAAkBH,MAAM,CAACC,GAAG,CAAC,aAAa,CAAC;AAU9D;;;;AAIO,MAAMI,IAAI,GAA+BC,IAAO,IAAI;EACzD,IAAIC,4BAAqB,CAACC,OAAO,KAAK,IAAI,EAAE;IAC1C,OAAO,CAAC;EACV;EAEA,QAAQ,OAAOF,IAAI;IACjB,KAAK,QAAQ;MACX,OAAOG,MAAM,CAACH,IAAI,CAAC;IACrB,KAAK,QAAQ;MACX,OAAOI,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,KAAK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EH,MAAM,EAAE;QAClC+C,KAAKA,CAAA;UACH,OAAO7C,IAAI;QACb,CAAC;QACD8C,UAAU,EAAE;OACb,CAAC;MACF,OAAO9C,IAAI;IACb,CAAQ;EACV;EACA,MAAMC,IAAI,GAAG0C,SAAS,CAAC,CAAC,CAAW;EACnC,MAAM3C,IAAI,GAAG2C,SAAS,CAAC,CAAC,CAAW;EACnCJ,MAAM,CAACK,cAAc,CAAC3C,IAAI,EAAEH,MAAM,EAAE;IAClC+C,KAAKA,CAAA;MACH,OAAO7C,IAAI;IACb,CAAC;IACD8C,UAAU,EAAE;GACb,CAAC;EAEF,OAAO9C,IAAI;AACb,CAAC;AAAAD,OAAA,CAAA2C,MAAA,GAAAA,MAAA","ignoreList":[]}
|
||||
305
node_modules/effect/dist/cjs/HashMap.js
generated
vendored
Normal file
305
node_modules/effect/dist/cjs/HashMap.js
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.values = exports.unsafeGet = exports.union = exports.toValues = exports.toEntries = exports.some = exports.size = exports.set = exports.removeMany = exports.remove = exports.reduce = exports.mutate = exports.modifyHash = exports.modifyAt = exports.modify = exports.map = exports.make = exports.keys = exports.keySet = exports.isHashMap = exports.isEmpty = exports.hasHash = exports.hasBy = exports.has = exports.getHash = exports.get = exports.fromIterable = exports.forEach = exports.flatMap = exports.findFirst = exports.filterMap = exports.filter = exports.every = exports.entries = exports.endMutation = exports.empty = exports.compact = exports.beginMutation = void 0;
|
||||
var HM = _interopRequireWildcard(require("./internal/hashMap.js"));
|
||||
var keySet_ = _interopRequireWildcard(require("./internal/hashMap/keySet.js"));
|
||||
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
const TypeId = HM.HashMapTypeId;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @category refinements
|
||||
*/
|
||||
const isHashMap = exports.isHashMap = HM.isHashMap;
|
||||
/**
|
||||
* Creates a new `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const empty = exports.empty = HM.empty;
|
||||
/**
|
||||
* Constructs a new `HashMap` from an array of key/value pairs.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const make = exports.make = HM.make;
|
||||
/**
|
||||
* Creates a new `HashMap` from an iterable collection of key/value pairs.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category constructors
|
||||
*/
|
||||
const fromIterable = exports.fromIterable = HM.fromIterable;
|
||||
/**
|
||||
* Checks if the `HashMap` contains any entries.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category elements
|
||||
*/
|
||||
const isEmpty = exports.isEmpty = HM.isEmpty;
|
||||
/**
|
||||
* Safely lookup the value for the specified key in the `HashMap` using the
|
||||
* internal hashing function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category elements
|
||||
*/
|
||||
const get = exports.get = HM.get;
|
||||
/**
|
||||
* Lookup the value for the specified key in the `HashMap` using a custom hash.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category elements
|
||||
*/
|
||||
const getHash = exports.getHash = HM.getHash;
|
||||
/**
|
||||
* Unsafely lookup the value for the specified key in the `HashMap` using the
|
||||
* internal hashing function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category unsafe
|
||||
*/
|
||||
const unsafeGet = exports.unsafeGet = HM.unsafeGet;
|
||||
/**
|
||||
* Checks if the specified key has an entry in the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category elements
|
||||
*/
|
||||
const has = exports.has = HM.has;
|
||||
/**
|
||||
* Checks if the specified key has an entry in the `HashMap` using a custom
|
||||
* hash.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category elements
|
||||
*/
|
||||
const hasHash = exports.hasHash = HM.hasHash;
|
||||
/**
|
||||
* Checks if an element matching the given predicate exists in the given `HashMap`.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import { HashMap } from "effect"
|
||||
*
|
||||
* const hm = HashMap.make([1, 'a'])
|
||||
* HashMap.hasBy(hm, (value, key) => value === 'a' && key === 1); // -> true
|
||||
* HashMap.hasBy(hm, (value) => value === 'b'); // -> false
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @since 3.16.0
|
||||
* @category elements
|
||||
*/
|
||||
const hasBy = exports.hasBy = HM.hasBy;
|
||||
/**
|
||||
* Sets the specified key to the specified value using the internal hashing
|
||||
* function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const set = exports.set = HM.set;
|
||||
/**
|
||||
* Returns an `IterableIterator` of the keys within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const keys = exports.keys = HM.keys;
|
||||
/**
|
||||
* Returns a `HashSet` of keys within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getter
|
||||
*/
|
||||
const keySet = exports.keySet = keySet_.keySet;
|
||||
/**
|
||||
* Returns an `IterableIterator` of the values within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const values = exports.values = HM.values;
|
||||
/**
|
||||
* Returns an `Array` of the values within the `HashMap`.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @category getters
|
||||
*/
|
||||
const toValues = self => Array.from(values(self));
|
||||
/**
|
||||
* Returns an `IterableIterator` of the entries within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.toValues = toValues;
|
||||
const entries = exports.entries = HM.entries;
|
||||
/**
|
||||
* Returns an `Array<[K, V]>` of the entries within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
const toEntries = self => Array.from(entries(self));
|
||||
/**
|
||||
* Returns the number of entries within the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category getters
|
||||
*/
|
||||
exports.toEntries = toEntries;
|
||||
const size = exports.size = HM.size;
|
||||
/**
|
||||
* Marks the `HashMap` as mutable.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const beginMutation = exports.beginMutation = HM.beginMutation;
|
||||
/**
|
||||
* Marks the `HashMap` as immutable.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const endMutation = exports.endMutation = HM.endMutation;
|
||||
/**
|
||||
* Mutates the `HashMap` within the context of the provided function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const mutate = exports.mutate = HM.mutate;
|
||||
/**
|
||||
* Set or remove the specified key in the `HashMap` using the specified
|
||||
* update function. The value of the specified key will be computed using the
|
||||
* provided hash.
|
||||
*
|
||||
* The update function will be invoked with the current value of the key if it
|
||||
* exists, or `None` if no such value exists.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const modifyAt = exports.modifyAt = HM.modifyAt;
|
||||
/**
|
||||
* Alter the value of the specified key in the `HashMap` using the specified
|
||||
* update function. The value of the specified key will be computed using the
|
||||
* provided hash.
|
||||
*
|
||||
* The update function will be invoked with the current value of the key if it
|
||||
* exists, or `None` if no such value exists.
|
||||
*
|
||||
* This function will always either update or insert a value into the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const modifyHash = exports.modifyHash = HM.modifyHash;
|
||||
/**
|
||||
* Updates the value of the specified key within the `HashMap` if it exists.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const modify = exports.modify = HM.modify;
|
||||
/**
|
||||
* Performs a union of this `HashMap` and that `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const union = exports.union = HM.union;
|
||||
/**
|
||||
* Remove the entry for the specified key in the `HashMap` using the internal
|
||||
* hashing function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const remove = exports.remove = HM.remove;
|
||||
/**
|
||||
* Removes all entries in the `HashMap` which have the specified keys.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const removeMany = exports.removeMany = HM.removeMany;
|
||||
/**
|
||||
* Maps over the entries of the `HashMap` using the specified function.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category mapping
|
||||
*/
|
||||
const map = exports.map = HM.map;
|
||||
/**
|
||||
* Chains over the entries of the `HashMap` using the specified function.
|
||||
*
|
||||
* **NOTE**: the hash and equal of both maps have to be the same.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category sequencing
|
||||
*/
|
||||
const flatMap = exports.flatMap = HM.flatMap;
|
||||
/**
|
||||
* Applies the specified function to the entries of the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category traversing
|
||||
*/
|
||||
const forEach = exports.forEach = HM.forEach;
|
||||
/**
|
||||
* Reduces the specified state over the entries of the `HashMap`.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category folding
|
||||
*/
|
||||
const reduce = exports.reduce = HM.reduce;
|
||||
/**
|
||||
* Filters entries out of a `HashMap` using the specified predicate.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category filtering
|
||||
*/
|
||||
const filter = exports.filter = HM.filter;
|
||||
/**
|
||||
* Filters out `None` values from a `HashMap` of `Options`s.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category filtering
|
||||
*/
|
||||
const compact = exports.compact = HM.compact;
|
||||
/**
|
||||
* Maps over the entries of the `HashMap` using the specified partial function
|
||||
* and filters out `None` values.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @category filtering
|
||||
*/
|
||||
const filterMap = exports.filterMap = HM.filterMap;
|
||||
/**
|
||||
* Returns the first element that satisfies the specified
|
||||
* predicate, or `None` if no such element exists.
|
||||
*
|
||||
* @category elements
|
||||
* @since 2.0.0
|
||||
*/
|
||||
const findFirst = exports.findFirst = HM.findFirst;
|
||||
/**
|
||||
* Checks if any entry in a hashmap meets a specific condition.
|
||||
*
|
||||
* @since 3.13.0
|
||||
* @category elements
|
||||
*/
|
||||
const some = exports.some = HM.some;
|
||||
/**
|
||||
* Checks if all entries in a hashmap meets a specific condition.
|
||||
*
|
||||
* @param self - The hashmap to check.
|
||||
* @param predicate - The condition to test entries (value, key).
|
||||
*
|
||||
* @since 3.14.0
|
||||
* @category elements
|
||||
*/
|
||||
const every = exports.every = HM.every;
|
||||
//# sourceMappingURL=HashMap.js.map
|
||||
1
node_modules/effect/dist/cjs/HashMap.js.map
generated
vendored
Normal file
1
node_modules/effect/dist/cjs/HashMap.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"HashMap.js","names":["HM","_interopRequireWildcard","require","keySet_","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TypeId","HashMapTypeId","isHashMap","exports","empty","make","fromIterable","isEmpty","getHash","unsafeGet","hasHash","hasBy","keys","keySet","values","toValues","self","Array","from","entries","toEntries","size","beginMutation","endMutation","mutate","modifyAt","modifyHash","modify","union","remove","removeMany","map","flatMap","forEach","reduce","filter","compact","filterMap","findFirst","some","every"],"sources":["../../src/HashMap.ts"],"sourcesContent":[null],"mappings":";;;;;;AAOA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,uBAAA,CAAAC,OAAA;AAAuD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OA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,OAAO,GAAA7B,OAAA,CAAA6B,OAAA,GAmBhBvD,EAAE,CAACuD,OAAO;AAEd;;;;;;AAMO,MAAMC,OAAO,GAAA9B,OAAA,CAAA8B,OAAA,GAehBxD,EAAE,CAACwD,OAAO;AAEd;;;;;;AAMO,MAAMC,MAAM,GAAA/B,OAAA,CAAA+B,MAAA,GAefzD,EAAE,CAACyD,MAAM;AAEb;;;;;;AAMO,MAAMC,MAAM,GAAAhC,OAAA,CAAAgC,MAAA,GA6Bf1D,EAAE,CAAC0D,MAAM;AAEb;;;;;;AAMO,MAAMC,OAAO,GAAAjC,OAAA,CAAAiC,OAAA,GAAyD3D,EAAE,CAAC2D,OAAO;AAEvF;;;;;;;AAOO,MAAMC,SAAS,GAAAlC,OAAA,CAAAkC,SAAA,GAiBlB5D,EAAE,CAAC4D,SAAS;AAEhB;;;;;;;AAOO,MAAMC,SAAS,GAAAnC,OAAA,CAAAmC,SAAA,GAiClB7D,EAAE,CAAC6D,SAAS;AAEhB;;;;;;AAMO,MAAMC,IAAI,GAAApC,OAAA,CAAAoC,IAAA,GAeb9D,EAAE,CAAC8D,IAAI;AAEX;;;;;;;;;AASO,MAAMC,KAAK,GAAArC,OAAA,CAAAqC,KAAA,GAqBd/D,EAAE,CAAC+D,KAAK","ignoreList":[]}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user