✨ Library to commonly used cross-projects utilities methods ✨
npm install @teteu/utils --save
const utils = require('@teteu/utils');
utils.random(10, 20); // should return a random number between 10 and 20
Feel free to contribute. Check if we have open issues or request your utility method. Your code here is very welcome 🤝🤝
Method | What It Does | Parameters | Return |
---|---|---|---|
uniqueElements | Returns an array with unique elements | (array: any[]) | {any[]} |
groupBy | Returns an array grouped by the given key | (array: T[], key: keyof T) | {Record<string, T[]>} |