Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[typescript-fetch] update samples
  • Loading branch information
mkusaka committed Apr 9, 2022
commit a2dc7db52155c813c5b7fbc07280d2c9fb4ad227
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@ export interface RequestOpts {
body?: HTTPBody;
}

export function exists(json: any, key: string) {
const value = json[key];
return value !== null && value !== undefined;
}

export function querystring(params: HTTPQuery, prefix: string = ''): string {
return Object.keys(params)
Expand All @@ -249,12 +245,6 @@ export function querystring(params: HTTPQuery, prefix: string = ''): string {
.join('&');
}

export function mapValues(data: any, fn: (item: any) => any) {
return Object.keys(data).reduce(
(acc, key) => ({ ...acc, [key]: fn(data[key]) }),
{}
);
}

export function canConsumeForm(consumes: Consume[]): boolean {
for (const consume of consumes) {
Expand Down