diff --git a/src/utils/childrenIsAnImage.ts b/src/utils/childrenIsAnImage.ts new file mode 100644 index 0000000000..ca884100da --- /dev/null +++ b/src/utils/childrenIsAnImage.ts @@ -0,0 +1,3 @@ +export const childrenIsAnImage = (children: any) => { + return typeof children[0] === 'object' && children[0].props.hasOwnProperty('src'); +}; diff --git a/src/utils/index.ts b/src/utils/index.ts index 4133683a06..8dcb56e76b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,5 @@ export { checkNavLinks } from './checkNavLinks'; +export { childrenIsAnImage } from './childrenIsAnImage'; export { compareReleasesFn } from './compareReleasesFn'; export { fetchLatestReleaseCommit } from './fetchLatestReleaseCommit'; export { fetchLatestReleaseVersionAndName } from './fetchLatestReleaseVersionAndName';