File tree Expand file tree Collapse file tree 3 files changed +27
-24
lines changed
docs/en/guide/docs/contact Expand file tree Collapse file tree 3 files changed +27
-24
lines changed Original file line number Diff line number Diff line change @@ -3,32 +3,35 @@ title: Example
33---
44
55``` tsx
6- import { Script } from " scripting" ;
6+ import { Script } from " scripting"
77
88async function run() {
9- console .present ().then (() => {
10- Script .exit ();
11- });
12-
13- console .log (" Start to fetch contacts" );
14- try {
15- const contacts = await Contact .fetchAllContacts ();
16-
17- const first = contacts .at (0 );
18-
19- if (! first ) {
20- console .log (" No contacts found" );
21- } else {
22- console .log (" There are " + contacts .length + " contacts" );
23-
24- const name = [first . givenName , first . familyName ]. join ( " " );
25-
26- console . log ( " First contact name: " + name );
27- }
28- } catch ( e ) {
29- console .error ( e );
9+ console .present ().then (() => {
10+ Script .exit ()
11+ })
12+
13+ console .log (" Start to fetch contacts" )
14+ try {
15+ const contacts = await Contact .fetchAllContacts ()
16+
17+ const first = contacts .at (0 )
18+
19+ if (! first ) {
20+ console .log (" No contacts found" )
21+ } else {
22+ console .log (" There are " + contacts .length + " contacts" )
23+
24+ const name = [
25+ first . givenName ,
26+ first . familyName
27+ ]. join ( " " )
28+
29+ console .log ( " First contact name: " + name )
3030 }
31+ } catch (e ) {
32+ console .error (e )
33+ }
3134}
3235
33- run ();
36+ run ()
3437```
Original file line number Diff line number Diff line change 66 "build" : " rspress build" ,
77 "dev" : " rspress dev" ,
88 "preview" : " rspress preview" ,
9- "generate-mdx " : " node scripts/generate -example-mdx .js"
9+ "gen-example " : " bun scripts/gen -example.js"
1010 },
1111 "dependencies" : {
1212 "rspress" : " ^1.40.2"
File renamed without changes.
You can’t perform that action at this time.
0 commit comments