mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-02 16:15:57 +09:00
4b6c113251
* Update string.ts * Refactor * Update string.ts * Update wrap-url.ts * Update string.ts * Update get-static-image-url.ts * Use querystring.stringify * Update outbox.ts * Back to the urlQuery * Update followers.ts * Update following.ts * Update outbox.ts * Update string.ts * Update get-static-image-url.ts * Update string.ts * Update string.ts * Separate prelude files
8 lines
260 B
TypeScript
8 lines
260 B
TypeScript
import { stringify } from 'querystring';
|
|
|
|
export function query(obj: {}): string {
|
|
return stringify(Object.entries(obj)
|
|
.filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined)
|
|
.reduce((a, [k, v]) => (a[k] = v, a), {} as Record<string, any>));
|
|
}
|