Code Monkey home page Code Monkey logo

lorust's Introduction

Lorust - API Documentation

Lorust is the Rust version of Lodash, which is a modern Javascript utilty library delivering modularity, performance & extras.

Usage

Depend on lorust in Cargo.toml:

[dependencies]
lorust = "0.2.0"

Functions Categorization

We follow the flat function structure of Lodash, but the functions can be categorized into following areas:

Category Description
array Utility functions to deal with Arrays (Not yet support)
collection Utility functions to deal with Collections (Not yet support)
date Utility functions to deal with Dates (Not yet support)
function Utility functions to deal with Functions (Not yet support)
lang Utility functions to deal with Languages (Not yet support)
math Utility functions to deal with Math (Not yet support)
number Utility functions to deal with Numbers (Not yet support)
object Utility functions to deal with Objects (On Progress) ๐Ÿ—๏ธ๐Ÿงฑ๐Ÿ› ๏ธ
seq Utility functions to deal with Sequences (Not yet support)
string Utility functions to deal with Strings (On Progress) ๐Ÿ—๏ธ๐Ÿงฑ๐Ÿ› ๏ธ
util Utility functions to deal with Utilities (Not yet support)
properties Utility functions to deal with Properties (Not yet support)
methods Utility functions to deal with Methods (Not yet support)

Contributing

Git Hooks

We use .githooks to manage git hooks. To enable the git hooks, run:

git config --local core.hooksPath .githooks/

lorust's People

Contributors

imbios avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lorust's Issues

[FEAT]: Add the `number` lodash into this package

Clear and concise description of the problem

Currently, the Lorust library lacks support for utility functions dealing with numbers. This leaves a gap in functionality that could benefit various applications that require mathematical operations, rounding, or other number manipulations.

Suggested solution

  1. Create a new module called number under the src directory.
  2. Implement the most commonly used lodash number utility functions in this module, such as:
    • add
    • ceil
    • floor
    • max
    • min
    • round
    • subtract
  3. Include thorough unit tests to cover all edge cases for each function.
  4. Update the README to indicate that the number category is now supported.

Code Example:

// src/number/mod.rs
pub fn add(a: f64, b: f64) -> f64 {
    a + b
}

pub fn ceil(value: f64, precision: u32) -> f64 {
    // implementation here
}
// ... more functions

Alternative

An alternative approach would be to introduce these functions incrementally in smaller batches, prioritizing the most commonly used or requested ones first.

Additional context

Having a number category that mimics lodash's number utilities would provide a more complete utility experience in Rust, thereby possibly attracting more developers to adopt Lorust in their projects. This would align well with the library's goal of being the Rust version of Lodash.

Validations

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

cargo
Cargo.toml
  • serde_json 1.0.106
  • regex 1.9.5
  • unicode-normalization 0.1.22
  • log 0.4.20
github-actions
.github/workflows/ci.yml
  • actions/checkout v4

  • Check this box to trigger a request for Renovate to run again on this repository

[FEAT]: Add the `string` category from lodash into this package

Clear and concise description of the problem

The current implementation of Lorust lacks utility functions related to string manipulation. This omission limits the library's usability for string processing tasks, common in many software projects.

Suggested solution

  1. Create a new module named string under the src directory.
  2. Implement the most frequently used lodash string utility functions within this module, such as:
    • camelCase
    • capitalize
    • endsWith
    • startsWith
    • trim
    • toLower
    • toUpper
  3. Add comprehensive unit tests for each function to ensure correctness.
  4. Update the README file to indicate that the string category is now supported, and perhaps include a few code examples.

Code Example:

// src/string/mod.rs
pub fn camel_case(s: &str) -> String {
    // implementation here
}

pub fn capitalize(s: &str) -> String {
    // implementation here
}
// ... more functions

Alternative

A phased approach could be adopted, where the functions are implemented and released in smaller groups. This would allow for quicker initial releases and can be prioritized based on community feedback or the most common use cases.

Additional context

Adding a string module with utility functions similar to those in lodash's string category would enhance Lorust's overall functionality. This addition would make the library more appealing to Rust developers who have tasks related to string manipulation and may result in increased adoption of Lorust.

Validations

[FEAT]: Add the `date` category from lodash into this package

Clear and concise description of the problem

The Lorust library currently does not offer date manipulation or formatting utility functions. This omission makes the library less versatile for users who frequently use date and time in their applications.

Suggested solution

  1. Create a new date module under the src directory.
  2. Implement a selection of the most commonly used date utility functions similar to those available in lodash, such as:
    • isAfter
    • isBefore
    • isSame
    • toDate
    • addDays
    • subDays
  3. Include comprehensive unit tests for each newly implemented function to cover a range of scenarios.
  4. Update the README file to reflect the addition of the date category, providing usage examples if possible.

Code Example:

// src/date/mod.rs
use chrono::{DateTime, Utc};

pub fn is_after(a: DateTime<Utc>, b: DateTime<Utc>) -> bool {
    // implementation here
}

pub fn is_before(a: DateTime<Utc>, b: DateTime<Utc>) -> bool {
    // implementation here
}
// ... more functions

Alternative

As an alternative, we could initially focus on a smaller set of critical date functions, releasing them as a subset of the full date module. Additional functions could be added over time based on user feedback and needs.

Additional context

The inclusion of a date module would significantly expand Lorust's utility, making it a more comprehensive tool for Rust developers. This feature could encourage the adoption of Lorust for projects that require date manipulation, thus contributing to the library's goal to be a complete utility library for Rust.

Validations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.