MCPcopy
hub / github.com/nygardk/react-share / objectToGetParams

Function objectToGetParams

src/utils/objectToGetParams.ts:1–9  ·  view source on GitHub ↗
(object: {
  [key: string]: string | number | undefined | null;
})

Source from the content-addressed store, hash-verified

1export default function objectToGetParams(object: {
2 [key: string]: string | number | undefined | null;
3}) {
4 const params = Object.entries(object)
5 .filter(([, value]) => value !== undefined && value !== null)
6 .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
7
8 return params.length > 0 ? `?${params.join('&')}` : '';
9}

Callers 15

Utilities.test.tsFile · 0.85
vkLinkFunction · 0.85
telegramLinkFunction · 0.85
getVKShareCountFunction · 0.85
weiboLinkFunction · 0.85
whatsappLinkFunction · 0.85
workplaceLinkFunction · 0.85
okLinkFunction · 0.85
getHatenaShareCountFunction · 0.85
lineLinkFunction · 0.85
facebookLinkFunction · 0.85
threadsLinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…