diff --git a/paseri-docs/src/components/Playground.astro b/paseri-docs/src/components/Playground.astro new file mode 100644 index 0000000..4854a46 --- /dev/null +++ b/paseri-docs/src/components/Playground.astro @@ -0,0 +1,9 @@ +--- +import * as p from '../../../paseri-lib/src/index'; + +const { schema, data } = Astro.props; + +const result = new Function('p', `return ${schema}.parse(${data})`)(p); +--- + +
{schema}{result}
diff --git a/paseri-docs/src/content/docs/reference/Schema/Primitives/string.mdx b/paseri-docs/src/content/docs/reference/Schema/Primitives/string.mdx index add571d..576e966 100644 --- a/paseri-docs/src/content/docs/reference/Schema/Primitives/string.mdx +++ b/paseri-docs/src/content/docs/reference/Schema/Primitives/string.mdx @@ -4,6 +4,10 @@ sidebar: order: 1 --- +import Playground from '../../../../../components/Playground.astro' + + + ```typescript import * as p from '@vbudovski/paseri';