6.0.0 • Published 6 months ago

rescript-struct v6.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

CI codecov npm

ReScript Schema (previously rescript-struct)

The fastest composable parser/serializer for ReScript (and TypeScript)

‼️‼️‼️ The package is renamed to rescript-schema. The old rescript-struct name is depreacted.

⚠️ Be aware that rescript-schema uses eval. It's usually fine but might not work in some environments like Cloudflare Workers or third-party scripts used on pages with the script-src header.

Highlights:

  • Combines validation and transformation without a performance loss
  • Can transform parsed value back to the initial format (serializing)
  • Works with any Js value, not only Js.Json.t
  • Support for asynchronous transformations
  • Immutable API with both result and exception-based operations
  • Easy to create recursive schema
  • Detailed error messages
  • Opt-in strict mode for object schema to prevent excessive fields and many more built-in helpers
  • Works with plain JavaScript/TypeScript too! You don't need to use ReScript
  • The fastest composable validation library in the entire JavaScript ecosystem (benchmark)
  • Small JS footprint & tree-shakable API (Comparison with Zod and Valibot)

Also, it has declarative API allowing you to use rescript-schema as a building block for other tools, such as:

Documentation

5.1.1

6 months ago

5.1.0

7 months ago

6.0.0

6 months ago

5.0.1

8 months ago

5.0.0

8 months ago

3.1.0

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

4.1.1

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

1.0.0

2 years ago

2.0.0

2 years ago

0.27.0

2 years ago

0.26.0

2 years ago

0.25.0

2 years ago

0.21.0

2 years ago

0.20.1

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.11.0

2 years ago

0.12.0

2 years ago

0.13.0

2 years ago

0.12.1

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.24.0

2 years ago

0.23.0

2 years ago

0.22.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.3.0

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago