Created
December 2, 2017 00:09
-
-
Save jasongonzales23/47ff86f46fee93f06fe5136453a4fcde 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
export function parseParams(params) { | |
if (!params) { | |
return undefined | |
} | |
if (params['~id']) { | |
// it's a branch link, already parsed | |
return params | |
} | |
// parse whilapp:// link | |
const urlString = params['+non_branch_link'] || params['~referring_link'] | |
if (!urlString) { | |
return undefined | |
} | |
const url = new URL(urlString) | |
const qs = url.query | |
return queryString.parse(qs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment