A tiny JSON Schema type casting and normalization library (v1.3.2). It coerces raw input values to the types defined in a JSON Schema (draft-04). Lightweight and focused solely on type casting, with no external dependencies. Release cadence is low; last update February 2018. Differentiator: minimal footprint and zero dependencies compared to alternatives like ajv or tv4.
npm install schema-castingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic type casting: strings are converted to integer, boolean, and number according to JSON Schema.
Consider using a more modern library like ajv for draft-06/07/2019-09 support.
Pre-validate with another library like ajv before casting if validation is needed.
Explicitly set 'additionalProperties': false if you want to remove extra properties.
Avoid using 'type': 'null' in your schema.
Use import cast from 'schema-casting' or const cast = require('schema-casting').Ensure schema has a top-level 'type' defined (e.g., 'object').
Remove the $schema field or use a draft-04 compatible schema.
No dependency data recorded yet.