Skip to content

Commit 543e378

Browse files
committed
refactor: use module.exports
1 parent f0853cb commit 543e378

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Diff for: src/context.js

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
export function getFilename(context) {
1+
function getFilename(context) {
22
if ('filename' in context) {
33
return context.filename;
44
}
55

66
return context.getFilename();
77
}
88

9-
export function getPhysicalFilename(context) {
9+
function getPhysicalFilename(context) {
1010
if (context.getPhysicalFilename) {
1111
return context.getPhysicalFilename();
1212
}
1313

1414
return getFilename(context);
1515
}
1616

17-
export function getSourceCode(context) {
17+
function getSourceCode(context) {
1818
if ('sourceCode' in context) {
1919
return context.sourceCode;
2020
}
2121

2222
return context.getSourceCode();
2323
}
2424

25-
export function getScope(context, node) {
25+
function getScope(context, node) {
2626
const sourceCode = getSourceCode(context);
2727

2828
if (sourceCode && sourceCode.getScope) {
@@ -32,7 +32,7 @@ export function getScope(context, node) {
3232
return context.getScope();
3333
}
3434

35-
export function getAncestors(context, node) {
35+
function getAncestors(context, node) {
3636
const sourceCode = getSourceCode(context);
3737

3838
if (sourceCode && sourceCode.getAncestors) {
@@ -42,7 +42,7 @@ export function getAncestors(context, node) {
4242
return context.getAncestors();
4343
}
4444

45-
export function getDeclaredVariables(context, node) {
45+
function getDeclaredVariables(context, node) {
4646
const sourceCode = getSourceCode(context);
4747

4848
if (sourceCode && sourceCode.getDeclaredVariables) {
@@ -51,3 +51,12 @@ export function getDeclaredVariables(context, node) {
5151

5252
return context.getDeclaredVariables(node);
5353
}
54+
55+
module.exports = {
56+
getFilename,
57+
getPhysicalFilename,
58+
getSourceCode,
59+
getScope,
60+
getAncestors,
61+
getDeclaredVariables,
62+
};

0 commit comments

Comments
 (0)