Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function parse (state) {
- if (state.opData.members == undefined) state.opData.members = []
- if (state.opData.groups !== undefined) {
- state.opData.members = state.opData.members.concat(state.opData.groups.map((current, index, arr) => {
- return {type : `group`, value : current}
- }))
- delete state.opData.groups
- }
- if (state.opData.users !== undefined) {
- state.opData.members = state.opData.members.concat(state.opData.users.map((current, index, arr) => {
- return {type : `user`, value : current}
- }))
- delete state.opData.users
- }
- if (state.opData.emails !== undefined) {
- state.opData.members = state.opData.members.concat(state.opData.emails.map((current, index, arr) => {
- return {type : `email`, value : current}
- }))
- delete state.opData.emails
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement