mergeOptionsToData.js 371 B

123456789101112131415161718
  1. /**
  2. * 过滤对象的函数属性
  3. * @param {Object} opts
  4. */
  5. const mergeOptionsToData = (opts = {}) => {
  6. const options = Object.assign({}, opts)
  7. for (const key in options) {
  8. if (options.hasOwnProperty(key) && typeof options[key] === 'function') {
  9. delete options[key]
  10. }
  11. }
  12. return options
  13. }
  14. export default mergeOptionsToData