lomit

Lightweight version of Object omit.

Usage no npm install needed!

<script type="module">
  import lomit from 'https://cdn.skypack.dev/lomit';
</script>

README

lomit

npm NPM npm Coveralls github CircleCI Snyk Vulnerabilities for GitHub Repo

Lightweight function for omitting properties from an object.

Install

Via npm

npm install --save lomit

Via Yarn

yarn add lomit

How to use

import { omit } from 'lomit';

omit({name: '', title: ''}, ['title']);
Output: {name: ''}

Deep omits (New!)

import { omit } from 'lomit';

omit({name: '', title: '', location: { city: '', state: '' }}, ['title', 'location.city']);
Output: {name: '', location: { state: '' }}

License

MIT © Ryan Hefner