1
- export function getFilename ( context ) {
1
+ function getFilename ( context ) {
2
2
if ( 'filename' in context ) {
3
3
return context . filename ;
4
4
}
5
5
6
6
return context . getFilename ( ) ;
7
7
}
8
8
9
- export function getPhysicalFilename ( context ) {
9
+ function getPhysicalFilename ( context ) {
10
10
if ( context . getPhysicalFilename ) {
11
11
return context . getPhysicalFilename ( ) ;
12
12
}
13
13
14
14
return getFilename ( context ) ;
15
15
}
16
16
17
- export function getSourceCode ( context ) {
17
+ function getSourceCode ( context ) {
18
18
if ( 'sourceCode' in context ) {
19
19
return context . sourceCode ;
20
20
}
21
21
22
22
return context . getSourceCode ( ) ;
23
23
}
24
24
25
- export function getScope ( context , node ) {
25
+ function getScope ( context , node ) {
26
26
const sourceCode = getSourceCode ( context ) ;
27
27
28
28
if ( sourceCode && sourceCode . getScope ) {
@@ -32,7 +32,7 @@ export function getScope(context, node) {
32
32
return context . getScope ( ) ;
33
33
}
34
34
35
- export function getAncestors ( context , node ) {
35
+ function getAncestors ( context , node ) {
36
36
const sourceCode = getSourceCode ( context ) ;
37
37
38
38
if ( sourceCode && sourceCode . getAncestors ) {
@@ -42,7 +42,7 @@ export function getAncestors(context, node) {
42
42
return context . getAncestors ( ) ;
43
43
}
44
44
45
- export function getDeclaredVariables ( context , node ) {
45
+ function getDeclaredVariables ( context , node ) {
46
46
const sourceCode = getSourceCode ( context ) ;
47
47
48
48
if ( sourceCode && sourceCode . getDeclaredVariables ) {
@@ -51,3 +51,12 @@ export function getDeclaredVariables(context, node) {
51
51
52
52
return context . getDeclaredVariables ( node ) ;
53
53
}
54
+
55
+ module . exports = {
56
+ getFilename,
57
+ getPhysicalFilename,
58
+ getSourceCode,
59
+ getScope,
60
+ getAncestors,
61
+ getDeclaredVariables,
62
+ } ;
0 commit comments