Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

groom

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

groom - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

.travis.yml

6

package.json
{
"name": "groom",
"version": "1.1.0",
"description": "JSON.parse(JSON.stringify(myObject)) and remove all nulls and empty strings",
"version": "1.1.1",
"description": "JSON.parse(JSON.stringify(myObject)) and remove all nulls, undefined and empty strings",
"main": "index.js",
"scripts": {
"test": "_mocha"
"test": "mocha"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -1,2 +0,5 @@

# groom
# groom [![Build Status](https://travis-ci.org/e-conomic/groom.svg?branch=master)](https://travis-ci.org/e-conomic/groom)
[![npm package](https://nodei.co/npm/groom.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/groom/)
Does JSON.parse(JSON.stringify(myObject)) and removes all nulls, undefined and empty strings.

@@ -16,10 +19,18 @@

'test'
]
],
f: new Date(0),
g: /test/
};
console.log(o)
console.log(groom(o));
//output:
{
a: 1,
e: ["test"]
e: ["test"],
f: '1970-01-01T00:00:00.000Z',
g: {}
}
```
Dates are .toString()'ed and regExp'es are turned into the empty object `{}`.
The original object stays the same. A copy without null, undefined and empty string is created.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc