Skip to content

Preserve explicit false/0 query values in toQueryParams (fixes getImages svg_outline_text=false)#108

Merged
didoo merged 4 commits intomainfrom
copilot/fix-svg-outline-text-parameter
Apr 22, 2026
Merged

Preserve explicit false/0 query values in toQueryParams (fixes getImages svg_outline_text=false)#108
didoo merged 4 commits intomainfrom
copilot/fix-svg-outline-text-parameter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

getImages requests were dropping svg_outline_text=false because query serialization filtered values using truthiness. This caused explicit boolean/number flags to be omitted from outbound Figma API URLs.

  • Query serialization behavior

    • Updated toQueryParams to retain explicit false and 0 values.
    • Serialization now excludes only undefined, null, empty-string values, and empty keys.
  • Endpoint-level regression coverage

    • Added a getImagesApi test asserting svg_outline_text=false is preserved in the generated URL.
  • Utility-level regression coverage

    • Updated boolean serialization expectations to include disabled=false.
    • Added explicit test coverage for { svg_outline_text: false, scale: 0 }.
// before
k && v && `${k}=${encodeURIComponent(v as any)}`

// after
k && v !== undefined && v !== null && v !== '' &&
`${k}=${encodeURIComponent(v as any)}`

Copilot AI changed the title [WIP] Fix removal of svg_outline_text parameter in getImages query Preserve explicit false/0 query values in toQueryParams (fixes getImages svg_outline_text=false) Apr 22, 2026
Copilot AI requested a review from didoo April 22, 2026 11:07
Comment thread src/utils.ts
Copilot AI requested a review from didoo April 22, 2026 11:21
@didoo
Copy link
Copy Markdown
Owner

didoo commented Apr 22, 2026

@copilot can you remove the files under the lib/ folder? these are the compiled files, and will be added (rebuilt) before the new version release

@didoo didoo marked this pull request as ready for review April 22, 2026 11:35
Comment thread lib/figma-api.min.js
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you remove the files under the lib/ folder from this PR? these are the compiled files, and will be added (rebuilt) before the new version release in separate commits

@didoo didoo merged commit fbe1a05 into main Apr 22, 2026
@didoo didoo deleted the copilot/fix-svg-outline-text-parameter branch April 22, 2026 11:40
Copilot stopped work on behalf of didoo due to an error April 22, 2026 11:40
Copilot AI requested a review from didoo April 22, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getImages: svg_outline_text=false is removed from query parameters

2 participants