Skip to content

Commit 65d34fa

Browse files
committed
refactor(utilities/var): rename 'getRequireExpressionArgument' to 'getRequireExpressionArguments'
1 parent 93f95fa commit 65d34fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/utilities/var/src/is-initialized-from-source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function isInitializedFromSource(
3434
}
3535
// check for: `variable = require('source')` or `variable = require('source').variable`
3636
return F.pipe(
37-
getRequireExpressionArgument(init),
37+
getRequireExpressionArguments(init),
3838
O.flatMapNullable((args) => args[0]),
3939
O.filter(AST.isStringLiteral),
4040
// check for: `require('source')` or `require('source/...')`
@@ -45,7 +45,7 @@ export function isInitializedFromSource(
4545
return isMatching({ type: "ImportDeclaration", source: { value: source } }, parent);
4646
}
4747

48-
function getRequireExpressionArgument(node: TSESTree.Node): O.Option<TSESTree.CallExpressionArgument[]> {
48+
function getRequireExpressionArguments(node: TSESTree.Node): O.Option<TSESTree.CallExpressionArgument[]> {
4949
switch (true) {
5050
// require('source')
5151
case node.type === AST_NODE_TYPES.CallExpression
@@ -55,7 +55,7 @@ function getRequireExpressionArgument(node: TSESTree.Node): O.Option<TSESTree.Ca
5555
}
5656
// require('source').variable
5757
case node.type === AST_NODE_TYPES.MemberExpression: {
58-
return getRequireExpressionArgument(node.object);
58+
return getRequireExpressionArguments(node.object);
5959
}
6060
}
6161
return O.none();

0 commit comments

Comments
 (0)