Structure
Search…
Structure v2
Introduction
Schema concept
Custom setters and getters
Coercion
Primitive type coercion
Arrays coercion
Generic coercion
Recursive coercion
Disabling coercion
Validation
Strict mode
Cloning an instance
Serialization
Testing
Battlecry generators
Migrating from v1
Support and compatibility
Changelog
Contributing
License
GitHub
Powered By
GitBook
Coercion
Structure does type coercion based on the declared
schema
, let's break it into 3 categories:
Primitive type coercion
Arrays coercion
Generic coercion
Observations
Structure
never
coerces the following scenarios:
value is
undefined
;
value is
null
when
nullable
option is enabled;
value is already of the declared type (except for arrays, we'll talk more about this soon).
Previous
Custom setters and getters
Next
Primitive type coercion
Last modified
2yr ago
Copy link