-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaccess.js
More file actions
36 lines (35 loc) · 773 Bytes
/
access.js
File metadata and controls
36 lines (35 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// @name @access
/// @page annotations
/// @arg {string} line [public] - public, private, protected
/// @description
/// Access of the documented item. If access isn't declared then it defaults to public.
/// @markup Usage
/// /// @access public
///
/// /// @access private
///
/// /// @access protected
/// @note This is autofilled on every comment block
export default {
autofill() {
let access = 'public'
try {
if (this.comment.type === 'inline') {
access = this.parent.parsed.access
}
} catch (e) {
// do nothing
}
return access
},
parse() {
const line = `${this.annotation.contents[0]}`
if (
line === 'private' ||
line === 'protected'
) {
return line
}
return 'public'
}
}