mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
feat(js): new glue hash function
This commit is contained in:
parent
fc9247c5a8
commit
4a701818f2
4 changed files with 12 additions and 2 deletions
2
dist/js/build.sh
vendored
2
dist/js/build.sh
vendored
|
@ -1 +1 @@
|
|||
npx napi build --release --cargo-cwd ../..
|
||||
npx napi build --cargo-cwd ../..
|
2
dist/js/package.json
vendored
2
dist/js/package.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@codemp/codemp",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.9-debug",
|
||||
|
||||
"dependencies": {
|
||||
"@napi-rs/cli": "^2.18.0",
|
||||
|
|
8
src/ffi/js/ext.rs
Normal file
8
src/ffi/js/ext.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
use napi_derive::napi;
|
||||
use crate::hash;
|
||||
|
||||
|
||||
#[napi(js_name = "hash")]
|
||||
pub fn js_hash(str : String) -> napi::Result<i64>{
|
||||
Ok(hash(str))
|
||||
}
|
|
@ -3,6 +3,8 @@ pub mod workspace;
|
|||
pub mod cursor;
|
||||
pub mod buffer;
|
||||
pub mod op_cache;
|
||||
pub mod ext;
|
||||
|
||||
|
||||
impl From<crate::Error> for napi::Error {
|
||||
fn from(value: crate::Error) -> Self {
|
||||
|
|
Loading…
Reference in a new issue