From 4cdb8ad491a3d14165fcd6493782869366288ea9 Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sat, 20 Jun 2020 11:49:04 -0700 Subject: [PATCH] Added import using wildcard to docs (#391) Co-authored-by: Ian Storm Taylor --- docs/guide.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/guide.md b/docs/guide.md index 4b220ef0..0d094e03 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -30,6 +30,17 @@ And then you can import it into your code base: import { assert } from 'superstruct' ``` +Superstruct has many importable methods. To reduce the friction of importing many methods you can use a wildcard. The methods are then accessed from one object. + +```ts +import * as s from 'superstruct' + +const User = s.object({ + id: s.number(), + name: s.string(), +}) +``` + If you would rather import Superstruct with a `