Skip to content

Commit

Permalink
fix: Add theme to compressParams (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnBrosens committed Aug 16, 2020
1 parent 0e38f95 commit 2f2dfb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions utils/index.d.ts
Expand Up @@ -12,6 +12,7 @@ interface CompressParamsOptions {
code?: string;
themes?: string[];
widths?: number[];
theme?: string;
}
export const compressParams: (options: CompressParamsOptions) => string;

Expand Down
3 changes: 2 additions & 1 deletion utils/index.js
@@ -1,10 +1,11 @@
const lzString = require('lz-string');

const compressParams = ({ code, themes, widths }) => {
const compressParams = ({ code, themes, widths, theme }) => {
const data = JSON.stringify({
...(code ? { code } : {}),
...(themes ? { themes } : {}),
...(widths ? { widths } : {}),
...(theme ? { theme } : {}),
});

return lzString.compressToEncodedURIComponent(data);
Expand Down

0 comments on commit 2f2dfb7

Please sign in to comment.