Last active
March 31, 2018 10:16
-
-
Save max-berman/31a56fa78374cb0fee2a33d67add751d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UnlinkRequest ({ | |
custom, | |
device, | |
facebook, | |
google, | |
} = {}) { | |
function build_ () { | |
if (custom) return { link: { custom } } // Should return { unlink: { custom } } instead | |
if (device) return { link: { device } } // Should return { unlink: { device } } instead | |
if (facebook) return { link: { facebook } } // Should return { unlink: { facebook } } instead | |
if (google) return { link: { google } } // Should return { unlink: { google } } instead | |
if (email) return { link: { email } } // Should return { unlink: { email } } instead | |
} | |
return { | |
get custom () { | |
return custom | |
}, | |
set custom (val) { | |
custom = val | |
}, | |
get device () { | |
return device | |
}, | |
set device (val) { | |
device = val | |
}, | |
get facebook () { | |
return facebook | |
}, | |
set facebook (val) { | |
facebook = val | |
}, | |
get google () { | |
return google | |
}, | |
set google (val) { | |
google = val | |
}, | |
get email () { | |
return email | |
}, | |
set email (val) { | |
email = val | |
}, | |
build_ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment