File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
let nodeCount = 0
2
- const nodeTypeCounts : Map < NodeType , number > = new Map
2
+ const nodeTypeCounts = new Map < NodeType , number > ( )
3
+
4
+ async function initialize ( ) {
5
+ await figma . loadAllPagesAsync ( )
6
+ }
3
7
4
8
function visit ( node ) {
5
9
nodeTypeCounts . set ( node . type , 1 + ( nodeTypeCounts . get ( node . type ) | 0 ) )
6
10
nodeCount ++
7
11
if ( node . children ) node . children . forEach ( visit )
8
12
}
9
13
14
+ initialize ( ) ;
10
15
visit ( figma . root )
11
16
12
17
let text = `Node count: ${ nodeCount } \n`
13
- let nodeTypes = Array . from ( nodeTypeCounts . entries ( ) )
18
+ const nodeTypes = Array . from ( nodeTypeCounts . entries ( ) )
14
19
nodeTypes . sort ( ( a , b ) => b [ 1 ] - a [ 1 ] )
15
20
text += `Node types:` + nodeTypes . map ( ( [ k , v ] ) => `\n ${ k } : ${ v } ` ) . join ( '' )
16
21
Original file line number Diff line number Diff line change 6
6
"editorType" : [" figma" , " figjam" ],
7
7
"networkAccess" : {
8
8
"allowedDomains" : [" none" ]
9
- }
9
+ },
10
+ "documentAccess" : " dynamic-page"
10
11
}
You can’t perform that action at this time.
0 commit comments