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§

camel_case
Converts String to camel case.
capitalize
Converts the first character of String to upper case and the remaining to lower case.
difference
Creates an array of array values not included in the other given arrays using SameValueZero
drop
Creates a slice of array with n elements dropped from the beginning.
drop_right
Creates a slice of array with n elements dropped from the end.
drop_right_while
Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate returns falsy.
drop_while
Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsy.
every
Checks if predicate returns truthy for all elements of array Iteration is stopped once predicate returns falsy. The predicate is Note: This method returns true for empty vector because everything is true of elements of empty vector.
every_value
Checks if predicate returns truthy for all properties of HashMap. Iteration is stopped once predicate returns falsy. The predicate is
filter
Iterates over elements of array, returning an array of all elements predicate returns truthy for.
find_key
This method is like find except that it returns the key of the first element predicate returns truthy for instead of the element itself.
find_last
This method is like find except that it iterates over elements of collection from right to left.
find_last_index
This method is like findIndex except that it iterates over elements of collection from right to left.
kebab_case
Converts String to kebab case. This method is like find except that it iterates over elements of collection from right to left.
lower_case
Converts string, as space separated words, to lower case.
snake_case
Converts String to snake case.
start_case
Converts String to start case.
upper_case
Converts string, as space separated words, to upper case.
upper_first
Converts the first character of string to upper case.