From b21b248b71a1486fb7d4de58fc825c040270a9ad Mon Sep 17 00:00:00 2001 From: adb-sh Date: Wed, 29 Mar 2023 10:26:45 +0200 Subject: [PATCH] Add hoyams blog post --- src/projects/hoyams.md | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/projects/hoyams.md diff --git a/src/projects/hoyams.md b/src/projects/hoyams.md new file mode 100644 index 0000000..33b0ced --- /dev/null +++ b/src/projects/hoyams.md @@ -0,0 +1,43 @@ +--- +sidebar: true +excerpt: "the validation tool nobody asked for | hoyams = hold on you are missing something" +meta: +- name: description + content: the validation tool nobody asked for +- name: keywords + content: Alban, David, Becker, deno, web, javascript +--- + +# hoyams + +a simple matrix webapp for mobile and desktop + +- stack: deno, typescript +- repo: [github.com](https://github.com/adb-sh/hoyams) +- - deno package: [deno.land](https://deno.land/x/hoyams) + +## Concept + +Rules are defined via a callback which retuns `true` or an error String. This is +so that you can define rules by using an or operator like this: + +```javascript +new Rule((v) => typeof v === "string" || "is not a string"); +``` + +or this: + +```javascript +new Rule((v) => + typeof v === "string" && !!v.match(/^\w+@\w+\.\w+$/) || + "no valid email" +); +``` + +- If a executing a validation completes without an error an object with the same + structure as the object given is returned. + +- For creating powerful nested object rules there are some primites given: + [How to use](https://deno.land/x/hoyams@v0.0.1#how-to-use) + +