Skip to content

Commit

Permalink
chore: fix figma import params
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberalien committed Sep 26, 2024
1 parent 41eae45 commit 42a6b8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion @iconify/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
"author": "Vjacheslav Trushkin",
"version": "4.0.6",
"version": "4.0.7",
"license": "MIT",
"bugs": "https://github.com/iconify/tools/issues",
"homepage": "https://github.com/iconify/tools",
Expand Down
25 changes: 14 additions & 11 deletions @iconify/tools/src/import/figma/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type FigmaConcurrentQueriesParamsFunction =
| 'figmaDownloadImages';

export interface FigmaConcurrentQueriesParams<
T extends FigmaConcurrentQueriesParamsFunction
T extends FigmaConcurrentQueriesParamsFunction,
> {
// Function that is called
function: T;
Expand All @@ -62,7 +62,7 @@ function identicalDates(actual: unknown, expected: string | Date): boolean {
* Get Figma files
*/
export async function figmaFilesQuery<
T extends FigmaIfModifiedSinceOption & FigmaFilesQueryOptions
T extends FigmaIfModifiedSinceOption & FigmaFilesQueryOptions,
>(
options: T,
cache?: APICacheOptions
Expand Down Expand Up @@ -217,15 +217,18 @@ export async function figmaImagesQuery(
if (options.version) {
params.set('version', options.version);
}
if (svgOptions.includeID) {
params.set('svg_include_id', 'true');
}
if (svgOptions.simplifyStroke) {
params.set('svg_simplify_stroke', 'true');
}
if (svgOptions.useAbsoluteBounds) {
params.set('use_absolute_bounds', 'true');
}
params.set(
'svg_include_id',
svgOptions.includeID ? 'true' : 'false'
);
params.set(
'svg_simplify_stroke',
svgOptions.simplifyStroke ? 'true' : 'false'
);
params.set(
'use_absolute_bounds',
svgOptions.useAbsoluteBounds ? 'true' : 'false'
);

sendAPIQuery(
{
Expand Down

0 comments on commit 42a6b8c

Please sign in to comment.