MCPcopy Index your code
hub / github.com/figma/plugin-samples / createAPIUrl

Function createAPIUrl

trivia/code.ts:109–118  ·  view source on GitHub ↗
(parameters: TriviaParameters)

Source from the content-addressed store, hash-verified

107}
108
109function createAPIUrl(parameters: TriviaParameters): string {
110 const { number, category, difficulty, type } = parameters;
111 let url = "https://opentdb.com/api.php?";
112 url += number ? `amount=${number}&` : `amount=10&`;
113 url += category ? `category=${category}&` : "";
114 url += difficulty ? `difficulty=${difficulty}&` : "";
115 url += type ? `type=${type}` : "";
116
117 return url;
118}
119
120async function startUI() {
121 figma.showUI(__html__, { visible: false });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected