Aktueller Stand
This commit is contained in:
112
backend/node_modules/effect/dist/cjs/internal/schema/errors.js
generated
vendored
Normal file
112
backend/node_modules/effect/dist/cjs/internal/schema/errors.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getSchemaUnsupportedLiteralSpanErrorMessage = exports.getSchemaExtendErrorMessage = exports.getPrettyNoMatchingSchemaErrorMessage = exports.getPrettyNeverErrorMessage = exports.getPrettyMissingAnnotationErrorMessage = exports.getJSONSchemaUnsupportedPostRestElementsErrorMessage = exports.getJSONSchemaUnsupportedKeyErrorMessage = exports.getJSONSchemaMissingIdentifierAnnotationErrorMessage = exports.getJSONSchemaMissingAnnotationErrorMessage = exports.getInvalidArgumentErrorMessage = exports.getEquivalenceUnsupportedErrorMessage = exports.getArbitraryUnsupportedErrorMessage = exports.getArbitraryMissingAnnotationErrorMessage = exports.getArbitraryEmptyEnumErrorMessage = exports.getASTUnsupportedSchemaErrorMessage = exports.getASTUnsupportedRenameSchemaErrorMessage = exports.getASTUnsupportedLiteralErrorMessage = exports.getASTUnsupportedKeySchemaErrorMessage = exports.getASTRequiredElementFollowinAnOptionalElementErrorMessage = exports.getASTIndexSignatureParameterErrorMessage = exports.getASTDuplicatePropertySignatureTransformationErrorMessage = exports.getASTDuplicatePropertySignatureErrorMessage = exports.getASTDuplicateIndexSignatureErrorMessage = void 0;
|
||||
var array_ = _interopRequireWildcard(require("../../Array.js"));
|
||||
var util_ = _interopRequireWildcard(require("./util.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 getErrorMessage = (reason, details, path, ast) => {
|
||||
let out = reason;
|
||||
if (path && array_.isNonEmptyReadonlyArray(path)) {
|
||||
out += `\nat path: ${util_.formatPath(path)}`;
|
||||
}
|
||||
if (details !== undefined) {
|
||||
out += `\ndetails: ${details}`;
|
||||
}
|
||||
if (ast) {
|
||||
out += `\nschema (${ast._tag}): ${ast}`;
|
||||
}
|
||||
return out;
|
||||
};
|
||||
// ---------------------------------------------
|
||||
// generic
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
const getInvalidArgumentErrorMessage = details => getErrorMessage("Invalid Argument", details);
|
||||
exports.getInvalidArgumentErrorMessage = getInvalidArgumentErrorMessage;
|
||||
const getUnsupportedSchemaErrorMessage = (details, path, ast) => getErrorMessage("Unsupported schema", details, path, ast);
|
||||
const getMissingAnnotationErrorMessage = (details, path, ast) => getErrorMessage("Missing annotation", details, path, ast);
|
||||
// ---------------------------------------------
|
||||
// Arbitrary
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
const getArbitraryUnsupportedErrorMessage = (path, ast) => getUnsupportedSchemaErrorMessage("Cannot build an Arbitrary for this schema", path, ast);
|
||||
/** @internal */
|
||||
exports.getArbitraryUnsupportedErrorMessage = getArbitraryUnsupportedErrorMessage;
|
||||
const getArbitraryMissingAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating an Arbitrary for this schema requires an "arbitrary" annotation`, path, ast);
|
||||
/** @internal */
|
||||
exports.getArbitraryMissingAnnotationErrorMessage = getArbitraryMissingAnnotationErrorMessage;
|
||||
const getArbitraryEmptyEnumErrorMessage = path => getErrorMessage("Empty Enums schema", "Generating an Arbitrary for this schema requires at least one enum", path);
|
||||
// ---------------------------------------------
|
||||
// Equivalence
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
exports.getArbitraryEmptyEnumErrorMessage = getArbitraryEmptyEnumErrorMessage;
|
||||
const getEquivalenceUnsupportedErrorMessage = (ast, path) => getUnsupportedSchemaErrorMessage("Cannot build an Equivalence", path, ast);
|
||||
// ---------------------------------------------
|
||||
// JSON Schema
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
exports.getEquivalenceUnsupportedErrorMessage = getEquivalenceUnsupportedErrorMessage;
|
||||
const getJSONSchemaMissingAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating a JSON Schema for this schema requires a "jsonSchema" annotation`, path, ast);
|
||||
/** @internal */
|
||||
exports.getJSONSchemaMissingAnnotationErrorMessage = getJSONSchemaMissingAnnotationErrorMessage;
|
||||
const getJSONSchemaMissingIdentifierAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating a JSON Schema for this schema requires an "identifier" annotation`, path, ast);
|
||||
/** @internal */
|
||||
exports.getJSONSchemaMissingIdentifierAnnotationErrorMessage = getJSONSchemaMissingIdentifierAnnotationErrorMessage;
|
||||
const getJSONSchemaUnsupportedPostRestElementsErrorMessage = path => getErrorMessage("Generating a JSON Schema for post-rest elements is not currently supported. You're welcome to contribute by submitting a Pull Request", undefined, path);
|
||||
/** @internal */
|
||||
exports.getJSONSchemaUnsupportedPostRestElementsErrorMessage = getJSONSchemaUnsupportedPostRestElementsErrorMessage;
|
||||
const getJSONSchemaUnsupportedKeyErrorMessage = (key, path) => getErrorMessage("Unsupported key", `Cannot encode ${util_.formatPropertyKey(key)} key to JSON Schema`, path);
|
||||
// ---------------------------------------------
|
||||
// Pretty
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
exports.getJSONSchemaUnsupportedKeyErrorMessage = getJSONSchemaUnsupportedKeyErrorMessage;
|
||||
const getPrettyMissingAnnotationErrorMessage = (path, ast) => getMissingAnnotationErrorMessage(`Generating a Pretty for this schema requires a "pretty" annotation`, path, ast);
|
||||
/** @internal */
|
||||
exports.getPrettyMissingAnnotationErrorMessage = getPrettyMissingAnnotationErrorMessage;
|
||||
const getPrettyNeverErrorMessage = exports.getPrettyNeverErrorMessage = "Cannot pretty print a `never` value";
|
||||
/** @internal */
|
||||
const getPrettyNoMatchingSchemaErrorMessage = (actual, path, ast) => getErrorMessage("Unexpected Error", `Cannot find a matching schema for ${util_.formatUnknown(actual)}`, path, ast);
|
||||
// ---------------------------------------------
|
||||
// Schema
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
exports.getPrettyNoMatchingSchemaErrorMessage = getPrettyNoMatchingSchemaErrorMessage;
|
||||
const getSchemaExtendErrorMessage = (x, y, path) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path);
|
||||
/** @internal */
|
||||
exports.getSchemaExtendErrorMessage = getSchemaExtendErrorMessage;
|
||||
const getSchemaUnsupportedLiteralSpanErrorMessage = ast => getErrorMessage("Unsupported template literal span", undefined, undefined, ast);
|
||||
// ---------------------------------------------
|
||||
// AST
|
||||
// ---------------------------------------------
|
||||
/** @internal */
|
||||
exports.getSchemaUnsupportedLiteralSpanErrorMessage = getSchemaUnsupportedLiteralSpanErrorMessage;
|
||||
const getASTUnsupportedSchemaErrorMessage = ast => getUnsupportedSchemaErrorMessage(undefined, undefined, ast);
|
||||
/** @internal */
|
||||
exports.getASTUnsupportedSchemaErrorMessage = getASTUnsupportedSchemaErrorMessage;
|
||||
const getASTUnsupportedKeySchemaErrorMessage = ast => getErrorMessage("Unsupported key schema", undefined, undefined, ast);
|
||||
/** @internal */
|
||||
exports.getASTUnsupportedKeySchemaErrorMessage = getASTUnsupportedKeySchemaErrorMessage;
|
||||
const getASTUnsupportedLiteralErrorMessage = literal => getErrorMessage("Unsupported literal", `literal value: ${util_.formatUnknown(literal)}`);
|
||||
/** @internal */
|
||||
exports.getASTUnsupportedLiteralErrorMessage = getASTUnsupportedLiteralErrorMessage;
|
||||
const getASTDuplicateIndexSignatureErrorMessage = type => getErrorMessage("Duplicate index signature", `${type} index signature`);
|
||||
/** @internal */
|
||||
exports.getASTDuplicateIndexSignatureErrorMessage = getASTDuplicateIndexSignatureErrorMessage;
|
||||
const getASTIndexSignatureParameterErrorMessage = exports.getASTIndexSignatureParameterErrorMessage = /*#__PURE__*/getErrorMessage("Unsupported index signature parameter", "An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types");
|
||||
/** @internal */
|
||||
const getASTRequiredElementFollowinAnOptionalElementErrorMessage = exports.getASTRequiredElementFollowinAnOptionalElementErrorMessage = /*#__PURE__*/getErrorMessage("Invalid element", "A required element cannot follow an optional element. ts(1257)");
|
||||
/** @internal */
|
||||
const getASTDuplicatePropertySignatureTransformationErrorMessage = key => getErrorMessage("Duplicate property signature transformation", `Duplicate key ${util_.formatUnknown(key)}`);
|
||||
/** @internal */
|
||||
exports.getASTDuplicatePropertySignatureTransformationErrorMessage = getASTDuplicatePropertySignatureTransformationErrorMessage;
|
||||
const getASTUnsupportedRenameSchemaErrorMessage = ast => getUnsupportedSchemaErrorMessage(undefined, undefined, ast);
|
||||
/** @internal */
|
||||
exports.getASTUnsupportedRenameSchemaErrorMessage = getASTUnsupportedRenameSchemaErrorMessage;
|
||||
const getASTDuplicatePropertySignatureErrorMessage = key => getErrorMessage("Duplicate property signature", `Duplicate key ${util_.formatUnknown(key)}`);
|
||||
exports.getASTDuplicatePropertySignatureErrorMessage = getASTDuplicatePropertySignatureErrorMessage;
|
||||
//# sourceMappingURL=errors.js.map
|
||||
1
backend/node_modules/effect/dist/cjs/internal/schema/errors.js.map
generated
vendored
Normal file
1
backend/node_modules/effect/dist/cjs/internal/schema/errors.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
49
backend/node_modules/effect/dist/cjs/internal/schema/schemaId.js
generated
vendored
Normal file
49
backend/node_modules/effect/dist/cjs/internal/schema/schemaId.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NonNaNSchemaId = exports.MinLengthSchemaId = exports.MinItemsSchemaId = exports.MaxLengthSchemaId = exports.MaxItemsSchemaId = exports.LessThanSchemaId = exports.LessThanOrEqualToSchemaId = exports.LessThanOrEqualToBigIntSchemaId = exports.LessThanBigIntSchemaId = exports.LengthSchemaId = exports.JsonNumberSchemaId = exports.ItemsCountSchemaId = exports.IntSchemaId = exports.GreaterThanSchemaId = exports.GreaterThanOrEqualToSchemaId = exports.GreaterThanOrEqualToBigIntSchemaId = exports.GreaterThanBigintSchemaId = exports.FiniteSchemaId = exports.DateFromSelfSchemaId = exports.BetweenSchemaId = exports.BetweenBigintSchemaId = void 0;
|
||||
/** @internal */
|
||||
const DateFromSelfSchemaId = exports.DateFromSelfSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/DateFromSelf");
|
||||
/** @internal */
|
||||
const GreaterThanSchemaId = exports.GreaterThanSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/GreaterThan");
|
||||
/** @internal */
|
||||
const GreaterThanOrEqualToSchemaId = exports.GreaterThanOrEqualToSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/GreaterThanOrEqualTo");
|
||||
/** @internal */
|
||||
const LessThanSchemaId = exports.LessThanSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/LessThan");
|
||||
/** @internal */
|
||||
const LessThanOrEqualToSchemaId = exports.LessThanOrEqualToSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/LessThanOrEqualTo");
|
||||
/** @internal */
|
||||
const IntSchemaId = exports.IntSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Int");
|
||||
/** @internal */
|
||||
const NonNaNSchemaId = exports.NonNaNSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/NonNaN");
|
||||
/** @internal */
|
||||
const FiniteSchemaId = exports.FiniteSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Finite");
|
||||
/** @internal */
|
||||
const JsonNumberSchemaId = exports.JsonNumberSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/JsonNumber");
|
||||
/** @internal */
|
||||
const BetweenSchemaId = exports.BetweenSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Between");
|
||||
/** @internal */
|
||||
const GreaterThanBigintSchemaId = exports.GreaterThanBigintSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/GreaterThanBigint");
|
||||
/** @internal */
|
||||
const GreaterThanOrEqualToBigIntSchemaId = exports.GreaterThanOrEqualToBigIntSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/GreaterThanOrEqualToBigint");
|
||||
/** @internal */
|
||||
const LessThanBigIntSchemaId = exports.LessThanBigIntSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/LessThanBigint");
|
||||
/** @internal */
|
||||
const LessThanOrEqualToBigIntSchemaId = exports.LessThanOrEqualToBigIntSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/LessThanOrEqualToBigint");
|
||||
/** @internal */
|
||||
const BetweenBigintSchemaId = exports.BetweenBigintSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/BetweenBigint");
|
||||
/** @internal */
|
||||
const MinLengthSchemaId = exports.MinLengthSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/MinLength");
|
||||
/** @internal */
|
||||
const MaxLengthSchemaId = exports.MaxLengthSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/MaxLength");
|
||||
/** @internal */
|
||||
const LengthSchemaId = exports.LengthSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/Length");
|
||||
/** @internal */
|
||||
const MinItemsSchemaId = exports.MinItemsSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/MinItems");
|
||||
/** @internal */
|
||||
const MaxItemsSchemaId = exports.MaxItemsSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/MaxItems");
|
||||
/** @internal */
|
||||
const ItemsCountSchemaId = exports.ItemsCountSchemaId = /*#__PURE__*/Symbol.for("effect/SchemaId/ItemsCount");
|
||||
//# sourceMappingURL=schemaId.js.map
|
||||
1
backend/node_modules/effect/dist/cjs/internal/schema/schemaId.js.map
generated
vendored
Normal file
1
backend/node_modules/effect/dist/cjs/internal/schema/schemaId.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"schemaId.js","names":["DateFromSelfSchemaId","exports","Symbol","for","GreaterThanSchemaId","GreaterThanOrEqualToSchemaId","LessThanSchemaId","LessThanOrEqualToSchemaId","IntSchemaId","NonNaNSchemaId","FiniteSchemaId","JsonNumberSchemaId","BetweenSchemaId","GreaterThanBigintSchemaId","GreaterThanOrEqualToBigIntSchemaId","LessThanBigIntSchemaId","LessThanOrEqualToBigIntSchemaId","BetweenBigintSchemaId","MinLengthSchemaId","MaxLengthSchemaId","LengthSchemaId","MinItemsSchemaId","MaxItemsSchemaId","ItemsCountSchemaId"],"sources":["../../../../src/internal/schema/schemaId.ts"],"sourcesContent":[null],"mappings":";;;;;;AAEA;AACO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,gBAAgCE,MAAM,CAACC,GAAG,CACzE,8BAA8B,CACA;AAEhC;AACO,MAAMC,mBAAmB,GAAAH,OAAA,CAAAG,mBAAA,gBAA+BF,MAAM,CAACC,GAAG,CACvE,6BAA6B,CACA;AAE/B;AACO,MAAME,4BAA4B,GAAAJ,OAAA,CAAAI,4BAAA,gBAAwCH,MAAM,CAACC,GAAG,CACzF,sCAAsC,CACA;AAExC;AACO,MAAMG,gBAAgB,GAAAL,OAAA,CAAAK,gBAAA,gBAA4BJ,MAAM,CAACC,GAAG,CACjE,0BAA0B,CACA;AAE5B;AACO,MAAMI,yBAAyB,GAAAN,OAAA,CAAAM,yBAAA,gBAAqCL,MAAM,CAACC,GAAG,CACnF,mCAAmC,CACA;AAErC;AACO,MAAMK,WAAW,GAAAP,OAAA,CAAAO,WAAA,gBAAuBN,MAAM,CAACC,GAAG,CACvD,qBAAqB,CACA;AAEvB;AACO,MAAMM,cAAc,GAAAR,OAAA,CAAAQ,cAAA,gBAA0BP,MAAM,CAACC,GAAG,CAC7D,wBAAwB,CACA;AAE1B;AACO,MAAMO,cAAc,GAAAT,OAAA,CAAAS,cAAA,gBAA0BR,MAAM,CAACC,GAAG,CAC7D,wBAAwB,CACA;AAE1B;AACO,MAAMQ,kBAAkB,GAAAV,OAAA,CAAAU,kBAAA,gBAA8BT,MAAM,CAACC,GAAG,CACrE,4BAA4B,CACA;AAE9B;AACO,MAAMS,eAAe,GAAAX,OAAA,CAAAW,eAAA,gBAA2BV,MAAM,CAACC,GAAG,CAC/D,yBAAyB,CACA;AAE3B;AACO,MAAMU,yBAAyB,GAAAZ,OAAA,CAAAY,yBAAA,gBAAqCX,MAAM,CAACC,GAAG,CACnF,mCAAmC,CACA;AAErC;AACO,MAAMW,kCAAkC,GAAAb,OAAA,CAAAa,kCAAA,gBAA8CZ,MAAM,CAACC,GAAG,CACrG,4CAA4C,CACA;AAE9C;AACO,MAAMY,sBAAsB,GAAAd,OAAA,CAAAc,sBAAA,gBAAkCb,MAAM,CAACC,GAAG,CAC7E,gCAAgC,CACA;AAElC;AACO,MAAMa,+BAA+B,GAAAf,OAAA,CAAAe,+BAAA,gBAA2Cd,MAAM,CAACC,GAAG,CAC/F,yCAAyC,CACA;AAE3C;AACO,MAAMc,qBAAqB,GAAAhB,OAAA,CAAAgB,qBAAA,gBAAiCf,MAAM,CAACC,GAAG,CAC3E,+BAA+B,CACA;AAEjC;AACO,MAAMe,iBAAiB,GAAAjB,OAAA,CAAAiB,iBAAA,gBAA6BhB,MAAM,CAACC,GAAG,CACnE,2BAA2B,CACA;AAE7B;AACO,MAAMgB,iBAAiB,GAAAlB,OAAA,CAAAkB,iBAAA,gBAA6BjB,MAAM,CAACC,GAAG,CACnE,2BAA2B,CACA;AAE7B;AACO,MAAMiB,cAAc,GAAAnB,OAAA,CAAAmB,cAAA,gBAA0BlB,MAAM,CAACC,GAAG,CAC7D,wBAAwB,CACA;AAE1B;AACO,MAAMkB,gBAAgB,GAAApB,OAAA,CAAAoB,gBAAA,gBAA4BnB,MAAM,CAACC,GAAG,CACjE,0BAA0B,CACA;AAE5B;AACO,MAAMmB,gBAAgB,GAAArB,OAAA,CAAAqB,gBAAA,gBAA4BpB,MAAM,CAACC,GAAG,CACjE,0BAA0B,CACA;AAE5B;AACO,MAAMoB,kBAAkB,GAAAtB,OAAA,CAAAsB,kBAAA,gBAA8BrB,MAAM,CAACC,GAAG,CACrE,4BAA4B,CACA","ignoreList":[]}
|
||||
122
backend/node_modules/effect/dist/cjs/internal/schema/util.js
generated
vendored
Normal file
122
backend/node_modules/effect/dist/cjs/internal/schema/util.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.formatPathKey = exports.formatPath = exports.formatDate = void 0;
|
||||
exports.formatPropertyKey = formatPropertyKey;
|
||||
exports.formatUnknown = formatUnknown;
|
||||
exports.memoizeThunk = exports.isSingle = exports.isNonEmpty = exports.getKeysForIndexSignature = void 0;
|
||||
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); }
|
||||
/** @internal */
|
||||
const getKeysForIndexSignature = (input, parameter) => {
|
||||
switch (parameter._tag) {
|
||||
case "StringKeyword":
|
||||
case "TemplateLiteral":
|
||||
return Object.keys(input);
|
||||
case "SymbolKeyword":
|
||||
return Object.getOwnPropertySymbols(input);
|
||||
case "Refinement":
|
||||
return getKeysForIndexSignature(input, parameter.from);
|
||||
}
|
||||
};
|
||||
/** @internal */
|
||||
exports.getKeysForIndexSignature = getKeysForIndexSignature;
|
||||
const memoizeThunk = f => {
|
||||
let done = false;
|
||||
let a;
|
||||
return () => {
|
||||
if (done) {
|
||||
return a;
|
||||
}
|
||||
a = f();
|
||||
done = true;
|
||||
return a;
|
||||
};
|
||||
};
|
||||
/** @internal */
|
||||
exports.memoizeThunk = memoizeThunk;
|
||||
const formatDate = date => {
|
||||
try {
|
||||
return date.toISOString();
|
||||
} catch {
|
||||
return String(date);
|
||||
}
|
||||
};
|
||||
exports.formatDate = formatDate;
|
||||
const CIRCULAR = "[Circular]";
|
||||
/** @internal */
|
||||
function formatUnknown(input, whitespace = 0) {
|
||||
const seen = new WeakSet();
|
||||
const gap = !whitespace ? "" : typeof whitespace === "number" ? " ".repeat(whitespace) : whitespace;
|
||||
const ind = d => gap.repeat(d);
|
||||
const safeToString = x => {
|
||||
try {
|
||||
const s = x.toString();
|
||||
return typeof s === "string" ? s : String(s);
|
||||
} catch {
|
||||
return "[toString threw]";
|
||||
}
|
||||
};
|
||||
const wrap = (v, body) => {
|
||||
const ctor = v?.constructor;
|
||||
return ctor && ctor !== Object.prototype.constructor && ctor.name ? `${ctor.name}(${body})` : body;
|
||||
};
|
||||
const ownKeys = o => {
|
||||
try {
|
||||
return Reflect.ownKeys(o);
|
||||
} catch {
|
||||
return ["[ownKeys threw]"];
|
||||
}
|
||||
};
|
||||
function go(v, d = 0) {
|
||||
if (Array.isArray(v)) {
|
||||
if (seen.has(v)) return CIRCULAR;
|
||||
seen.add(v);
|
||||
if (!gap || v.length <= 1) return `[${v.map(x => go(x, d)).join(",")}]`;
|
||||
const inner = v.map(x => go(x, d + 1)).join(",\n" + ind(d + 1));
|
||||
return `[\n${ind(d + 1)}${inner}\n${ind(d)}]`;
|
||||
}
|
||||
if (Predicate.isDate(v)) return formatDate(v);
|
||||
if (Predicate.hasProperty(v, "toString") && Predicate.isFunction(v["toString"]) && v["toString"] !== Object.prototype.toString) return safeToString(v);
|
||||
if (Predicate.isString(v)) return JSON.stringify(v);
|
||||
if (Predicate.isNumber(v) || v == null || Predicate.isBoolean(v) || Predicate.isSymbol(v)) return String(v);
|
||||
if (Predicate.isBigInt(v)) return String(v) + "n";
|
||||
if (v instanceof Set || v instanceof Map) {
|
||||
if (seen.has(v)) return CIRCULAR;
|
||||
seen.add(v);
|
||||
return `${v.constructor.name}(${go(Array.from(v), d)})`;
|
||||
}
|
||||
if (Predicate.isObject(v)) {
|
||||
if (seen.has(v)) return CIRCULAR;
|
||||
seen.add(v);
|
||||
const keys = ownKeys(v);
|
||||
if (!gap || keys.length <= 1) {
|
||||
const body = `{${keys.map(k => `${formatPropertyKey(k)}:${go(v[k], d)}`).join(",")}}`;
|
||||
return wrap(v, body);
|
||||
}
|
||||
const body = `{\n${keys.map(k => `${ind(d + 1)}${formatPropertyKey(k)}: ${go(v[k], d + 1)}`).join(",\n")}\n${ind(d)}}`;
|
||||
return wrap(v, body);
|
||||
}
|
||||
return String(v);
|
||||
}
|
||||
return go(input, 0);
|
||||
}
|
||||
/** @internal */
|
||||
function formatPropertyKey(name) {
|
||||
return Predicate.isString(name) ? JSON.stringify(name) : String(name);
|
||||
}
|
||||
/** @internal */
|
||||
const isNonEmpty = x => Array.isArray(x);
|
||||
/** @internal */
|
||||
exports.isNonEmpty = isNonEmpty;
|
||||
const isSingle = x => !Array.isArray(x);
|
||||
/** @internal */
|
||||
exports.isSingle = isSingle;
|
||||
const formatPathKey = key => `[${formatPropertyKey(key)}]`;
|
||||
/** @internal */
|
||||
exports.formatPathKey = formatPathKey;
|
||||
const formatPath = path => isNonEmpty(path) ? path.map(formatPathKey).join("") : formatPathKey(path);
|
||||
exports.formatPath = formatPath;
|
||||
//# sourceMappingURL=util.js.map
|
||||
1
backend/node_modules/effect/dist/cjs/internal/schema/util.js.map
generated
vendored
Normal file
1
backend/node_modules/effect/dist/cjs/internal/schema/util.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user