Skip to content

Commit d426a29

Browse files
committed
refactor: rename isTemplateLiteral to isSimpleTemplateLiteral for clarity
1 parent e91aa36 commit d426a29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/node-utils/accessors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface TemplateLiteral<Value extends string = string>
4141
* If a `value` is provided & the `node` is a `TemplateLiteral`,
4242
* the `value` will be compared to that of the `TemplateLiteral`.
4343
*/
44-
const isTemplateLiteral = <V extends string>(
44+
const isSimpleTemplateLiteral = <V extends string>(
4545
node: TSESTree.Node,
4646
value?: V
4747
): node is TemplateLiteral<V> =>
@@ -60,7 +60,7 @@ export const isStringNode = <V extends string>(
6060
node: TSESTree.Node,
6161
specifics?: V
6262
): node is StringNode<V> =>
63-
isStringLiteral(node, specifics) || isTemplateLiteral(node, specifics);
63+
isStringLiteral(node, specifics) || isSimpleTemplateLiteral(node, specifics);
6464

6565
/**
6666
* Gets the value of the given `StringNode`.
@@ -69,7 +69,7 @@ export const isStringNode = <V extends string>(
6969
* otherwise, `value` is returned instead.
7070
*/
7171
export const getStringValue = <S extends string>(node: StringNode<S>): S =>
72-
isTemplateLiteral(node) ? node.quasis[0].value.raw : node.value;
72+
isSimpleTemplateLiteral(node) ? node.quasis[0].value.raw : node.value;
7373

7474
/**
7575
* An `Identifier` with a known `name` value

0 commit comments

Comments
 (0)