This package helps you work with objects in your project, making it very easy to convert object to array and manipulate it
Add Object-To-Array-Convert to your project by executing
$ npm install object-to-array-convert
or
$ yarn add object-to-array-convert
and that's it, you're all good to go!
//import the O2A into your project
import firebase from "firebase";
import { O2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = O2A(data);
return value;
})
#
//import the O2A into your project
import firebase from "firebase";
import { O2A, ReverseO2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = ReverseO2A(O2A(data));
return value;
})
#
//import the O2A into your project
import firebase from "firebase";
import { O2A, FirstO2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = FirstO2A(O2A(data));
return value;
})
#
//import the O2A into your project
import firebase from "firebase";
import { O2A, LastO2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = LastO2A(O2A(data));
return value;
})
#
//import the O2A into your project
import firebase from "firebase";
import { O2A, GetNO2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = GetNO2A(O2A(data), 3);
return value;
})
#
//import the O2A into your project
import firebase from "firebase";
import { O2A, CountO2A } from 'object-to-array-convert';
//and then use like so
firebase.database().ref("/user/").on('value', (data) => {
const value = CountO2A(O2A(data));
return value;
})
Name | Use |
---|---|
O2A(data) | to convert object to array |
ReverseO2A(data) | Reverse the item in an array |
FirstO2A(data) | Get first item in an array |
LastO2A(data) | Get last item in an array |
GetNO2A(data, number) | Get n amount of items in an array |
CountO2A(data) | Get total amount of items in an array |
#
What to help make this package even more awesome? Read how to contribute
This project is licensed under MIT license.
Thanks goes to these wonderful people (emoji key):
Oluwatobi Shokunbi 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!