diff --git a/nodejs/native/Cargo.toml b/nodejs/native/Cargo.toml index f74dd27..74fd4b6 100644 --- a/nodejs/native/Cargo.toml +++ b/nodejs/native/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonpath4nodejs" -version = "0.2.2" +version = "0.2.3" authors = ["Changseok Han "] description = "jsonpath_lib bindings for nodejs" keywords = ["library", "jsonpath", "json", "nodejs"] @@ -17,7 +17,6 @@ neon-build = "0.2.0" jsonpath_lib = "0.2.2" #jsonpath_lib = { path = "../../" } neon = "0.2.0" -neon-serde = "0.1.1" serde_json = { version = "1.0", features = ["preserve_order"] } [lib] diff --git a/nodejs/native/src/lib.rs b/nodejs/native/src/lib.rs index 7a5eed5..7e36356 100644 --- a/nodejs/native/src/lib.rs +++ b/nodejs/native/src/lib.rs @@ -1,27 +1,12 @@ extern crate jsonpath_lib as jsonpath; #[macro_use] extern crate neon; -extern crate neon_serde; extern crate serde_json; use jsonpath::{JsonPathError, Node, Parser, Selector}; use neon::prelude::*; use serde_json::Value; -/// -/// `neon_serde::from_value` has very poor performance. -/// -fn select(mut ctx: FunctionContext) -> JsResult { - let json_val = ctx.argument::(0)?; - let json: Value = neon_serde::from_value(&mut ctx, json_val)?; - let path = ctx.argument::(1)?.value(); - - match jsonpath::select(&json, path.as_str()) { - Ok(value) => Ok(neon_serde::to_value(&mut ctx, &value)?), - Err(e) => panic!("{:?}", e), - } -} - fn select_str(mut ctx: FunctionContext) -> JsResult { let json_val = ctx.argument::(0)?.value(); let path = ctx.argument::(1)?.value(); @@ -276,7 +261,6 @@ register_module!(mut m, { .expect("Selector class error"); m.export_class::("SelectorMut") .expect("SelectorMut class error"); - m.export_function("select", select)?; m.export_function("deleteValue", delete)?; m.export_function("replaceWith", replace_with)?; m.export_function("selectStr", select_str)?; diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 0a4a804..143a7c3 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -1,6 +1,6 @@ { "name": "jsonpath-rs", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/nodejs/package.json b/nodejs/package.json index d5874a4..0132f60 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "jsonpath-rs", - "version": "0.2.2", + "version": "0.2.3", "description": "It is JsonPath implementation. The core implementation is written in Rust", "author": "Changseok Han ", "license": "MIT",