Crate lodash_rust
source ·Expand description
A library for javascript lodash methods in rustlang
This library methods is meant to give the same output as their equivalent in javascript, if you notice any bugs or differences please on an issue.
Usage
First, add this to your Cargo.toml
[dependencies]
lodash_rust = "0.1.0"
Next:
use lodash_rust::capitalize;
fn main() {
let greet = String::from("hello world");
let res = capitalize::new(greet);
println!("{res}") // Hello world
}
Modules
- Converts
String
to camel case. - Converts the first character of
String
to upper case and the remaining to lower case. - Creates an array of
array
values not included in the other given arrays usingSameValueZero
- Creates a slice of
array
withn
elements dropped from the beginning. - Creates a slice of
array
withn
elements dropped from the end. - Creates a slice of
array
excluding elements dropped from the end. Elements are dropped untilpredicate
returns falsy. - Creates a slice of
array
excluding elements dropped from the beginning. Elements are dropped untilpredicate
returns falsy. - Checks if
predicate
returns truthy for all elements ofarray
Iteration is stopped oncepredicate
returns falsy. The predicate is Note: This method returnstrue
for empty vector because everything is true of elements of empty vector. - Iterates over elements of
array
, returning an array of all elementspredicate
returns truthy for. - This method is like
find
except that it iterates over elements ofcollection
from right to left. - Converts
String
to kebab case. This method is likefind
except that it iterates over elements ofcollection
from right to left. - Converts
String
to snake case. - Converts
String
to start case.