From a78c10aec5a95f15b0e20c2bb8622a10d264d6c1 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Thu, 9 Jan 2025 21:57:05 +0400 Subject: [PATCH] Add content section to the README.md --- README.md | 5 +++++ docs/js-usage.md | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a0069140..eb7600a2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/js-usage.md b/docs/js-usage.md index a7144a64..d51d7466 100644 --- a/docs/js-usage.md +++ b/docs/js-usage.md @@ -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`