{"_id":"speckoloo","_rev":"92-e198e5b94d260fac8553c10844c5ba64","name":"speckoloo","dist-tags":{"latest":"0.10.0"},"versions":{"0.2.0":{"name":"speckoloo","version":"0.2.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.2.0","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"1526df9b4e75b4198a9278f4724dd3a77dde5722","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.2.0.tgz","integrity":"sha512-ywSWO6BZrIzUZCX1Bw4+wBkTDAMem1iV9k/0xLEE2RkWzSOTiiLlMK+1iy6hNorof6ANdtuXQV6qQsqbbUH77Q==","signatures":[{"sig":"MEYCIQCEGX1ADKn5wNbArU3O5thuxcSTfAAGSSytzI7lAroNiQIhAPX3IiJHHOYS66VDlQXt1n50gnNFp35RPWWExUNur5YK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","gitHead":"ba4ef8adf45a8cd0a0675927e6d37ac22e962633","scripts":{"nyc":"nyc","lint":"eslint src/","test":"ava","build":"babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","prepare":"npm run build","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","test:watch":"ava --watch","prepublishOnly":"npm run test && npm run lint","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"deprecated":"Deprecated","repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.2.0.tgz_1503948216838_0.07906918763183057","host":"s3://npm-registry-packages"}},"0.3.5":{"name":"speckoloo","version":"0.3.5","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.3.5","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"9bec522e71193453f26504f69d5415f96633a83e","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.3.5.tgz","integrity":"sha512-3GeKYlQdFOT9ZbDiMIoeDmBLY2w3xK03/B/hf+1ELYLxzRd4PfNHpyZM8qgcwpm4DworsBnN13uax0LRG/CWtA==","signatures":[{"sig":"MEUCIFsh5pLOoEEe4rjkNZZZikVA4lD18CxAUScnBxtPlzZXAiEA4M1nlReueUi6mRxZ60hBswMtYzCcWiuyHfjfFzbhnsA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"05fed76764d5c4d060d0bb672275a0225211df48","scripts":{"lint":"eslint src/","test":"ava src/**/*.test.js test/","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"npm run test -- --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.3.5.tgz_1504045265678_0.5694363981019706","host":"s3://npm-registry-packages"}},"0.3.6":{"name":"speckoloo","version":"0.3.6","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.3.6","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"cff913642455800abef8473704c8539eb1d0b257","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.3.6.tgz","integrity":"sha512-cRgBPAbl8iy6uGggDzbWg1z2t/s0vYkO8SWxDLJX3gxj49DBI25+ZrJ3kcX1D5KxpE5nJU96aucVJfYjpbv0yw==","signatures":[{"sig":"MEQCIDgzGPnj/n6E4JwSo9ob7+V7rA1QPtp/YLWUCpfPmTRhAiA5vhMqPGT7W73Dcx/s03cxlPqM0JktVI/HQC61DXSBxw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"78b71d91be385e8fd7b8c22647d50491f2e4930d","scripts":{"lint":"eslint src/","test":"ava src/**/*.test.js test/","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"npm run test -- --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.3.6.tgz_1504116386163_0.16338049620389938","host":"s3://npm-registry-packages"}},"0.3.7":{"name":"speckoloo","version":"0.3.7","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.3.7","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"da4ae8a1b05ac29e1995145fa84a09845a397848","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.3.7.tgz","integrity":"sha512-p7wKFgA3MjETSjow68WfOx9VFKObSC+FfA49xxgWC3HWTnJxeD5M9MsethCmZPjiKtutYkCb2wb6T2aR9ek4Ow==","signatures":[{"sig":"MEUCIGQ1rCs2cV5+C+pQwqPmmrm2T/26tLDAryBeVCIojDwaAiEA+YA1Xijv/g8Ufzo6cUZa3fkUBlDrhQXR8nn/oFW1Zw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"5510d7810fd00edf7a8408cee382cf9c5340717e","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.3.7.tgz_1504207006984_0.3572942283935845","host":"s3://npm-registry-packages"}},"0.3.8":{"name":"speckoloo","version":"0.3.8","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.3.8","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"e56dc2a33499dc88b1f8928ae8474c5d19cece07","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.3.8.tgz","integrity":"sha512-uBWqGrziqCY/QZx0Rs2V84a0X18YN4dH3M+dA7uUL2XT8dV4Wf+/mwLunO+LLFuarKz/d8DMLifvc77MyObBwA==","signatures":[{"sig":"MEUCIDjjreo9YcMgtpsU4HYFUH+WPx1L/xsJhlvkeB6LYR53AiEA2wWCZWp9t5sQeDeIxOAcA/mcx4SmOelXOO3wwjUQ5wc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"0a05b63881b8379993eda87faaa69c0cdba7b6ca","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.3.8.tgz_1504211904933_0.1609194919001311","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"speckoloo","version":"0.4.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.4.0","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"3c72eabb2d9cd0e7b6f51e181a60c44cb19dca67","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.4.0.tgz","integrity":"sha512-7MHpUo/lLaPaOFrh2qYuTOhm+N3JwUfgQK5BEaGT/GDU3bv72NySsMKp9dIvSjHE2ufKoVuXa/XrHjJxYzHLkA==","signatures":[{"sig":"MEUCIHJrzasLbi7jDOM7XDrhVaiVTL0CMgMHv3SM9I3jAX5LAiEAgF9+XiKcdrQdzrTwY4YivFPjb706ctj1iW1JaF9xw3s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"e0eb4ba2b06670a6a4383658da7f88927624a1fc","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.4.0.tgz_1504222152502_0.708409956889227","host":"s3://npm-registry-packages"}},"0.4.1":{"name":"speckoloo","version":"0.4.1","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.4.1","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"c2439b55b04fac88d064b1dd71157a6d2c8c52b8","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.4.1.tgz","integrity":"sha512-rBHu+SanUlgRj3bviEbHDZsqMqJhWJdZ+4Sdr1nLtQxGLIfrHZkN0UViAyHG1P466YQGm8QHrjPwBegrGjgt0g==","signatures":[{"sig":"MEUCIQCdrxBADWDOiro/Pp5KdqtQA00irstFaUYS9fEl4LEhSAIgdLFYrAvN1TPS4wYZyPiwciGqv3J8HvrJ7PP5lRjCPCA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"ebfaff5bc1f1d3d6468e72c0447bf82f63e38929","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.4.1.tgz_1504223815277_0.49699354846961796","host":"s3://npm-registry-packages"}},"0.5.0":{"name":"speckoloo","version":"0.5.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.5.0","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"dc8c935efe930463a10a54d01a366cb2f21bacea","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.5.0.tgz","integrity":"sha512-GRCprlHBucuUkN8w11zPcNzZKy40wrtCblqr0z5mSYC3Vh4AVYH3YKqck+jcUYUu4Hx1mz4sPMiDwdRWbN02yA==","signatures":[{"sig":"MEQCICsVV442CDUU44VsUMWW3bOjDGNtpQ7nuw6Y+G9EhQObAiAyxxl+hBFmEHCLHCyOAvfjBQps8h2oHQqBJx3+xKp7PQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"cb876f093d26a5aba530937f96bcbbe398d4a1f7","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.3.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.5.0.tgz_1504292181286_0.8356334874406457","host":"s3://npm-registry-packages"}},"0.5.1":{"name":"speckoloo","version":"0.5.1","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.5.1","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"66b4f3d10643a6a2d54784f4418bfdd3dbb85bb8","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.5.1.tgz","integrity":"sha512-pF6dOXU9Cq8ezTgIh4gj5p5RktTTdWrnHFM4aAVCYV5G7LwxAaljPy0/XX9GeWp44E4JSH7M2J6nlTC3CbTabw==","signatures":[{"sig":"MEQCIDSxd638A5PEjNeeRRlGcgqI1SGqewOi1d/XK+pKYDxcAiBCDdCtiuYHtvuFszpYt4rtAXwp0nEixJFfy6iWaUfvQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"6884d1e28894068b070a00401e4e6bc0f2f541fe","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.4.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.5.1.tgz_1504558119935_0.22751968377269804","host":"s3://npm-registry-packages"}},"0.6.0":{"name":"speckoloo","version":"0.6.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.6.0","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"d9ff84dd63392e544678e0e2197a3b4cd5016f22","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.6.0.tgz","integrity":"sha512-MLD/ko7cVR7uGQsCdxZIos4Wu60YS34Ip77jP5ZNKx8t96ATDnpnlDWqwAtR5T4bMwNJl6W6MozatW93ndNt7g==","signatures":[{"sig":"MEUCID+td+mchFzArhQLuXp0TbNucCvo1MenQWr/O0i9XjItAiEA+Ikef/ZRUJVDk6942FN2KBOTLXHRtPSEhfIJq45izTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","_from":".","module":"dist/index.js","_shasum":"d9ff84dd63392e544678e0e2197a3b4cd5016f22","gitHead":"7201da4995c738916c2ddf6c20f7670b198d073b","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"3.10.10","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.6.0.tgz_1505938444982_0.3531833100132644","host":"s3://npm-registry-packages"}},"0.6.1":{"name":"speckoloo","version":"0.6.1","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.6.1","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"928006b087f1442b85233e71973c9d19df264421","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.6.1.tgz","integrity":"sha512-zBaCpkB7s+cJ7NwO6jwnzCwX1akzW0joZZAfV3mYSXAvAjA1aCWi4tFFEIZHHffVSTYVNuZh/BZr0oy/gaSrGg==","signatures":[{"sig":"MEUCIAt0cTR6GuGEQTWlNdMZ7v4PW/+UWDSprjHaiydeDzTvAiEAvRB9AVuqVEWpR9nUetK3MXY4CQCzXuHl6jra5ZBxEzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","_from":".","module":"dist/index.js","_shasum":"928006b087f1442b85233e71973c9d19df264421","gitHead":"97c52b172659cc132835005897ec1fc52f439ff7","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"3.10.10","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.6.1.tgz_1506018543906_0.8933680949267","host":"s3://npm-registry-packages"}},"0.6.2":{"name":"speckoloo","version":"0.6.2","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.6.2","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"40435d924431c72533b0311fe49fe7c65faa0faa","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.6.2.tgz","integrity":"sha512-iGFo+4aKM//x/OlZ4gqG8zmLIIUCgmCpxjpyLv5QdjSQ+aY4jE499E4U59pvJY5Abfe0o2KuzP6PzPfKZROmIg==","signatures":[{"sig":"MEUCIEXMbXVclyuY50dawpNQjLJeOemLI88bCnKJEzCsFLtzAiEA3pPdmCDTC4LFG5NPipd18nLpv83rp1RUFzVUBMJgAvs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","_from":".","module":"dist/index.js","_shasum":"40435d924431c72533b0311fe49fe7c65faa0faa","gitHead":"56840c424e21fe495e1ec51b861394514a00c052","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"3.10.10","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.6.2.tgz_1506018852020_0.5342793823219836","host":"s3://npm-registry-packages"}},"0.7.0":{"name":"speckoloo","version":"0.7.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.7.0","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"7a513a243afc4faa48443bdb6fe555db80bcd622","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.7.0.tgz","integrity":"sha512-wBHzlfI7h6nh1ZeqxghGOW4XRBUt08jgVZMgM1PCcDMpYrbmZEgzbyiSpwWDT7qa/oFZDMONPxRTFffAmeZxUA==","signatures":[{"sig":"MEUCIH7ZiRPqcajFZtUzjMzNes7gAFHuSQWUiu1jtxhmVXx6AiEAtAGBdsokR/UwzxhNlWpiaZtsEMeB9aQJfXVrGmXOb7w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","_from":".","module":"dist/index.js","_shasum":"7a513a243afc4faa48443bdb6fe555db80bcd622","gitHead":"5d23fd3796cbd446d7828cd727d2d20f72bf7e1f","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"3.10.10","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.7.0.tgz_1506107262448_0.4541703450959176","host":"s3://npm-registry-packages"}},"0.7.1":{"name":"speckoloo","version":"0.7.1","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.7.1","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"d98a5b3e13e08baf60354d729f5d0ab0388ce8ce","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.7.1.tgz","integrity":"sha512-B2DYVn4Rc10xvIBy8BjzDdgMdhqQkuAE16uIT7HfJWNav+T3m1u8gtqj6INn8wqYd5jHLnrt03YCYPr7Wo0Rww==","signatures":[{"sig":"MEUCIQC+eB1kfx2WEbQk4Zo3DK+LmVLq8g7Be7nqMjTs354rqgIgdrl8c79dxahGWMtw8V+YxJ0WEBQil72+s6zStRvkdak=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"b3a00216be3f51a325d7d67f6fffeb41edd59f29","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.4.2","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.7.1.tgz_1506374403152_0.424255148274824","host":"s3://npm-registry-packages"}},"0.7.2":{"name":"speckoloo","version":"0.7.2","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.7.2","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"30659927c978707e51eedb1cf26530f58c8d88df","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.7.2.tgz","integrity":"sha512-U7cuPT2v3it+gO/I178buCFzrvLkuttRWN5siL+rrM1qP392jMdAUSg0jV7odPLGwxOnCqsaA9ldTUM75u3LaQ==","signatures":[{"sig":"MEQCIEzMObUO9oHzkyrk81An11TuMeZMThYG4LZWZJBf8AiEAiBqO0KAUjQD845l1hLNVEeXh265qIEt48fldxhw9O2Kgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"6770dcd2fe70f2d5a07605b8bd7614fbb12ca2bc","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc report --reporter=text-lcov | coveralls","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage-report":"nyc report","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.4.2","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.11.2","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.7.2.tgz_1506438139012_0.11346084787510335","host":"s3://npm-registry-packages"}},"0.8.1":{"name":"speckoloo","version":"0.8.1","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.8.1","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},{"name":"guisouza","email":"gui_souza@me.com"},{"name":"revmobadmin","email":"revmobads@revmob.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"exclude":["src/**/*.test.js","src/**/*.fixture.js"],"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"57189ed9ce368fe674cbb701c50ded887c1b7c40","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.8.1.tgz","integrity":"sha512-v5HuFdg0JFRUP5mdB9aJ2zK/Mbg0HWq1rDJtKHkYOuWXktjkKfT06FKgvcZB5bjS/uQXaAisIQ2u4ZL/U7Usqg==","signatures":[{"sig":"MEUCIQDzU6zzSh9GCOe8pE9wbUWFbe0EZcPb0PWb7UEEbOmryAIgZgA3tU16D6y88bozWgW+eUVOod66rU6DxrpNcypdJzI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"e38c35279b617ec6b542becb17469c83a72410ad","scripts":{"lint":"eslint src/","test":"ava","build":"npm run clean && babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc npm test","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","prepublishOnly":"npm run build","coverage:report":"nyc report --reporter=text-lcov | coveralls","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.6.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"6.12.1","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-entries":"^1.0.0","babel-plugin-transform-object-rest-spread":"^6.23.0"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.8.1.tgz_1513168387434_0.04526615818031132","host":"s3://npm-registry-packages"}},"0.9.2":{"name":"speckoloo","version":"0.9.2","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.9.2","maintainers":[{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},{"name":"legiao","email":"contato@tiagogoncalves.com.br"},{"name":"denisebiscaro","email":"denisebiscaro@gmail.com"},{"name":"brunoalcides","email":"brunolourencoa@gmail.com"},{"name":"henrique_kenji","email":"henrique.kenji@revmob.com"},{"name":"guisouza","email":"gui_souza@me.com"},{"name":"revmobadmin","email":"revmobads@revmob.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"exclude":["src/**/*.test.js","src/**/*.fixture.js"],"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"7e061fb9699266f53925e95640721ef2f6f66770","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.9.2.tgz","integrity":"sha512-3c9DHYGrsybTeUJn7JEo44/Xdm3ai9oS9m+DOP2XB+EvJkWnq79bMiRhjYY0960MMvo90QcUpDqgiHoQbVw1tA==","signatures":[{"sig":"MEUCIQCUq/OkYyf1ORtSZ298Eu3V8Kjx9LNmZlx1xMnPDjZ0oQIgQelCzOTedB54VbfwmgLXYos7tcR+S6iHsoFOPu6aMqo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/index.js","module":"dist/index.js","gitHead":"1412fd0a794fe6053612a05d4c372cc4c0cdb39b","scripts":{"lint":"eslint src/","test":"ava","build":"babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc npm test","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","generate-toc":"markdown-toc -i README.md","prepublishOnly":"npm run build","coverage:report":"nyc report --reporter=text-lcov | coveralls","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.6.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"8.9.4","dependencies":{},"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","markdown-toc":"^1.2.0","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-rest-spread":"^6.23.0","babel-plugin-transform-es2017-object-entries":"0.0.4"},"peerDependencies":{"joi":"^13.1.1"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo-0.9.2.tgz_1517338039001_0.3390994700603187","host":"s3://npm-registry-packages"}},"0.10.0":{"name":"speckoloo","version":"0.10.0","keywords":["DDD","OLOO"],"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","_id":"speckoloo@0.10.0","maintainers":[{"name":"brunoalcides","email":"brunolourencoa@gmail.com"},{"name":"danilojuns","email":"danilojun9@gmail.com"},{"name":"denisebiscaro","email":"denisebiscaro@gmail.com"},{"name":"dri9595","email":"me@dri.cool"},{"name":"fabiotoi","email":"fabioptoi@gmail.com"},{"name":"guisouza","email":"gui_souza@me.com"},{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},{"name":"henrique_kenji","email":"henrique.kenji@revmob.com"},{"name":"hidekimatsumoto","email":"hidekimatsumoto31@gmail.com"},{"name":"legiao","email":"contato@tiagogoncalves.com.br"},{"name":"revmobadmin","email":"revmobads@revmob.com"},{"name":"tech-revmob","email":"tech@revmob.com"}],"homepage":"https://github.com/hbarcelos/speckoloo#readme","bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"nyc":{"all":true,"cache":true,"exclude":["src/**/*.test.js","src/**/*.fixture.js"],"include":["src/**/*.js"],"require":["babel-register"],"sourceMap":false,"instrument":false,"check-coverage":true},"dist":{"shasum":"2fe4c093287ac03e9479a4a3c07b4a7bfa6cddd7","tarball":"https://registry.npmjs.org/speckoloo/-/speckoloo-0.10.0.tgz","fileCount":41,"integrity":"sha512-F4y2qWAYlZglhaR8k4+upmR7XxF4sM9TMrnK1ttddrlib1Wp4a4B8fHnsTvumIntLdol4FkXayqzZ5rOCLHqLA==","signatures":[{"sig":"MEUCIGjZfYIN61y1cbohAtMjSntGlNTwINJErwKMoFTTPPgNAiEArML2XGLuFR3nqIGt3lXpqNR9opKHKzD+LrZHpt9km2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":432307},"main":"dist/index.js","module":"dist/index.js","gitHead":"4d7fce1bfc9674462ae2f2551ce7aff0db9eba63","scripts":{"lint":"eslint src/","test":"ava","build":"babel src/ -d dist/","clean":"find ./dist -maxdepth 1 -exec rm -rf {} +","coverage":"nyc npm test","prepublish":"(not-in-publish && echo 'Skipping prepublish') || npm run require-npm4-to-publish","preversion":"npm run build && npm run lint && npm run test","test:watch":"ava --watch","postversion":"git push && git push --tags","generate-toc":"markdown-toc -i README.md","prepublishOnly":"npm run build","coverage:report":"nyc report --reporter=text-lcov | coveralls","require-npm4-to-publish":"semver -r '>=4.0.0' $(npm --version) || (echo 'NPM 4+ required to publish' && exit 1)"},"_npmUser":{"name":"hbarcelos","email":"rick.hjpbarcelos@gmail.com"},"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"_npmVersion":"5.6.0","description":"Domain entites inspired by Speck","directories":{},"_nodeVersion":"9.5.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"ava":"^0.22.0","nyc":"^11.1.0","eslint":"^4.4.1","semver":"^5.4.1","babel-cli":"^6.24.1","coveralls":"^2.13.1","in-publish":"^2.0.0","babel-eslint":"^7.2.3","markdown-toc":"^1.2.0","babel-register":"^6.24.1","babel-preset-env":"^1.6.0","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","babel-plugin-istanbul":"^4.1.4","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1","@istanbuljs/nyc-config-babel":"^1.2.2","babel-plugin-transform-object-rest-spread":"^6.23.0","babel-plugin-transform-es2017-object-entries":"0.0.4"},"peerDependencies":{"joi":"^13.1.1"},"_npmOperationalInternal":{"tmp":"tmp/speckoloo_0.10.0_1519081033923_0.4628090714327182","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-08-28T18:32:17.017Z","modified":"2026-03-06T15:29:17.242Z","0.1.0":"2017-08-28T18:32:17.017Z","0.2.0":"2017-08-28T19:23:36.984Z","0.3.0":"2017-08-29T21:26:04.811Z","0.3.1":"2017-08-29T21:43:22.950Z","0.3.2":"2017-08-29T21:59:26.587Z","0.3.3":"2017-08-29T22:02:21.394Z","0.3.4":"2017-08-29T22:15:41.952Z","0.3.5":"2017-08-29T22:21:05.825Z","0.3.6":"2017-08-30T18:06:26.319Z","0.3.7":"2017-08-31T19:16:47.136Z","0.3.8":"2017-08-31T20:38:25.096Z","0.4.0":"2017-08-31T23:29:12.615Z","0.4.1":"2017-08-31T23:56:55.432Z","0.5.0":"2017-09-01T18:56:21.378Z","0.5.1":"2017-09-04T20:48:40.167Z","0.6.0":"2017-09-20T20:14:05.189Z","0.6.1":"2017-09-21T18:29:04.046Z","0.6.2":"2017-09-21T18:34:12.157Z","0.7.0":"2017-09-22T19:07:42.567Z","0.7.1":"2017-09-25T21:20:03.593Z","0.7.2":"2017-09-26T15:02:19.276Z","0.8.0":"2017-12-12T18:08:27.252Z","0.8.1":"2017-12-13T12:33:07.542Z","0.9.0":"2018-01-30T17:13:26.022Z","0.9.1":"2018-01-30T18:34:07.579Z","0.9.2":"2018-01-30T18:47:19.221Z","0.10.0":"2018-02-19T22:57:14.033Z"},"bugs":{"url":"https://github.com/hbarcelos/speckoloo/issues"},"author":{"name":"Henrique Barcelos","email":"rick.hjpbarcelos@gmail.com"},"license":"MIT","homepage":"https://github.com/hbarcelos/speckoloo#readme","keywords":["DDD","OLOO"],"repository":{"url":"git+https://github.com/hbarcelos/speckoloo.git","type":"git"},"description":"Domain entites inspired by Speck","maintainers":[{"email":"rafael@artnic.io","name":"artnic"},{"email":"lucas.souza@infleux.co","name":"inf.simstm"},{"email":"igor.correa@infleux.co","name":"igor.correa"},{"email":"rick.hjpbarcelos@gmail.com","name":"hbarcelos"}],"readme":"# Speckoloo\n\n[![Node Version](https://img.shields.io/badge/node-%3E=6.0.0-green.svg)](https://nodejs.org) [![Coverage Status](https://coveralls.io/repos/github/hbarcelos/speckoloo/badge.svg?branch=master)](https://coveralls.io/github/hbarcelos/speckoloo?branch=master) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nDomain entities inspired by [Speck][1].\n\n## ToC\n\n<!-- toc -->\n\n- [Motivation](#motivation)\n- [Design rationale](#design-rationale)\n- [Functionalities](#functionalities)\n- [Interfaces](#interfaces)\n- [Installation](#installation)\n  * [NPM](#npm)\n  * [Manually](#manually)\n- [Usage](#usage)\n  * [Schemas](#schemas)\n    + [Basic structure](#basic-structure)\n    + [Default value](#default-value)\n      - [Ignoring default values](#ignoring-default-values)\n    + [Read-only properties](#read-only-properties)\n    + [Validator](#validator)\n      - [Default validators](#default-validators)\n      - [Creating custom validators](#creating-custom-validators)\n      - [Using validation adapters](#using-validation-adapters)\n    + [Optional properties](#optional-properties)\n    + [Factory](#factory)\n    + [Methods](#methods)\n    + [Contexts](#contexts)\n      - [Exclude properties](#exclude-properties)\n      - [Include only some properties](#include-only-some-properties)\n      - [Modifying the validator of a property](#modifying-the-validator-of-a-property)\n      - [Skipping validation](#skipping-validation)\n  * [Validation](#validation)\n    + [Default validation](#default-validation)\n    + [Context-aware validation](#context-aware-validation)\n  * [Serialization](#serialization)\n    + [Default serialization](#default-serialization)\n    + [Context-aware serialization](#context-aware-serialization)\n  * [Type Checking](#type-checking)\n  * [Composite entities](#composite-entities)\n    + [Composite entities serialization](#composite-entities-serialization)\n    + [Composite entities validation](#composite-entities-validation)\n  * [Collection entities](#collection-entities)\n    + [Get an entity from a collection](#get-an-entity-from-a-collection)\n    + [Iterate over a collection](#iterate-over-a-collection)\n    + [Collection serialization](#collection-serialization)\n    + [Collection validation](#collection-validation)\n    + [Nested collections](#nested-collections)\n- [Contributing](#contributing)\n\n<!-- tocstop -->\n\n## Motivation\n\nDomain Driven Design is a total new beast when it comes to Node.js/Javascript development. There are not many tools out there to help us.\n\nI was presented to Speck around May'17 by [@guisouza][2], a great piece of work made by him and his former colleagues at Sprinkler.\n\nHowever, I could not agree to some parts of its design rationale, such as the use of classes, react proptypes and reliance on the `instanceof` operator, so I decided to implement my own version.\n\nTo be clear, this is mostly a matter of style and preference. There is a long debate around this and no side is a clear winner, but I tend to agree more with one of them.\n\n## Design rationale\n\nThis library is based on two key concepts:\n\n- [OLOO][3]\n- [Duck Typing][4]\n\nI prefer OLOO because attempts on simulating classical inheritance are flawed and unneeded in Javascript. Constructors are [essentially broken][5] and the workaround leads to lots of almost-the-same-but-not-quite code, so we cannot rely on `.constructor` properties from objects.\n\nNominal typing works (barely) only for primitive types (remember that `typeof null === 'object'` :expressionless:), let alone for complex types &mdash; see [`instanceof` lies][6] &mdash; so I also rather use *duck typing* instead of *nominal typing*. `speckoloo` relies on duck typing for entity construction, but exposes a nominal typing feature through the `constructor` properties of the entities ([see docs](#type-checking)).\n\nThis might cause some discomfort for those used to static-typed languages &mdash; coincidentally those where DDD is more widespread &mdash; but the main point of *duck typing* is that [it's the caller job to honor his side of the contract][7]. So, if you are using this library, but are being unpolite, it will probably blow up on your face. Still, I'll try to provide the most descriptive error messages as possible.\n\nFurthermore, this library will, as much as possible, avoid code duplication for the clients using it and be validation framework agnostic.\n\n## Functionalities\n\n`speckoloo` provides the following capabilities:\n\n- **State** storage: holds data belonging to the entities\n- Data **validation**: validates entity data against a provided schema.\n- Data **(de)serialization**: converts data from and to plain old JSON objects.\n- Data **composition**: allows entities to reference one another.\n\nAll functions related to the above concerns will be called **synchronously**.\n\n## Interfaces\n\nEach object created by `speckoloo` factories implements the  `Validatable` and the `JSONSerializable` interfaces, defined bellow:\n\n```javascript\ninterface ErrorDetail {\n  [property: String]: String\n}\n\ninterface ValidationError {\n  name: 'ValidationError'\n  message: String,\n  details: ErrorDetail\n}\n\ninterface Validatable {\n  validate(context?: String) => this, throws: ValidationError | Error\n}\n\ninterface JSONSerializable {\n  toJSON(context?: String) => Object, throws Error\n}\n```\n\n- `toJSON`: returns a raw JSON object with the properties present in the entity.\n- `validate`: returns the object itself if its data is valid or throws a `ValidationError`\n\nBoth `toJSON` and `validate` methods are [context][9]-aware and may receive an optional `context` param. If such context doesn't exist, both will throw an `Error`.\n\n## Installation\n\n### NPM\n\n```bash\nnpm install --save speckoloo\n```\n\n### Manually\n\n```bash\ngit clone https://github.com/hbarcelos/speckoloo.git\ncd speckoloo\nnpm install\nnpm run build\n```\n\n## Usage\n\n### Schemas\n\n#### Basic structure\nTo define a schema, simply create an object whose keys are the possible properties descriptors:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {},\n  myProp2: {},\n  myProp3: {}\n}\n\nconst myEntityFactory = factoryFor(mySchema)\n\nconst instance = myEntityFactory({\n  myProp1: 'a',\n  myProp2: 'b',\n  myProp3: 'c'\n})\n```\n#### Default value\n\nTo define a schema with a default value for a given property, add `default` to the schema definition.\n\nWhenever a property value is missing when the entity factory is called, the default value is set:\n\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {\n    default: 'myValue'\n  }\n}\n\nconst factory = factoryFor(mySchema)\n\nconst instance = factory({})\n\nconsole.log(instance.toJSON())\n```\n\nOuptut:\n\n```javascript\n{\n  myProp1: 'myValue'\n}\n```\n\n**NOTICE**: if a [`factory`](#factory) property is set for a given property, it will be called with the `default` value to obtain the final value of the property:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {\n    default: '1',\n    factory: Number\n  }\n}\n\nconst factory = factoryFor(mySchema)\n\nconst instance = factory({})\n\nconsole.log(typeof instance.myProp1)\n```\n\nOutput:\n\n```javascript\n'number'\n```\n\n##### Ignoring default values\n\nIt is possible to make the factory ignore all default values, using the `ignoreDefaults` option in its second parameter.\n\nThis is useful when creating a patch for a given entity, without having to build it entirely first. This way, when such data is merged, the current value is not overwritten.\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {\n    default: 'myValue'\n  }\n}\n\nconst factory = factoryFor(mySchema)\n\nconst instance = factory({}, {\n  ignoreDefaults: true\n})\n\nconsole.log(instance.toJSON())\n```\nOutput:\n\n```javascript\n{}\n```\n\n#### Read-only properties\n\nTo define a schema with read-only properties, add `readOnly` to the schema definition.\n\nWhen a property is read-only, its value will remain the same as the time of instantiation. Any attempt on set a value for such property will throw a `TypeError`:\n\n```javascript\nconst schema = {\n  prop1: {\n    readOnly: true\n  }\n}\n\nconst factory = factoryFor(schema)\n\nconst instance = factory({\n  prop1: '__initial__'\n})\n\ninstance.prop1 = '__new__' // <-- throws TypeError\n```\n\n#### Validator\n\nTo define a schema with validators, add a property `validator` of type `Validator`.\n\nValidators are functions with the following interface:\n\n```javascript\ninterface PropertyValidationError {\n   error: String | Object\n}\n\nValidator(propertyValue: Any, propertyName: String, data: Object) => PropertyValidationError | Any\n```\n\nIf the validator returns a `ValidationError`, then it's interpreted as the validation has failed for that property. If it return anything else, then it's interpreted as it succeeded.\n\n##### Default validators\n\n`speckoloo` provides 3 default validators:\n- `allowAny`: allows any value\n- `forbidAny`: forbids any value\n- `delegate(context?: string, options?:object)`: delegates the validation to a nested entity.\n\nIf no validator is provided for a property, `allowAny` will be used by default:\n\n```javascript\nconst mySchema = {\n  myProp1: {}\n  myProp2: {\n    validator: defaultValidators.allowAny // the same as above\n  }\n}\n```\n\n##### Creating custom validators\n\n```javascript\nconst requiredString = (value, key) => {\n  if (value !== String(value)) {\n    return {\n        error: `Value ${key} must be a string.`\n    }\n  }\n  // Returning `undefined` means the validation has passed\n}\n\nconst mySchema = {\n  myProp1: {\n    validator: requiredString\n  },\n  myProp2: {\n    validator: requiredString\n  },\n  myProp3: {\n    validator: requiredString\n  }\n}\n```\n\n##### Using validation adapters\n\nIt is possible to use popular validation libraries with `speckoloo`, by wrapping the validation into a function of type `Validator`.\n\nCurrently the default adapters available are:\n\n- `joiAdapter`: adapts a [`joi`](https://www.npmjs.com/package/joi) function\n\nYou need to install `joi` as a peer dependency to be able to use it:\n\n```bash\n# Install peer dependency\nnpm install --save joi\n```\n\nThen:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\nimport joiAdapter from 'speckoloo/dist/adapters/joi'\n\nconst schema = {\n  id: {\n    validator: joiAdapter(Joi.string().alphanum().required())\n  }\n  ...\n}\n\nexport default factoryFor(schema)\n\n```\n\n#### Optional properties\n\nTo make a property optional, there is the `skippable` property in the schema definition.\n\nWhen set to `true`, it means that the `validator` will not be called when data is present.\n\nThis is useful because it doesn't force the definition of two validators to handle the case when an empty value is allowed:\n\n```javascript\nconst string = (value, key) => {\n  if (value !== String(value)) {\n    return {\n        error: `Value ${key} must be a string.`\n    }\n  }\n  // Returning `undefined` means the validation has passed\n}\n\nconst mySchema = {\n  myProp1: {\n    validator: string,\n    skippable: true\n  }\n  //...\n}\n```\n\nWhen `myProp1` is not set, the `validator` will not run.\n\nThis is specially useful when used in context definition (see [`$skip`](#skipping-validation)).\n\n#### Factory\n\nTo transform data on creation, there is the `factory` property in the schema definition.\n\nFactories are functions with the following signature:\n\n```javascript\nFactory(value: Any) => Any\n```\n\nExample:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {\n    factory: String // converts any input data to string\n  },\n  myProp2: {}\n}\n\nconst MyFactory = factoryFor(mySchema)\n\nconst instance = MyFactory({\n  myProp1: 1,\n  myProp2: 2\n})\n\nconsole.log(instance.myProp1)\n```\n\nOutput:\n\n```javascript\n'1' // <--- this is a string\n```\n\n**NOTICE:** `factory` is called only when property value is not `undefined`:\n\n```javascript\nconst instance = MyFactory({\n  myProp2: 2\n})\n\nconsole.log(instance)\n```\n\nOutput:\n\n```javascript\n{ myProp2: 2 }\n```\n#### Methods\n\nAn important part of DDD rationale is that entities should be self-contained in terms of business logic that relates only to them.\n\nFor example, imagine the domain is a simple drawing application, where there are the entities `Square` and `Circle`.. One of the functionalities is ot calculate the area of the drawn objects. The logic for calculating the area of the object should be within itself. To achive this with `speckoloo`, there is the special property `$methods` in schema definition:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst circleSchema = {\n  radius: {\n    validatior: positiveNumber,\n    factory: Number\n  },\n  $methods: {\n    getArea() {\n      return Math.PI * this.radius * this.radius\n    }\n  }\n}\n\nconst squareSchema = {\n  side: {\n    validatior: positiveNumber,\n    factory: Number\n  },\n  $methods: {\n    getArea() {\n      return this.side * this.side\n    }\n  }\n}\n\nconst circleFactory = factoryFor(circleSchema)\nconst squareFactory = factoryFor(squareSchema)\n\nconst circle = circleFactory({ radius: 2 })\nconst square = squareFactory({ side: 4 })\n\nconsole.log('Circle area: ', circle.getArea())\nconsole.log('Square area: ', square.getArea())\n```\n\nOutput:\n```\nCircle area: 12.566370614359172\nSquare area: 16\n```\n\nAll functions in `$methods` are attached to the entity &mdash; so `this` refers to the entity itself &mdash; as non-enumerable, non-configurable, read-only properties.\n\n#### Contexts\n\nEntities might have different validation rules for different contexts. Some properties might be required for one context, but not for another.\n\nTo create a context, there's a special property called `$contexts` that can be used in the schema definition. The `$contexts` object has the following structure:\n\n```javascript\n{\n  [contextName]: {\n     [operator]: Object | Array\n  }\n}\n```\n\nCurrently available operators are:\n- `$include`: considers only the given properties for the context.\n- `$exclude`: removes the given properties from the context.\n- `$modify`: changes the validators for the specified properties.\n- `$skip`: skips the validation if data is not present.\n\nConsider a `User` entity:\n\n```javascript\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n}\n```\n\n##### Exclude properties\n\nWhen creating/registering a `User`, probably `id` will not be available yet, so this property should be ignored in context `'create'`.\n\n```javascript\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n  $contexts: {\n    create: {\n      $exclude: ['id']\n    }\n  }\n}\n```\n\n##### Include only some properties\n\nAlso, when such `User` is trying to login into an application, the only properties required are `email` and `password`. So there is also a `login` context defined as follows:\n\n```javascript\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n  $contexts: {\n    create: {\n      $exclude: ['id']\n    },\n    login: {\n      $include: ['email', 'password']\n    }\n  }\n}\n```\n\n**NOTICE:** You **SHOULD NOT** use both `$include` and `$exclude` in the same context definition. Doing so will trigger a [process warning][8] and `$include` will take precedence.\n\n##### Modifying the validator of a property\n\nDuring creation, `password` strength must be enforced. For all other contexts, it could simply be a valid `string`. To achive this, there is the `$modify` operator, that allows changing the validator for a property only for the context.\n\nInstead of an array, `$modify` expects an `object` containing property-validator pairs, such as follows:\n\n```javascript\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n  $contexts: {\n    create: {\n      $exclude: ['id'],\n      $modify: {\n        password: passwordStrengthChecker\n      }\n    },\n    login: {\n      $include: ['email', 'password']\n    }\n  }\n}\n```\n\n**NOTICE:** `$modify` can be combined with both `$includes` and `$excludes`, but will only be applied for properties included or not excluded, respectively. Example:\n\n```javascript\nconst schema = {\n  prop1: requiredString,\n  prop2: requiredString,\n  $contexts: {\n    context1: {\n      $exclude: ['prop1'],\n      $modify: {\n        prop1: otherValidator // will be silently ignored\n      }\n    },\n    context2: {\n      $include: ['prop1'],\n      $modify: {\n        prop2: otherValidator // will be silently ignored\n      }\n    }\n  }\n}\n```\n\n##### Skipping validation\n\nSometimes there's a need to allow skipping validation when data is not present. The most common use case is entity patching, when only a subset of the entity is provided.\n\nUntil `0.4.x`, to do that you needed to redeclare the validator for a property on a given context:\n\n```javascript\nconst schema = {\n  prop1: requiredString,\n  prop2: requiredString,\n  $contexts: {\n    context1: {\n      $modify: {\n        prop1: string // <--- a validator that allows a string to be empty\n      }\n    }\n  }\n}\n```\n\nAs of `0.5.0`, there is a new operator called `$skip`, that shortens the code above to:\n\n```javascript\nconst schema = {\n  prop1: requiredString,\n  prop2: requiredString,\n  $contexts: {\n    context1: {\n      $skip: ['prop1']\n    }\n  }\n}\n```\n\n**NOTICE:** the main difference between `$exclude` and `$skip` is that the former will completely exclude the property from schema definition, regardless it's present on data or not. The latter will only skip the validation when the value is not present (`=== undefined`); if you provide an invalid value, the validation will fail.\n\n### Validation\n\n`validate` will throw a `ValidationError` when data is invalid or return the object itself otherwise (use this for chaining).\n\n#### Default validation\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst requiredString = (value, key) => {\n  if (value !== String(value)) {\n    return {\n        error: `${key} must be a string.`\n    }\n  }\n  // Returning `undefined` means the validation has passed\n}\n\nconst mySchema = {\n  myProp1: {\n    validator: requiredString\n  },\n  myProp2: {\n    validator: requiredString\n  },\n  myProp3: {\n    validator: requiredString\n  }\n}\n\nconst MyEntityFactory = factoryFor(mySchema)\n\nconst instance = MyEntityFactory({\n  myProp1: 1,\n  myProp2: 2,\n  myProp3: 3\n})\n\ninstance.validate() // throws an error\n```\n\nThe code above will throw a `ValidationError` like the following:\n\n```javascript\n{\n  name: 'ValidationError'\n  message: 'Validation Error!'\n  details: {\n    myProp1: 'myProp1 must be a string.',\n    myProp2: 'myProp2 must be a string.',\n    myProp3: 'myProp3 must be a string.'\n  }\n}\n```\n\n#### Context-aware validation\n\nTo make use of the defined contexts for validation, there is the `context` param of `validate()`.\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n  $contexts: {\n    create: {\n      $exclude: ['id'],\n      $modify: {\n        password: passwordStrengthChecker\n      }\n    },\n    login: {\n      $include: ['email', 'password']\n    }\n  }\n}\n\nconst UserFactory = factoryFor(schema)\n\nconst user = UserFactory({\n  email: 'some.email@domain.com',\n  password: 'dummyPass@1234'\n})\n\nuser.validate('login') // doesn't throw!\n```\n\n### Serialization\n\n#### Default serialization\n\n`toJSON` will return a raw JSON object with the properties present in the entity.\n\n**NOTICE:** `toJSON` **WILL NOT** validate data before returning it. If an invalid value is present for a given property, it will be returned as is.\n\nFrom the exact same example above:\n\n```javascript\nconst instance = MyEntityFactory({\n  myProp1: 1,\n  myProp2: 2,\n  myProp3: 3\n})\n\ninstance.toJSON() // ignores validation\n```\n\nOutput:\n\n```javascript\n{\n  myProp1: 1,\n  myProp2: 2,\n  myProp3: 3\n}\n```\n\nChaining `toJSON()` after `validate()` is a way to be sure only valid data is sent forward:\n\n```javascript\ngetDataSomehow()\n .then(MyEntityFactory)\n .then(instance =>\n    instance.validate()\n      .toJSON())\n```\n\n#### Context-aware serialization\n\nThe defined contexts can also be used to build a raw JSON object. There is also the `context` param of `toJSON()`.\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst schema = {\n  id: requiredString,\n  name: requiredString,\n  email: requiredEmail,\n  password: requiredString,\n  $contexts: {\n    create: {\n      $exclude: ['id'],\n      $modify: {\n        password: passwordStrengthChecker\n      }\n    },\n    login: {\n      $include: ['email', 'password']\n    }\n  }\n}\n\nconst UserFactory = factoryFor(schema)\n\nconst user = UserFactory({\n  id: '1234'\n  name: 'SomeUser',\n  email: 'some.email@domain.com',\n  password: 'dummyPass@1234'\n})\n\nconsole.log(user.toJSON('login'))\n```\n\nOutput:\n\n```javascript\n{\n  name: 'SomeUser',\n  email: 'some.email@domain.com'\n}\n```\n\n### Type Checking\n\n`speckoloo` factories will optimistically try to coerce entities of compatible schemas through _duck typing_.\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema1 = {\n  myProp1: {},\n  myProp2: {}\n  // missing myProp3\n}\n\nconst mySchema2 = {\n  myProp1: {},\n  myProp2: {},\n  myProp3: {}\n}\n\nconst myEntityFactory = factoryFor(mySchema1)\nconst anotherEntityFactory = factoryFor(mySchema2)\n\nconst anotherInstance = anotherEntityFactory({\n  myProp1: 'a',\n  myProp2: 'b',\n  myProp3: 'c'\n})\n\n// Will mostly work if the schemas are compatible:\nconst duckTypedInstance = myEntityFactory(anotherInstance)\n\nduckTypedInstance.validate() // does not throw because myProp3 is not required\nconsole.log(duckTypedInstance.toJSON()) // { myProp1: \"a\", myProp2: \"b\" }\n```\n\nFor cases where duck typing is not desired, entities expose a `constructor` property that point to the entity factory. The easiest way to check if a entity is an instance of a certain factory is by doing identity check (`===`) in such property:\n\n```javascript\nimport { factoryFor } from 'speckoloo'\n\nconst mySchema = {\n  myProp1: {},\n  myProp2: {},\n  myProp3: {}\n}\n\nconst myEntityFactory = factoryFor(mySchema)\nconst anotherEntityFactory = factoryFor(mySchema)\n\nconst instance = myEntityFactory({\n  myProp1: 'a',\n  myProp2: 'b',\n  myProp3: 'c'\n})\n\nconst anotherInstance = anotherEntityFactory({\n  myProp1: 'a',\n  myProp2: 'b',\n  myProp3: 'c'\n})\n\nconst duckTypedInstance = myEntityFactory(anotherInstance)\n\nconsole.log(instance.constructor === myEntityFactory) // true\nconsole.log(anotherInstance.constructor === myEntityFactory) // false (no duck typing here!)\nconsole.log(duckTypedInstance.constructor === myEntityFactory) // true\n```\n\n### Composite entities\n\nWhen an entity contains a reference to other entity, to automatically convert raw data into a nested entity, use the `factory` property on schema definition:\n\n```javascript\nconst childSchema = {\n  childProp1: {\n    validator: requiredString\n  },\n  childProp2: {\n    validator: requiredString\n  }\n}\n\nconst ChildFactory = factoryFor(childSchema)\n\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory\n  }\n}\n\nconst ParentFactory = factoryFor(parentSchema)\n\nconst instance = ParentFactory({\n  prop1: 1\n  child: {\n    childProp1: 'a',\n    childProp2: 'b'\n  }\n})\n```\n\nIn the example above, `child` will be an entity created by `ChildFactory`.\n\n#### Composite entities serialization\n\nWhen calling `toJSON()` on a composite entity, it will automatically convert the nested entity by calling `toJSON()` on it as well.\n\nFrom the example above:\n\n```javascript\nconst instance = ParentFactory({\n  prop1: 1\n  child: {\n    childProp1: 'a',\n    childProp2: 'b'\n  }\n})\n\nconsole.log(instance.toJSON())\n```\n\nWill output:\n\n```javascript\n{\n  prop1: 1\n  child: {\n    childProp1: 'a',\n    childProp2: 'b'\n  }\n}\n```\n\n#### Composite entities validation\n\nSince the default validator for any property is `allowAny`, to make a composite entity validate the nested one requires an explicit validator that will delegate the validation process to the latest.\n\nSince this is a rather common use case, `speckoloo` provides a default validator called `delegate`.\n\nRedefining the `parentSchema` above:\n\n```javascript\nimport { factoryFor, defaultValidators } from 'speckoloo'\n\n// ...\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory,\n    validator: defaultValidators.delegate() // <--- Notice that `delegate` is a function!\n  }\n}\n\n//...\n\nconst instance = ParentFactory({\n    prop1: 1,\n    child: {\n        childProp1: 1,\n        childProp2: 2\n    }\n})\n\ninstance.validate() // throws an error\n```\n\nWill throw:\n\n```javascript\n{\n  name: 'ValidationError'\n  message: 'Validation Error!'\n  details: {\n    prop1: 'prop1 must be a string.',\n    child: {\n      childProp1: 'childProp1 must be a string.',\n      childProp1: 'childProp1 must be a string.'\n    }\n  }\n}\n```\n\nIt's possible to specify a context for the `delegate` function, that will be forwarded to the nested entity `validate()` method:\n\n```javascript\n// ...\n\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory,\n    validator: defaultValidators.delegate('someContext')\n  }\n}\n\n// ...\n\ninstance.validate() // <--- Will call child.validate('someContext')\n```\n\n---\n\n**NOTICE:** By default, `delegate` will not validate the entity when data is missing.\n\n```javascript\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory,\n    validator: defaultValidators.delegate()\n  }\n}\n\nconst parentFactory = factoryFor(parentSchema)\n\nconst instance = parentFactory({\n  prop1: 'a'\n})\n\n// ...\n\ninstance.validate() // <--- Will return the instance itself\n```\n\nTo change this behavior, there is a `required` param in `options` that can be used:\n\n```javascript\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory,\n    validator: defaultValidators.delegate({ required: true }) // <----- changed here\n  }\n}\n\nconst parentFactory = factoryFor(parentSchema)\n\nconst instance = parentFactory({\n  prop1: 'a'\n})\n\n// ...\n\ninstance.validate() // <--- Will throw\n```\n\nOutput:\n\n```javascript\n{\n  name: 'ValidationError',\n  message: 'Validation Error!',\n  details: {\n    child: '`child` is required'\n  }\n}\n```\n\nIt's also possible to combine both `context` with `options`. Use `context` as first argument and `options` as second:\n\n```javascript\ndefaultValidators.delegate('myContext', { required: true })\n```\n\n---\n\nA common use case is validating the composite entity on context `\"A\"`, in which the nested entity must be in context `\"B\"`. In this case, `delegate` can be combined with `$modify` operator for context definition:\n\n```javascript\n// ...\n\nconst parentSchema = {\n  prop1: {\n    validator: requiredString\n  }\n  child: {\n    factory: ChildFactory,\n    validator: defaultValidators.delegate()\n  },\n  $contexts: {\n    A: {\n      $modify: {\n        child: defaultValidators.delegate('B')\n      }\n    }\n  }\n}\n\n// ...\n\ninstance.validate('A') // <--- Will call child.validate('B')\n```\n\n### Collection entities\n\nCollection entities represent a list of individual entities. As an individual entity, they implement both `Validatable` and `JSONSerializable`.\n\nIt also implements the `RandomAccessibleList` to allow an array-like access to its individual properties.\n\n```javascript\ninterface RandomAccessibleList {\n  at(n: Number) => Any\n}\n```\n\nFurthermore, they implement the native ES6 `Iterable` interface.\n\nExample:\n\n```javascript\nimport { factoryFor, collectionFactoryFor } from 'speckoloo'\n\nconst entitySchema = {\n  myProp1: {\n    validator: requiredString\n  }\n}\n\nconst entityFactory = factoryFor(entitySchema)\n\nconst collectionFactory = collectionFactoryFor(entityFactory)\n\nconst collection = collectionFactory([{\n    myProp1: 'a'\n}, {\n    myProp1: 'b'\n}])\n```\n\n#### Get an entity from a collection\n\nUse the `at` method:\n\n```javascript\nconsole.log(collection.at(0).toJSON())\n```\n\nOutput:\n\n```javascript\n{ myProp1: 'a' }\n```\n\n#### Iterate over a collection\n\nCollections can be iterated with a `for..of` loop as regular arrays:\n\n```javascript\nfor (let entity of collection) {\n  console.log(entity.toJSON())\n}\n```\n\nOutput:\n\n```javascript\n{ myProp1: 'a' }\n{ myProp1: 'b' }\n```\n\nHowever, common array operations as `map`, `filter` or `reduce` are not implemented. To use them, first convert a collection to a regular array using `Array.from`:\n\n```javascript\nconsole.log(Array.from(collection).map(entity => entity.myProp1))\n```\n\nOutput:\n```javascript\n['a', 'b']\n```\n\n#### Collection serialization\n\nCalling `toJSON` on a collection will generate a regular array containing plain JSON objects, created by calling `toJSON` on each individual entity in the collection:\n\n```javascript\nconsole.log(collection.toJSON())\n```\n\nOutput:\n\n```javascript\n[\n  { myProp1: 'a' },\n  { myProp1: 'b' }\n]\n```\n\nWhen passing the optional `context` parameter, its value will be used when calling `toJSON` on each individual entity.\n\n#### Collection validation\n\nCalling `validate` will return a reference to the collection itself if all entities are valid. Otherwise, it will throw an array of `ValidationError`, containing the validation errors for the invalid entities:\n\n```javascript\nimport { factoryFor, collectionFactoryFor } from 'speckoloo'\n\nconst entitySchema = {\n  myProp1: {\n    validator: requiredString\n  }\n}\n\nconst entityFactory = factoryFor(entitySchema)\n\nconst collectionFactory = collectionFactoryFor(entityFactory)\n\nconst collection = collectionFactory([{\n    myProp1: 1\n}, {\n    myProp1: 'a'\n}, {\n    myProp1: 2\n}])\n\ncollection.validate() // <--- will throw!\n```\n\nOutput:\n\n```javascript\n{\n  'item#0': {\n    myProp1: 'Value myProp1 must be a string.'\n  },\n  'item#2': {\n    myProp1: 'Value myProp1 must be a string.'\n  }\n}\n```\n\nThe `item#<n>` key indicates which of the entities in the collection are invalid.\n\n#### Nested collections\n\nIt's possible to use collections as nested entitties for a composite entity. All it takes is put a collection factory into a `factory` property from the schema.\n\nExample:\n\n```javascript\nconst singleSchema = {\n  prop1: {},\n  prop2: {}\n}\n\nconst singleFactory = factoryFor(singleSchema)\n\nconst collectionFactory = subject(singleFactory)\n\nconst compositeSchema = {\n  compositeProp1: {\n    validator: requiredString\n  },\n  nestedCollection: {\n    validator: defaultValidators.delegate(),\n    factory: collectionFactory\n  }\n}\n\nconst compositeFactory = factoryFor(compositeSchema)\n\nconst instance = compositeFactory({\n  compositeProp1: 'x'\n  nestedCollection: [\n    {\n        prop1: 'a',\n        prop2: 'b'\n    },\n    {\n        prop1: 'c',\n        prop2: 'd'\n    }\n  ]\n})\n\ninstance.validate() // will call validate for each entity\n```\n\n## Contributing\n\nFeel free to open an issue, fork or create a PR.\n\n`speckoloo` uses [StandardJS][10] and I'm willing to keep it production dependency-free.\n\nBefore creating a PR, make sure you run:\n\n```bash\nnpm run lint && npm run test\n```\n\n---\n\nSome missing features:\n\n- Support for getters and setters in schema definition.\n- Support for general collection methods, such as `map`, `filter`, `reduce`, etc.\n\n\n [1]: https://github.com/scup/speck\n [2]: https://github.com/guisouza\n [3]: https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch6.md\n [4]: https://pt.wikipedia.org/wiki/Duck_typing\n [5]: https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch5.md#constructors\n [6]: https://medium.com/javascript-scene/common-misconceptions-about-inheritance-in-javascript-d5d9bab29b0a\n [7]: https://softwareengineering.stackexchange.com/a/305880/91694\n [8]: https://nodejs.org/api/process.html#process_event_warning\n [9]: https://martinfowler.com/bliki/BoundedContext.html\n [10]: https://standardjs.com/\n","readmeFilename":"README.md"}