@@ -9,19 +9,6 @@ export interface Props {
9
9
10
10
const { element_name = null , oop_only_methods, oop_compatible_functions } = Astro .props ;
11
11
12
- let oop_variables_by_var: Record <string , any []> = {};
13
- for (const func of oop_compatible_functions ) {
14
- if (func .oop .variable ) {
15
- if (! oop_variables_by_var [func .oop .variable ]) {
16
- oop_variables_by_var [func .oop .variable ] = [];
17
- }
18
- oop_variables_by_var [func .oop .variable ].push ({
19
- functionName: func .name ,
20
- functionLink: func .link ,
21
- functionOop: func .oop ,
22
- });
23
- }
24
- }
25
12
let oop_constructor = oop_compatible_functions .find (func => func .oop .constructorclass );
26
13
---
27
14
{ element_name && oop_constructor && (
@@ -33,21 +20,36 @@ let oop_constructor = oop_compatible_functions.find(func => func.oop.constructor
33
20
</section >
34
21
)}
35
22
36
- { Object . keys ( oop_variables_by_var ) .length > 0 && (
37
- <section class = " oop-variables -section" >
38
- <h4 ><a href = " /OOP_Introduction" >OOP</a > Variables and Methods </h4 >
23
+ { oop_compatible_functions .length > 0 && (
24
+ <section class = " oop-compatible-functions -section" >
25
+ <h4 ><a href = " /OOP_Introduction" >OOP</a > Methods and Variables </h4 >
39
26
<ul >
40
- { Object .entries (oop_variables_by_var ).map (([variableName , functions ]) => (
41
- <li >
42
- <code >{ variableName } </code >:
43
- { functions .map ((func : any , index : number ) => (
44
- <Fragment >
45
- <a href = { func .functionLink } >{ func .functionOop .method } </a >
46
- { index < functions .length - 1 ? ' , ' : ' ' }
47
- </Fragment >
48
- ))}
49
- </li >
50
- ))}
27
+ { oop_compatible_functions .map ((funcInfo : any ) => (
28
+ <li >
29
+ { funcInfo .oop .constructorclass ? (
30
+ <span >
31
+ <strong >Constructor</strong >:
32
+ { funcInfo .oop .constructorclass } (...)
33
+ </span >
34
+ ) : (
35
+ <>
36
+ { funcInfo .oop .method && (
37
+ <span style = " margin-right: 10px;" >
38
+ <strong >Method</strong >:
39
+ { funcInfo .oop .static ? funcInfo .oop .entity .charAt (0 ).toUpperCase () + funcInfo .oop .entity .slice (1 ) : funcInfo .oop .entity } { funcInfo .oop .static ? ' .' : ' :' } <a href = { funcInfo .link } title = { funcInfo .name } >{ funcInfo .oop .method } </a >(...)
40
+ </span >
41
+ )}
42
+
43
+ { funcInfo .oop .variable && (
44
+ <span >
45
+ <strong >Variable</strong >:
46
+ .{ funcInfo .oop .variable }
47
+ </span >
48
+ )}
49
+ </>
50
+ )}
51
+ </li >
52
+ ))}
51
53
</ul >
52
54
</section >
53
55
)}
0 commit comments