Minor Changes
-
#2505
0aee906
Thanks @mikearnaldi! - Re-export FastCheck to simplify usage and to resolve long term issues with ESM/CJS -
#2440
b3acf47
Thanks @gcanti! - ##AST
module- rename
isTransform
toisTransformation
ParseResult
module- rename
Tuple
toTupleType
TreeFormatter
module- rename
formatIssue
toformatIssueSync
(This change was made to maintain consistency in API naming across all decoding and encoding APIs.) - rename
formatIssueEffect
toformatIssue
- rename
formatError
toformatErrorSync
- rename
formatErrorEffect
toformatError
ArrayFormatter
module- rename
formatIssue
toformatIssueSync
- rename
formatIssueEffect
toformatIssue
- rename
formatError
toformatErrorSync
- rename
formatErrorEffect
toformatError
Schema
module- consolidate
transform
andtransformOrFail
parameters into anoptions
object, #2434 - consolidate
Class.transformOrFail
andClass.transformOrFailFrom
parameters into anoptions
object - consolidate
declare
parameters into anoptions
object - consolidate
optionalToRequired
parameters into anoptions
object - consolidate
optionalToOptional
parameters into anoptions
object - Removed
negateBigDecimal
function (This cleanup was prompted by the realization that numerous functions can be derived from transformations such as negation, Math.abs, increment, etc. However, including all of them in the library is not feasible. Therefore,negateBigDecimal
was removed)
Renaming
- rename
uniqueSymbolFromSelf
toUniqueSymbolFromSelf
- rename
undefined
toUndefined
- rename
void
toVoid
- rename
null
toNull
- rename
never
toNever
- rename
unknown
toUnknown
- rename
any
toAny
- rename
string
toString
- rename
number
toNumber
- rename
boolean
toBoolean
- rename
/bigint/ig
toBigInt
- rename
symbolFromSelf
toSymbolFromSelf
- rename
object
toObject
- rename
union
toUnion
- rename
nullable
toNullOr
- rename
orUndefined
toUndefinedOr
- rename
nullish
toNullishOr
- rename
tuple
toTuple
- rename
array
toArray
- rename
nonEmptyArray
toNonEmptyArray
- rename
struct
toStruct
- rename
record
toRecord
- rename
symbol
toSymbol
- rename
optionFromSelf
toOptionFromSelf
- rename
option
toOption
- rename
optionFromNullable
toOptionFromNullOr
- rename
optionFromNullish
toOptionFromNullishOr
- rename
optionFromOrUndefined
toOptionFromUndefinedOr
- rename
eitherFromSelf
toEitherFromSelf
- rename
either
toEither
- rename
eitherFromUnion
toEitherFromUnion
- rename
readonlyMapFromSelf
toReadonlyMapFromSelf
- rename
mapFromSelf
toMapFromSelf
- rename
readonlyMap
toReadonlyMap
- rename
map
toMap
- rename
readonlySetFromSelf
toReadonlySetFromSelf
- rename
setFromSelf
toSetFromSelf
- rename
readonlySet
toReadonlySet
- rename
set
toSet
- rename
chunkFromSelf
toChunkFromSelf
- rename
chunk
toChunk
- rename
dataFromSelf
toDataFromSelf
- rename
data
toData
- rename
causeFromSelf
toCauseFromSelf
- rename
causeDefectUnknown
toCauseDefectUnknown
- rename
cause
toCause
- rename
exitFromSelf
toExitFromSelf
- rename
exit
toExit
- rename
hashSetFromSelf
toHashSetFromSelf
- rename
hashSet
toHashSet
- rename
hashMapFromSelf
toHashMapFromSelf
- rename
hashMap
toHashMap
- rename
listFromSelf
toListFromSelf
- rename
list
toList
- rename
sortedSetFromSelf
toSortedSetFromSelf
- rename
sortedSet
toSortedSet
- rename
literal
toLiteral
- rename
enums
toEnums
- rename
templateLiteral
toTemplateLiteral
- rename
-
#2511
0d3231a
Thanks @gcanti! - makeAST.pick
correctly handle key renames -
#2508
c22b019
Thanks @mikearnaldi! - Rename Arbitrary.Arbitrary to Arbitrary.LazyArbitrary, rename Arbitrary.make to Arbitrary.makeLazy and introduce Arbitrary.makeBefore
import { Arbitrary, Schema } from "@effect/schema"; import * as fc from "fast-check"; const Person = Schema.struct({ name: Schema.string, age: Schema.string.pipe( Schema.compose(Schema.NumberFromString), Schema.int(), ), }); const arb = Arbitrary.make(Person)(fc); console.log(fc.sample(arb, 2));
Now
import { Arbitrary, FastCheck, Schema } from "@effect/schema"; const Person = Schema.Struct({ name: Schema.String, age: Schema.String.pipe( Schema.compose(Schema.NumberFromString), Schema.int(), ), }); const arb = Arbitrary.make(Person); console.log(FastCheck.sample(arb, 2));