An open API service indexing awesome lists of open source software.

https://github.com/jhonnymoreira/obbie

Ruby Hash methods in JavaScript as a collection of functions.
https://github.com/jhonnymoreira/obbie

hash javascript javascript-library ruby ruby-hash-methods

Last synced: 2 months ago
JSON representation

Ruby Hash methods in JavaScript as a collection of functions.

Awesome Lists containing this project

README

          

# Obbie
[![Build Status](https://travis-ci.org/jhonnymoreira/obbie.svg?branch=master)](https://travis-ci.org/jhonnymoreira/obbie)
[![Coverage Status](https://coveralls.io/repos/github/jhonnymoreira/obbie/badge.svg?branch=master)](https://coveralls.io/github/jhonnymoreira/obbie?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/jhonnymoreira/obbie.svg)](https://greenkeeper.io/)

Obbie aims to make available Ruby's Hash methods to JavaScript as a collection of functions.

**Note:** All functions won't mutate the object passed as argument. Methods such `delete_if`, which mutates the given object in Ruby, won't have mutation here in JavaScript.

## Installation

`npm install obbie`

or

`yarn install obbie`

## Usage

```javascript
import { deleteIf } from 'obbie'

const myObject = { a: 1, b: 2, c: 3 }
const oddValues = deleteIf(
myObject,
(_, value) => (value % 2) === 0
) //=> { a: 1, c: 3 }
```

## API

All the available functions and its usage can be found [here](./docs/api.md).

## License

MIT License

Copyright (c) 2017 Jhonny Moreira