isFormData.js 361 B

123456789101112131415
  1. /* eslint-disable valid-typeof */
  2. var staticStrUndefined = require('./staticStrUndefined')
  3. /**
  4. * 判断是否FormData对象
  5. *
  6. * @param {Object} obj 对象
  7. * @return {Boolean}
  8. */
  9. var supportFormData = typeof FormData !== staticStrUndefined
  10. function isFormData (obj) {
  11. return supportFormData && obj instanceof FormData
  12. }
  13. module.exports = isFormData