{"analyzedAt":"2022-07-03T13:40:06.213Z","collected":{"metadata":{"name":"data-filler","scope":"unscoped","version":"1.0.0","description":"make your backend response data shape reliable, with data-filler you can stay away from optional chain","keywords":["data-filler","data filler","data template"],"date":"2021-12-03T08:40:25.880Z","author":{"name":"fantasticsoul","email":"624313307@qq.com","url":"https://github.com/fantasticsoul","username":"fantasticsoul"},"publisher":{"username":"fantasticsoul","email":"624313307@qq.com"},"maintainers":[{"username":"fantasticsoul","email":"624313307@qq.com"}],"repository":{"type":"git","url":"git+https://github.com/tnfe/data-filler.git"},"links":{"npm":"https://www.npmjs.com/package/data-filler","homepage":"https://github.com/tnfe/data-filler#readme","repository":"https://github.com/tnfe/data-filler","bugs":"https://github.com/tnfe/data-filler/issues"},"license":"MIT","devDependencies":{"@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.7.0","@typescript-eslint/parser":"^4.7.0","eslint":"^7.12.1","eslint-config-prettier":"^6.15.0","eslint-loader":"^4.0.2","eslint-plugin-prettier":"^3.1.4","jest":"^27.0.5","prettier":"^2.2.1","rollup":"^2.38.0","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript":"^1.0.1","ts-jest":"^27.0.3","typescript":"^4.1.2"},"bundledDependencies":false,"releases":[{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":3},{"from":"2020-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":3}],"hasTestScript":true,"hasSelectiveFiles":true,"readme":"## data-filler 🍋\nmake your backend response data shape reliable, with data-filler you can stay away from optional chain.\n\n## Quick Start\ninstall\n```bash\nnpm i data-filler\n```\n\n- example 1   \nmissed level 1 key filled by template\n```js\nimport { fillDataByTemplate } from 'data-filler';\n\nconst data = { a: 1, b: 2 };\nconst template = { a: 0, b: 0, c: 0, d: [] };\nconst filled = fillDataByTemplate(data, template);\n// filled is: { a: 1, b: 2, c: 0, d: [] }\n```\n\n- example 2   \nfixed incorrect type of key values by template\n```js\nimport { fillDataByTemplate } from 'data-filler';\n\nconst data = { a: 1, b: 2, c: { c1: 100 } };\nconst template = { a: 0, b: 0, c: 0 };\nconst filled = fillDataByTemplate(data, template);\n// filled is: { a: 1, b: 2, c: 0 }\n```\n\n- example 3   \nmissed child level key filled by template\n```js\nimport { fillDataByTemplate } from 'data-filler';\n\nconst data = { a: 1, b: 2, c: { c1: 100 } };\nconst template = { a: 0, b: 0, c: { c1: 0, c2: 0, c3: 0 } };\nconst filled = fillDataByTemplate(data, template);\n// filled is: { a: 1, b: 2, c: { c1: 100, c2: 0, c3: 0 } }\n```\n\n- example 4   \nmissed array item key filled by template\n```js\nimport { fillDataByTemplate } from 'data-filler';\n\nconst data = { a: 1, b: 2, c: [{ c1: 1, c2: 1 }] };\nconst template = { a: 0, b: 0, c: [] };\nconst filled = fillDataByTemplate(data, template, { 'c': { c1: 100, c2: 100, c3: 100 } });\n// filled is: { a: 1, b: 2, c: [{ c1: 1, c2: 1, c3: 100 }] }\n```\n> use 3rd param `arrItemTemplates` to describe array item data shape\n\n- example 5   \nmissed child array item key filled by template\n```js\nimport { fillDataByTemplate } from 'data-filler';\n\nconst data = { a: 1, b: 2, c: [{ c1: 1, c2: [{ d1: 1 }] }] };\nconst template = { a: 0, b: 0, c: [] };\nconst filled = fillDataByTemplate(data, template, {\n  'c': { c1: 100, c2: [], c3: 100 },\n  'c.c2': { d1: 0, d2: 100 },\n});\n// filled is: { a: 1, b: 2, c: [{ c1: 1, c2: [{ d1: 1, d2: 100 }], c3: 100 }] }\n```\n> 3rd param `arrItemTemplates` support key path to describe nested array item data shape\n\n\n\n## License\n\nconcent is released under the MIT License. [http://www.opensource.org/licenses/mit-license](http://www.opensource.org/licenses/mit-license)"},"npm":{"downloads":[{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-06-26T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":4},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":29},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":44},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":98}],"starsCount":0},"github":{"starsCount":2,"forksCount":0,"subscribersCount":7,"issues":{"count":0,"openCount":0,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":false},"commits":[{"from":"2022-06-26T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":2}]},"source":{"files":{"readmeSize":2194,"testsSize":1839,"hasNpmIgnore":true},"linters":["eslint","prettier"]}},"evaluation":{"quality":{"carefulness":0.9199999999999999,"tests":0.6,"health":1,"branding":0},"popularity":{"communityInterest":9,"downloadsCount":9.666666666666666,"downloadsAcceleration":-0.039802130898021315,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6148924510789093,"detail":{"quality":0.8364556389013833,"popularity":0.03999276435231549,"maintenance":0.9998808339576686}}}