StringSchema
Extends
Section titled “Extends”Methods<Native.String,StringSchema>
Properties
Section titled “Properties”
readonlyis: (input) =>input is string
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”input is string
Inherited from
Section titled “Inherited from”Methods.is
readonlyparse: (input) =>Effect<string,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<string, 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:String
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<String,never>>
Uses value when the input is undefined or an object leaves the key out.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Field<withDecodingDefaultType<String, never>>
Inherited from
Section titled “Inherited from”Methods.default
max(
length,message?):StringSchema
Parameters
Section titled “Parameters”length
Section titled “length”number
message?
Section titled “message?”string
Returns
Section titled “Returns”StringSchema
min(
length,message?):StringSchema
Parameters
Section titled “Parameters”length
Section titled “length”number
message?
Section titled “message?”string
Returns
Section titled “Returns”StringSchema
nullable()
Section titled “nullable()”nullable():
Schema<NullOr<String>>
Returns
Section titled “Returns”Schema<NullOr<String>>
Inherited from
Section titled “Inherited from”Methods.nullable
optional()
Section titled “optional()”optional():
Field<optional<String>>
Allows undefined, and lets an object leave the key out.
Returns
Section titled “Returns”Field<optional<String>>
Inherited from
Section titled “Inherited from”Methods.optional
refine()
Section titled “refine()”refine(
predicate,message?):StringSchema
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value) => boolean
message?
Section titled “message?”string
Returns
Section titled “Returns”StringSchema
Inherited from
Section titled “Inherited from”Methods.refine
regex()
Section titled “regex()”regex(
pattern,message?):StringSchema
Parameters
Section titled “Parameters”pattern
Section titled “pattern”RegExp
message?
Section titled “message?”string
Returns
Section titled “Returns”StringSchema