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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
//! # serde_json_lodash
//!
//! A library uses [lodash.js](https://lodash.com/docs) style functions to handle [serde_json::Value](https://docs.serde.rs/serde_json/value/enum.Value.html)
//!
//! ## Usage
//!
//! ```rust
//! #[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());
//! }
//! ```
#![deny(missing_docs)]
#![deny(warnings)]
#[cfg(feature = "camel")]
extern crate paste;
#[cfg(feature = "lazy_static")]
extern crate lazy_static;
mod macros;
///
pub mod lib {
pub use serde_json::{json, Value, Map, Number};
}
#[doc(hidden)]
pub mod internal;
mod array;
mod collection;
mod date;
mod function;
mod lang;
mod math;
mod number;
mod object;
mod seq;
mod string;
mod util;
mod properties;
mod methods;
mod lib_snake;
pub use lib_snake::*;
#[cfg(feature = "camel")]
mod lib_camel;
#[cfg(feature = "camel")]
pub use lib_camel::*;