move urlSearchParamsToObject and global.d.ts to react-sdk

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-13 21:23:40 +01:00
parent c000583099
commit 466ecf191a
4 changed files with 42 additions and 1 deletions

View file

@ -14,7 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import url from "url";
import * as url from "url";
export function urlSearchParamsToObject<T extends {}>(params: URLSearchParams) {
return <T>Object.fromEntries([...params.entries()]);
}
/**
* If a url has no path component, etc. abbreviate it to just the hostname