NumberSchema
Extends
Section titled “Extends”Methods<Native.Number,NumberSchema>
Properties
Section titled “Properties”
readonlyis: (input) =>input is number
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”input is number
Inherited from
Section titled “Inherited from”Methods.is
readonlyparse: (input) =>Effect<number,ParseError,never>
Checks input and returns it typed, with defaults filled in and unknown object keys removed.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”Effect<number, ParseError, never>
Example
Section titled “Example”const config = yield* Config.parse(JSON.parse(text));Inherited from
Section titled “Inherited from”Methods.parse
schema
Section titled “schema”
readonlyschema:Number
The Effect schema underneath, for use with effect/Schema.
Inherited from
Section titled “Inherited from”Methods.schema
Methods
Section titled “Methods”default()
Section titled “default()”default(
value):Field<withDecodingDefaultType<Number,never>>
Uses value when the input is undefined or an object leaves the key out.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Field<withDecodingDefaultType<Number, never>>
Inherited from
Section titled “Inherited from”Methods.default
int(
message?):NumberSchema
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”NumberSchema
max(
value,message?):NumberSchema
Parameters
Section titled “Parameters”number
message?
Section titled “message?”string
Returns
Section titled “Returns”NumberSchema
min(
value,message?):NumberSchema
Parameters
Section titled “Parameters”number
message?
Section titled “message?”string
Returns
Section titled “Returns”NumberSchema
nullable()
Section titled “nullable()”nullable():
Schema<NullOr<Number>>
Returns
Section titled “Returns”Schema<NullOr<Number>>
Inherited from
Section titled “Inherited from”Methods.nullable
optional()
Section titled “optional()”optional():
Field<optional<Number>>
Allows undefined, and lets an object leave the key out.
Returns
Section titled “Returns”Field<optional<Number>>
Inherited from
Section titled “Inherited from”Methods.optional
refine()
Section titled “refine()”refine(
predicate,message?):NumberSchema
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value) => boolean
message?
Section titled “message?”string
Returns
Section titled “Returns”NumberSchema
Inherited from
Section titled “Inherited from”Methods.refine