Decapitate "network" plugin
Reviewed By: lawrencelomax Differential Revision: D39466980 fbshipit-source-id: b880690a2b334fd063f2d06923743d67b79e7b08
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cb610ec751
commit
f463520522
@@ -170,6 +170,15 @@ export function bodyAsBinary(
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export const queryToObj = (query: string) => {
|
||||
const params = new URLSearchParams(query);
|
||||
const obj: Record<string, any> = {};
|
||||
params.forEach((value, key) => {
|
||||
obj[key] = value;
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
function escapeCharacter(x: string) {
|
||||
const code = x.charCodeAt(0);
|
||||
return code < 16 ? '\\u0' + code.toString(16) : '\\u' + code.toString(16);
|
||||
|
||||
Reference in New Issue
Block a user