You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getDefaultContext.js 314B

1 year ago
123456789101112
  1. export function getDefaultContext (props, fields) {
  2. const clone = {}
  3. if (Array.isArray(fields)) {
  4. fields.forEach((key) => {
  5. const prop = props[key]
  6. clone[key] = typeof prop === 'object'
  7. ? prop.value
  8. : prop
  9. })
  10. }
  11. return clone
  12. }