mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* feat(init): added EditorPanel with prettier, copy and settings support * chore(static): ignore static * feat: added navigator * feat: * feat(settings): added sessionStorage support for settings * feat(message): add messaging support in editors * feat(preview): added support for preview panel * fix(settings): use localstorage for settings instead of session storage * feat: * feat(css-to-js): implemented React section * feat(schema): add json to schema conversions * feat(others): implemented xml, yaml and markdown conversions * feat(babel): added flow to typescript converter * feat(graphql): implemented graphql to typescript * feat(graphql): added some transformations * fix: add support for different default value in one language * feat(graphql): added components, resolver signatures and mongodb * feat: * scala case class * fix(memory): worker-loader patch applied to fix memory overflow crash * feat: added json schema to typescript * icon: <GraphQLIcon />, * feat(navigator): shorter naming and new categories * route fixes * navigator * perf(workers): create separate file and remove fallback * fix(navigator): completed * build(snack): * fixes * fixes * fix(safari): * added json-to-mobx-state tree * fix(native): snacksession * fixes * added logo * navigator * fixes * custom header * fixes * refactor(settings): move settings to left side * feat: set up redirects * feat(seo): added title and description * feat(error): added custom error page * ga-script * feat: * fixes * fixe * fixes * fixes * fix:
26 lines
465 B
TypeScript
26 lines
465 B
TypeScript
import convert from "@svgr/core/lib/convert";
|
|
|
|
const _self: any = self;
|
|
|
|
_self.onmessage = async ({ data: { payload, id } }) => {
|
|
const { value, native } = payload;
|
|
|
|
try {
|
|
const result = await convert(value, {
|
|
plugins: [require("@svgr/plugin-jsx").default],
|
|
svgo: false,
|
|
native
|
|
});
|
|
|
|
_self.postMessage({
|
|
payload: result,
|
|
id
|
|
});
|
|
} catch (e) {
|
|
_self.postMessage({
|
|
id,
|
|
error: e.message
|
|
});
|
|
}
|
|
};
|