Git Product home page Git Product logo

tiinvo's Introduction

tiinvo

An opinionated lib of types and utilities for your TypeScript and JavaScript projects which aims to add missing functionalities to standard Js and replace other.

docs

Install

You can install it using npm

npm i tiinvo

Or with yarn

yarn add tiinvo

or if you are using Deno, you have to simply import it

import { Arr, Option, Result } from 'https://cdn.skypack.dev/tiinvo?dts';

Features

This library is

  • Simple
  • Intuitive
  • Lightweight
  • Pragmatic
  • Safe
  • Side-effect free and fully tree-shakeable
  • Versatile
  • Battle-tested (used in dozens of production projects)
  • Well-documented (every type, function and function overload is documented properly)
  • Well-maintained
  • Well-tested

This library is ideal for both an imperative and declarative approach, since every function is overloaded and can be used without the need to use curry (I love it for cooking, not for coding).

It normalizes several native JavaScript methods (like string, number and array).

Usage

This library provides several new data types like

  • DateRange which is a reliable way to generate date ranges.
  • Option which handles gracefully values which could be both null or undefined.
  • Predicate are used to determine truthyness.
  • Range is used to generate a numeric range.
  • Result handles errors gracefully.
  • Sequence is an immutable sequence of elements.
  • SortedSequence is a sorted immutable sequence of elements.
  • Tuple is a tuple.
  • TypedMap is a typed immutable Map of elements.
  • TypedSequence is a typed immutable sequence of elements.

wraps native types

  • Arr handles all array methods, adding new ones.
  • BigInt handles all bigint methods, adding new ones.
  • Bool handles all boolean methods, adding new ones.
  • Fn handles all function methods, adding new ones.
  • Num handles all number methods, adding new ones.
  • Obj handles all object methods, adding new ones.
  • Str handles all string methods, adding new ones.

and adds utility functions

  • Assert used to create assertions.
  • Catch used to catch gracefully functions which could throw an error.
  • Pipe concatenates many unary functions in one, great for function composition.

Contributing

Every contribution is really welcome!

If you feel that something can be improved or should be fixed, feel free to open an issue with the feature or the bug found.

Pull requests are really welcome!

  • Create a new branch from main
  • open your PR
  • enjoy!

Read the contributing guidelines

Licence

Read the licence

tiinvo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mrvicadai

tiinvo's Issues

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.