forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
25 lines (21 loc) · 768 Bytes
/
mod.rs
File metadata and controls
25 lines (21 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use napi::{CallContext, JsObject, JsUnknown};
use napi_derive::{js_function, module_exports};
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[js_function(1)]
fn transform(ctx: CallContext) -> napi::Result<JsUnknown> {
lightningcss_napi::transform(ctx)
}
#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[js_function(1)]
fn transform_style_attribute(ctx: CallContext) -> napi::Result<JsUnknown> {
lightningcss_napi::transform_style_attribute(ctx)
}
#[cfg_attr(not(target_arch = "wasm32"), module_exports)]
fn init(mut exports: JsObject) -> napi::Result<()> {
exports.create_named_method("lightningCssTransform", transform)?;
exports.create_named_method(
"lightningCssTransformStyleAttribute",
transform_style_attribute,
)?;
Ok(())
}