Comparing version 1.0.5 to 1.0.6
@@ -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" | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9311
53