@effect/schema
Advanced tools
Comparing version 0.30.2 to 0.30.3
{ | ||
"name": "@effect/schema", | ||
"version": "0.30.2", | ||
"version": "0.30.3", | ||
"license": "MIT", | ||
@@ -10,3 +10,3 @@ "repository": { | ||
"dependencies": { | ||
"@effect/data": "^0.16.1", | ||
"@effect/data": "^0.16.2", | ||
"@effect/io": "^0.35.2", | ||
@@ -13,0 +13,0 @@ "fast-check": "^3.11.0" |
@@ -15,3 +15,9 @@ /** | ||
import type { ParseResult } from "@effect/schema/ParseResult"; | ||
declare const TypeId: unique symbol; | ||
/** | ||
* @since 1.0.0 | ||
* @category symbol | ||
*/ | ||
export type TypeId = typeof TypeId; | ||
/** | ||
* @category model | ||
@@ -21,2 +27,3 @@ * @since 1.0.0 | ||
export interface Schema<From, To = From> extends Pipeable { | ||
readonly _id: TypeId; | ||
readonly From: (_: From) => From; | ||
@@ -190,2 +197,9 @@ readonly To: (_: To) => To; | ||
/** | ||
* Tests if a value is a `Schema`. | ||
* | ||
* @category guards | ||
* @since 1.0.0 | ||
*/ | ||
export declare const isSchema: (input: unknown) => input is Schema<unknown, unknown>; | ||
/** | ||
* @category constructors | ||
@@ -192,0 +206,0 @@ * @since 1.0.0 |
@@ -96,4 +96,4 @@ "use strict"; | ||
}); | ||
exports.keyof = exports.itemsCount = void 0; | ||
exports.optionalElement = exports.optional = exports.optionFromSelf = exports.optionFromNullable = exports.option = exports.omit = exports.object = exports.numberFromString = exports.number = exports.nullable = exports.null = exports.not = exports.nonPositiveBigint = exports.nonPositive = exports.nonNegativeBigint = exports.nonNegative = exports.nonNaN = exports.nonEmptyArray = exports.nonEmpty = exports.never = exports.negativeBigint = exports.negative = exports.multipleOf = exports.minLength = exports.minItems = exports.message = exports.maxLength = exports.maxItems = exports.make = exports.literal = exports.lessThanOrEqualToBigint = exports.lessThanOrEqualTo = exports.lessThanBigint = exports.lessThan = exports.length = exports.lazy = void 0; | ||
exports.itemsCount = exports.isSchema = void 0; | ||
exports.optionalElement = exports.optional = exports.optionFromSelf = exports.optionFromNullable = exports.option = exports.omit = exports.object = exports.numberFromString = exports.number = exports.nullable = exports.null = exports.not = exports.nonPositiveBigint = exports.nonPositive = exports.nonNegativeBigint = exports.nonNegative = exports.nonNaN = exports.nonEmptyArray = exports.nonEmpty = exports.never = exports.negativeBigint = exports.negative = exports.multipleOf = exports.minLength = exports.minItems = exports.message = exports.maxLength = exports.maxItems = exports.make = exports.literal = exports.lessThanOrEqualToBigint = exports.lessThanOrEqualTo = exports.lessThanBigint = exports.lessThan = exports.length = exports.lazy = exports.keyof = void 0; | ||
Object.defineProperty(exports, "parse", { | ||
@@ -196,2 +196,3 @@ enumerable: true, | ||
const TypeId = /*#__PURE__*/Symbol.for("@effect/schema/Schema"); | ||
/** | ||
@@ -214,2 +215,3 @@ * @since 1.0.0 | ||
ast; | ||
_id = TypeId; | ||
From; | ||
@@ -229,3 +231,11 @@ To; | ||
const make = ast => new SchemaImpl(ast); | ||
/** | ||
* Tests if a value is a `Schema`. | ||
* | ||
* @category guards | ||
* @since 1.0.0 | ||
*/ | ||
exports.make = make; | ||
const isSchema = input => (0, _Predicate.isObject)(input) && "_id" in input && input["_id"] === TypeId; | ||
exports.isSchema = isSchema; | ||
const makeLiteral = value => make(AST.createLiteral(value)); | ||
@@ -532,2 +542,3 @@ /** | ||
[_Brand.RefinedConstructorsTypeId]: _Brand.RefinedConstructorsTypeId, | ||
_id: TypeId, | ||
ast, | ||
@@ -534,0 +545,0 @@ option: input => validateOption(input), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
919473
17423
Updated@effect/data@^0.16.2