Rename utils methods like isHtmlLike to isNodeHtmlLike

Also renamed isNodeNotHtmlLike
This commit is contained in:
2019-07-24 02:26:54 +05:30
parent 9039ab991b
commit 99d808c9b8
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import { FiberNode } from "./mocked-types";
import { isNotHtmlLike } from "./utils";
import { isNodeNotHtmlLike } from "./utils";
function findNodeByComponentName(
node: FiberNode | null,
@@ -9,7 +9,7 @@ function findNodeByComponentName(
return null;
}
if (isNotHtmlLike(node) && node.type.name === expectedName) {
if (isNodeNotHtmlLike(node) && node.type.name === expectedName) {
console.debug("Found node " + node);
return node;
}
@@ -38,7 +38,7 @@ function findNodeByComponent(
return null;
}
if (isNotHtmlLike(node) && node.type === expectedClassOrFunction) {
if (isNodeNotHtmlLike(node) && node.type === expectedClassOrFunction) {
console.debug("Found node " + node);
return node;
}
@@ -67,7 +67,7 @@ function findNodeByComponentInstance(
return null;
}
if (isNotHtmlLike(node) && node.stateNode === expectedClassInstance) {
if (isNodeNotHtmlLike(node) && node.stateNode === expectedClassInstance) {
console.debug("Found node " + node);
return node;
}
+4 -4
View File
@@ -1,11 +1,11 @@
import { FiberNode, FiberNodeisHTMLLike } from './mocked-types';
function isHtmlLike(node: FiberNode): node is FiberNodeisHTMLLike {
function isNodeHtmlLike(node: FiberNode): node is FiberNodeisHTMLLike {
return (typeof node.type === "string") || node.type === null;
}
function isNotHtmlLike(node: FiberNode): node is Exclude<FiberNode, FiberNodeisHTMLLike> {
return !isHtmlLike(node);
function isNodeNotHtmlLike(node: FiberNode): node is Exclude<FiberNode, FiberNodeisHTMLLike> {
return !isNodeHtmlLike(node);
}
export { isHtmlLike, isNotHtmlLike };
export { isNodeHtmlLike, isNodeNotHtmlLike };