serdejsonlodash

Documentation build status Downloads

serde_json::Value with lodash.js spec, makes life easier.

Usage

Cargo.toml

toml [dependencies] serde_json_lodash = "0.1"

main.rs

```rust

[macrouse] extern crate serdejson_lodash;

use serdejson::json; fn main() { // macro style, optional parameters asserteq!( merge!(json!({'a':1}), json!({'b':2}), json!({'c':3})), json!({'a': 1, 'b': 2, 'c': 3}) );

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

// x_, _x helpers for simple types asserteq!(capitalize!(json!("FRED")), json!("Fred")); asserteq!(xcapitalize!("FRED"), json!("Fred")); asserteq!(capitalizex!(json!("FRED")), "Fred".toowned()); asserteq!(xcapitalizex!("FRED"), "Fred".toowned()); } ```

Concepts

All implements should be same as lodash as possible

How?

Dev memo

```bash

Up

./dev.sh

Watch and test single file

./dev.sh --doc set

Lint

./lint.sh

Preview doc

cargo doc --open

Bump patch version and push

./bump_push.sh ```

Check lodash.js api

```console $ npm i $ node Welcome to Node.js v15.14.0. Type ".help" for more information.

const l = require('lodash') undefined l.toString() ''

```