1.0.0 • Published 10 years ago
has-directory-upload v1.0.0
has-directory-upload
Detect if either either Web Incubator Community Group or Chrome 11-style directory uploads are supported in your current environment
Example implementation
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
1.0.0
10 years ago