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

flat-er

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-er - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json

@@ -1,1 +0,1 @@

{"name":"flat-er","version":"1.0.5","description":"Flattens nested js objects to one level","main":"dist/index.js","scripts":{"test":"npm run build && npx jest","clean":"rm -rf dist node_modules","shrink":"npm prune --production && npm shrinkwrap","cond-install":"if [ ! -d node_modules ]; then npm i; fi;","build":"npm run cond-install && npx webpack --mode production && sudo cp src/index.d.ts dist/index.d.ts","preversion":"npm run clean && npm test","postversion":"git add . && git commit --amend && git push","rm-dev-deps":"cp package.json package.json.bak && cat package.json.bak | jq -rc '.devDependencies = {}' > package.json","pub":"npm run rm-dev-deps && npm publish && cp package.json.bak package.json"},"repository":{"type":"git","url":"git+https://github.com/molesoft/flat-er.git"},"keywords":["flatten","object"],"author":"Adam Monica","license":"MIT","bugs":{"url":"https://github.com/molesoft/flat-er/issues"},"files":["/dist"],"homepage":"https://github.com/molesoft/flat-er#readme","devDependencies":{}}
{"name":"flat-er","version":"1.0.6","description":"Flattens nested js objects to one level","main":"dist/index.js","scripts":{"test":"npm run build && npx jest","clean":"rm -rf dist node_modules","shrink":"npm prune --production && npm shrinkwrap","cond-install":"if [ ! -d node_modules ]; then npm i; fi;","build":"npm run cond-install && npx webpack --mode production && sudo cp src/index.d.ts dist/index.d.ts","preversion":"npm run clean && npm test","postversion":"git add . && git commit --amend && git push","rm-dev-deps":"cp package.json package.json.bak && cat package.json.bak | jq -rc '.devDependencies = {}' > package.json","pub":"npm run rm-dev-deps && npm publish && cp package.json.bak package.json"},"repository":{"type":"git","url":"git+https://github.com/molesoft/flat-er.git"},"keywords":["flatten","object"],"author":"Adam Monica","license":"MIT","bugs":{"url":"https://github.com/molesoft/flat-er/issues"},"files":["/dist"],"homepage":"https://github.com/molesoft/flat-er#readme","devDependencies":{}}

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

# Flat-Er - Flattens objects. That's it.
# Flat-Er - Flattens stuff. That's it.

@@ -10,2 +10,45 @@ ## Table of Contents

$ npm install --save flat-er
```
## Usage
```
import fe from 'flat-er'
const stuff = {
pets: {
dogs: [
{
name: 'douggie',
goodBoy: true
}
],
cats: [
{
name: 'mrSocks',
whiskers: true,
litterBox: {
clean: false
},
colors: [
'black',
'white'
]
}
]
}
}
const flattened = fe.flatten(stuff)
```
### Result
```
{
"pets.dogs.0.name": "douggie",
"pets.dogs.0.goodBoy": true,
"pets.cats.0.name": "mrSocks",
"pets.cats.0.whiskers": true,
"pets.cats.0.litterBox.clean": false,
"pets.cats.0.colors.0": "black",
"pets.cats.0.colors.1": "white"
}
```
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