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.
npm install obbie
or
yarn install obbie
import { deleteIf } from 'obbie'
const myObject = { a: 1, b: 2, c: 3 }
const oddValues = deleteIf(
myObject,
(_, value) => (value % 2) === 0
) //=> { a: 1, c: 3 }
All the available functions and its usage can be found here.
MIT License
Copyright (c) 2017 Jhonny Moreira