Detect if either either Web Incubator Community Group or Chrome 11-style directory uploads are supported in your current environment
import HDU from 'has-directory-upload'
let uploadStrategy = null
if (HDU.WICGSupport)
uploadStrategy = someWICGStrategy(HDU.WICGSupport.live)
else if (HDU.Chrome11Support)
uploadStrategy = someChrome11Strategy(HDU.Chrome11Support.live)
else
uploadStrategy = someNonDirectoryAlternativeStrategy(e => !!e.files)
has-directory-upload
provides both up-front feature detection and off the cuff checking of Event
instances. In the above example implementation the Event
instance checkers are being passed to the imagined Strategy functions