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§
- camel_
case - Converts
Stringto camel case. - capitalize
- Converts the first character of
Stringto upper case and the remaining to lower case. - difference
- Creates an array of
arrayvalues not included in the other given arrays usingSameValueZero - drop
- Creates a slice of
arraywithnelements dropped from the beginning. - drop_
right - Creates a slice of
arraywithnelements dropped from the end. - drop_
right_ while - Creates a slice of
arrayexcluding elements dropped from the end. Elements are dropped untilpredicatereturns falsy. - drop_
while - Creates a slice of
arrayexcluding elements dropped from the beginning. Elements are dropped untilpredicatereturns falsy. - every
- Checks if
predicatereturns truthy for all elements ofarrayIteration is stopped oncepredicatereturns falsy. The predicate is Note: This method returnstruefor empty vector because everything is true of elements of empty vector. - every_
value - Checks if
predicatereturns truthy for all properties ofHashMap. Iteration is stopped oncepredicatereturns falsy. The predicate is - filter
- Iterates over elements of
array, returning an array of all elementspredicatereturns truthy for. - find_
key - This method is like
findexcept that it returns the key of the first elementpredicatereturns truthy for instead of the element itself. - find_
last - This method is like
findexcept that it iterates over elements ofcollectionfrom right to left. - find_
last_ index - This method is like
findIndexexcept that it iterates over elements ofcollectionfrom right to left. - kebab_
case - Converts
Stringto kebab case. This method is likefindexcept that it iterates over elements ofcollectionfrom right to left. - lower_
case - Converts
string, as space separated words, to lower case. - snake_
case - Converts
Stringto snake case. - start_
case - Converts
Stringto start case. - upper_
case - Converts
string, as space separated words, to upper case. - upper_
first - Converts the first character of
stringto upper case.