title: How to get the image type from image url in react.js
body: <p>I am trying to yup validate the image URL and want to check the image type. How can I do so?</p>
  <p>Suppose this the image URL :&quot;https://static.wayup.com/company_logo/95tJHraryb_20171220.png&quot;</p>
  <p>These are the supported format</p>
  <pre><code>const SUPPORTED_FORMATS = [&quot;image/jpg&quot;, &quot;image/jpeg&quot;, &quot;image/png&quot;];
  </code></pre>
  <p>This is the validation am trying to do for the image</p>
  <pre><code>image: Yup.mixed()
      .required(&quot;Please select Image&quot;)
      .test(&quot;fileFormat&quot;, &quot;Unsupported Format&quot;, (value) =&gt; {
        How do i get the image type from the URL?
      }),
  
  
    [1]: https://static.wayup.com/company_logo/95tJHraryb_20171220.png
  </code></pre>