Skip to content

Commit 68c19a8

Browse files
MattAgnthymikee
authored andcommitted
refactor: extract method filterNodeByType
1 parent 6e38890 commit 68c19a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/helpers/filterNodeByType.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const filterNodeByType = (node, type) => node.type === type;

src/helpers/getByAPI.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22
import * as React from 'react';
33
import prettyFormat from 'pretty-format';
4+
import { filterNodeByType } from './filterNodeByType';
45
import {
56
ErrorWithStack,
67
createLibraryNotSupportedError,
@@ -41,8 +42,6 @@ export type GetByAPI = {|
4142
getAllByPlaceholder: () => void,
4243
|};
4344

44-
const filterNodeByType = (node, type) => node.type === type;
45-
4645
const getNodeByText = (node, text) => {
4746
try {
4847
const { Text } = require('react-native');

0 commit comments

Comments
 (0)