From 8160a4b01c6ba7fe3f46f9085d40e7e3d1ab8f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 14 Jun 2022 09:23:52 -0400 Subject: [PATCH] fix typo --- packages/babel-traverse/src/path/evaluation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/babel-traverse/src/path/evaluation.ts b/packages/babel-traverse/src/path/evaluation.ts index 9157d883322b..0accebc030ae 100644 --- a/packages/babel-traverse/src/path/evaluation.ts +++ b/packages/babel-traverse/src/path/evaluation.ts @@ -6,14 +6,14 @@ import type * as t from "@babel/types"; const VALID_CALLEES = ["String", "Number", "Math"] as const; const INVALID_METHODS = ["random"] as const; -function isValidCalless(val: string): val is typeof VALID_CALLEES[number] { +function isValidCallee(val: string): val is typeof VALID_CALLEES[number] { return VALID_CALLEES.includes( // @ts-expect-error val, ); } -function isInvalidMethods(val: string): val is typeof INVALID_METHODS[number] { +function isInvalidMethod(val: string): val is typeof INVALID_METHODS[number] { return INVALID_METHODS.includes( // @ts-expect-error val, @@ -371,7 +371,7 @@ function _evaluate(path: NodePath, state: State): any { if ( callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && - isValidCalless(callee.node.name) + isValidCallee(callee.node.name) ) { func = global[callee.node.name]; } @@ -384,8 +384,8 @@ function _evaluate(path: NodePath, state: State): any { if ( object.isIdentifier() && property.isIdentifier() && - isValidCalless(object.node.name) && - !isInvalidMethods(property.node.name) + isValidCallee(object.node.name) && + !isInvalidMethod(property.node.name) ) { context = global[object.node.name]; // @ts-ignore property may not exist in context object