Skip to content

Commit

Permalink
Add content section to the README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed Jan 9, 2025
1 parent ad9d0b2 commit a78c10a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Also, it has declarative API allowing you to use **rescript-schema** as a buildi
- [For PPX users](/packages/rescript-schema-ppx/README.md)
- [For library maintainers](/docs/integration-guide.md)

## Content

- Building and consuming REST API in ReScript with rescript-rest and Fastify ([YouTube](https://youtu.be/37FY6a-zY20?si=72zT8Gecs5vmDPlD))
- ReScript Schema V9 Changes Overview ([Dev.to](https://dev.to/dzakh/rescript-schema-v9-zod-like-library-to-the-next-level-1dn6))

## Comparison

Instead of relying on a few large functions with many methods, **rescript-schema** follows [Valibot](https://github.com/fabian-hiller/valibot)'s approach, where API design and source code is based on many small and independent functions, each with just a single task. This modular design has several advantages.
Expand Down
16 changes: 7 additions & 9 deletions docs/js-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,14 @@ Use the `S.strip` function to reset an object schema to the default behavior (st
Both `S.strict` and `S.strip` are applied for the first level of the object schema. If you want to apply it for all nested schemas, you can use `S.deepStrict` and `S.deepStrip` functions.

```ts
let schema = S.schema(s =>
{
"bar": {
"baz": S.string,
}
}
)
let schema = S.schema({
bar: {
baz: S.string,
},
});

S.strict(schema) // { "baz": string } will still allow unknown keys
S.deepStrict(schema) // { "baz": string } will not allow unknown keys
S.strict(schema); // { "baz": string } will still allow unknown keys
S.deepStrict(schema); // { "baz": string } will not allow unknown keys
```

### `merge`
Expand Down

0 comments on commit a78c10a

Please sign in to comment.