mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* upgrade dependencies * upgrade dependencies * format code * update nextjs * fixes * chore: update graphql generator * fixes * fixes * fixes
21 lines
382 B
TypeScript
21 lines
382 B
TypeScript
import postcssJs from "postcss-js";
|
|
import postcss from "postcss";
|
|
|
|
const _self: any = self;
|
|
|
|
_self.onmessage = ({ data: { payload, id } }) => {
|
|
try {
|
|
const root = postcss.parse(payload);
|
|
|
|
_self.postMessage({
|
|
id,
|
|
payload: JSON.stringify(postcssJs.objectify(root)),
|
|
});
|
|
} catch (e) {
|
|
_self.postMessage({
|
|
id,
|
|
err: e.message,
|
|
});
|
|
}
|
|
};
|