Expand description

serde_json_lodash

A library uses lodash.js style functions to handle serde_json::Value

Usage

#[macro_use] extern crate serde_json_lodash;
use serde_json::json;
fn main() {
  // macro style, optional parameters
  assert_eq!(
    merge!(json!({'a':1}), json!({'b':2}), json!({'c':3})),
    json!({'a': 1, 'b': 2, 'c': 3})
  );

  // fn style, fixed parameters
  use serde_json_lodash::merge;
  assert_eq!(
    merge(json!({'a':1}), json!({'b':2})),
    json!({'a': 1, 'b': 2})
  );

  // `x_`, `_x` helpers for simple types
  assert_eq!(capitalize!(json!("FRED")), json!("Fred"));
  assert_eq!(x_capitalize!("FRED"), json!("Fred"));
  assert_eq!(capitalize_x!(json!("FRED")), "Fred".to_owned());
  assert_eq!(x_capitalize_x!("FRED"), "Fred".to_owned());
}

Re-exports

pub use $crate::head as first;

Modules

Macros

Based on add()

Based on ceil()

Based on chunk()

Based on concat()

Based on drop()

Based on fill()

Based on first()

Based on get()

Based on head()

Based on join()

Based on join_x()

Based on last()

Based on merge()

Based on nth()

Based on pull()

Based on range()

Based on set()

Based on times()

Constants

See lodash VERSION

Functions

See lodash add

See lodash ceil

See lodash chunk

See lodash compact

See lodash concat

See lodash drop

See lodash fill

See lodash head

See lodash flatten

See lodash get

See lodash head

See lodash indexOf

See lodash initial

See lodash join

See lodash last

See lodash merge

See lodash nth

See lodash pull

See lodash pullAll

See lodash pullAt

See lodash range

See lodash set

See lodash stubTrue

See lodash times

See lodash toLower

See lodash toPath

See lodash toString