Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanhefner/lomit
🪶 Lightweight object omit method, just because.
https://github.com/ryanhefner/lomit
object omit utility utility-function
Last synced: 21 days ago
JSON representation
🪶 Lightweight object omit method, just because.
- Host: GitHub
- URL: https://github.com/ryanhefner/lomit
- Owner: ryanhefner
- License: mit
- Created: 2017-09-14T03:22:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-04T06:49:23.000Z (almost 4 years ago)
- Last Synced: 2024-10-05T18:17:04.015Z (about 1 month ago)
- Topics: object, omit, utility, utility-function
- Language: JavaScript
- Homepage: https://www.pkgstats.com/pkg:lomit
- Size: 1.81 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# lomit
[![npm](https://img.shields.io/npm/v/lomit?style=flat-square)](https://github.com/ryanhefner/lomit)
[![NPM](https://img.shields.io/npm/l/lomit?style=flat-square)](LICENSE)
[![npm](https://img.shields.io/npm/dt/lomit?style=flat-square)](https://www.npmjs.com/package/lomit)
![Coveralls github](https://img.shields.io/coveralls/github/ryanhefner/lomit?style=flat-square)
![CircleCI](https://img.shields.io/circleci/build/github/ryanhefner/lomit?style=flat-square)
![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/ryanhefner/lomit?style=flat-square)Lightweight function for omitting properties from an object.
## Install
Via [npm](https://npmjs.com/package/lomit)
```sh
npm install --save lomit
```Via [Yarn](https://yarnpkg.com/package/lomit)
```sh
yarn add lomit
```## How to use
```js
import { omit } from 'lomit';omit({name: '', title: ''}, ['title']);
``````sh
Output: {name: ''}
```### Deep omits (*__New!__*)
```js
import { omit } from 'lomit';omit({name: '', title: '', location: { city: '', state: '' }}, ['title', 'location.city']);
``````sh
Output: {name: '', location: { state: '' }}
```## License
[MIT](LICENSE) © [Ryan Hefner](https://www.ryanhefner.com)