{"_id":"typedconverter","_rev":"193-d1c0b1ea56f69e902d6f5dc705146958","name":"typedconverter","dist-tags":{"latest":"2.3.6","next":"1.0.0-beta.7","canary":"2.3.7-canary.kik3wda7.0"},"versions":{"1.0.0-alpha.0":{"name":"typedconverter","version":"1.0.0-alpha.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"tinspector":"^2.2.0","tslib":"^1.9.3"},"devDependencies":{"@types/jest":"^24.0.11","coveralls":"^3.0.3","jest":"^24.5.0","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"31395226dd03660cde993c302270f32e412871d9","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@1.0.0-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"dist":{"integrity":"sha512-IUFivNbXgl1Y0KBhB8WuHP6EkFavggP+H4r5wu3/g+OrApVLtPZxdBRgk7qtGNuJVBNUyYpQtfSCVQYZMDv0DA==","shasum":"5178cf895fbad95640aae4bbda66e7f0ba5b2090","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.0.tgz","fileCount":5,"unpackedSize":11680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcngQuCRA9TVsSAnZWagAA7noQAJEMhK/B4/OulK1K+TB4\n7CboArEYpqO9Ka8rD4hqIuHUiLlQT4sA2PsthkMBVViqZkGatoTqTdkKKuU0\nNfjXc+/W3mllKiUW8ZXan0OMLuWPjRbQDDdA8i1uyj5P5DGmboZsKt9lnqzC\nb8yKBw10QUJCv36YB5uQTyOgNOli+p6PmVmq7XqAPlcBNPWDnuaeBVuexr7t\nIzQYgL4wE3Bl6kkvd8w0E4jjLv44h/bzLF0kKrh6/C0TpxoSxBpzqQyQ1TMJ\nBSxyYDnDRL8IeDn1QCBtvQnIvNkDHt+EomAlCUCeYeBHuICu0jcrCf4Mqr8q\nxMvopVIb4S8reGNuOczSSXNo+z5uEqV4HvF3COZ7g6oOcP/nHlopid0XeivZ\nSz2QUqNIptujz8w53E7Zqd1+g57seygm1A3apT62axIQmuxvJVz7VpZp2Bzu\nmLuvv7fXjTZ6gG64xC8oJqPYYCLbUAMekk/pQyotUwHmljaRXzizRwugSRJI\n8Mq8zAZNv+BC/YUQmNxPdgiJZTsoQdOOzhC8KqTOjiNlEybW/hzyCIwE0K7C\nXafmz4NMv/OfYmFqHXrqVTNFDQaR8cN/FXCJJ+nkW6n3QeibK9NDwuYZdURW\nV1M08x4aw+JAbqoYFkfk1yb3PVFBvsTylbqoMIKrDA3J+TBYnsu0+TEFZqvH\n2nuw\r\n=Sk4P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCeWSn3qEEFavEk38FRhGbBTnXhMZSwl+2QgBKydU1AAiAhGHWUnkNQIOMhkIacH9agFebYE9BsBrLYr8hqSEnEWg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.0_1553859629641_0.2605024324773053"},"_hasShrinkwrap":false},"1.0.0-alpha.1":{"name":"typedconverter","version":"1.0.0-alpha.1","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"tinspector":"^2.2.0","tslib":"^1.9.3"},"devDependencies":{"@types/jest":"^24.0.11","coveralls":"^3.0.3","jest":"^24.5.0","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert(\"12345\", Number) //return number 12345\nconst numb = convert(\"YES\", Boolean) //return true\nconst numb = convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = convert(\"12345\")\nconst numb1 = convert(\"-12345\")\nconst numb2 = convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\nreflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ key: Boolean, converter: x => \"Custom Boolean\" }] \n})\nconst numb = convert(\"True\") //result: \"Custom Boolean\"\n```\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.1","dist":{"shasum":"0a23bc38b0315be77ec792816fb55236f7b6f822","integrity":"sha512-msGEqhnnMVrq1DLKShpExLUS0Aw/0VhOvVcif2BImrGcLDGPxwzMC3j5dOvOVmLKiZseuqfYiXd9Gnu0wRPJEQ==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.1.tgz","fileCount":7,"unpackedSize":11691,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnoceCRA9TVsSAnZWagAAaKgP/1xC4wLsYRzksCkDS+5Q\n5xo2aKIQoP8JLBZRwEA7UNqDjMxxHYcE6homus/uFX0W/V2uUzfzRSqRVRfy\nWK5/oHfxi3I0YiZkEXuF3o7ch25OpBSKbNksSTleOM6w0yQ9KMLk+aejPwYw\naahxLT9kGp44CWDlFgBG1Ky5UHkGmdC/gb6Uno8UQLlX0O9iyTtW86gxy4wG\nfWoKCIpZWvFk+0cTAWu/07Sf9VJCyoMaPeLtBeVugfj1Z5gJnbVU1RFwaQfe\nH9hqNYuv2WzDovUTVG2TvyXh6iQpMwQ0R1OWoogXjqLjnAlBmQ7DrofsWqUq\nSYTMA+NsV65vQlZ3VcE+pd/69SBGh+M0CRa4bYrbH5GrTK+xkSnhj+N6L85N\nsNQigmg7s891JFwnz3E5d1SpMf5SFBmmxqpnN2oU/7m6zIRy33S8vyAeQSDS\n5V0rvYIDt0vWFLgTMvoKcIxBCAqs7U9AvG0MU8aicX9dTJoq28IQVtn8ZYm1\nKiE37PsI/CThOag1KSriPIYI66hSqzV8I3rk1LhyJ3axZ4xmSn9VbBYm1IlA\nWPNWed+pY62Gluqs2v/i//uxg0jIGvWwvdcekC24bXv0P32TvUCll076ZNa7\nqEymgfXJKR9jAijonJfAkhNo60w4csQZik59zuoQgyd22j1x7xhPwGd0sZFA\n1zaa\r\n=di/V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQgnZ2JP9llS5QIIsTUnleJSiIJN38rbx+2lJCZKjF4wIhAOZD3bFiBu31EBTwqH9Fap9Y+lVr/wv3kJ+/kTCF0oje"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.1_1553893148984_0.4367268068496686"},"_hasShrinkwrap":false},"1.0.0-alpha.2":{"name":"typedconverter","version":"1.0.0-alpha.2","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"tinspector":"^2.2.0","tslib":"^1.9.3"},"devDependencies":{"@types/jest":"^24.0.11","coveralls":"^3.0.3","jest":"^24.5.0","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert(\"12345\", Number) //return number 12345\nconst numb = convert(\"YES\", Boolean) //return true\nconst numb = convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = convert(\"12345\")\nconst numb1 = convert(\"-12345\")\nconst numb2 = convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\nreflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ key: Boolean, converter: x => \"Custom Boolean\" }] \n})\nconst numb = convert(\"True\") //result: \"Custom Boolean\"\n```\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.2","dist":{"shasum":"c1b47eb40f58966cccf956cba7d6d58ca2903653","integrity":"sha512-H7wKHBlsGwLqa4Z16JYTRiGt+3+BPrKKskAnAS2uBVwFll0PG1wgy8aUpk1Ve4t7BhfMiqi7QNZNKt0mEjYPoQ==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.2.tgz","fileCount":7,"unpackedSize":11784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnu0PCRA9TVsSAnZWagAAPM0P/j41vdTVtfcA2WThKMw9\nn2QrtBqx48fCCVvGdXakvLy3E6ZAsVK36qHR7U71wWPJaHT2DSXT17lnwREq\neZnWjWnVj3o5X3eG1wcXiCdlPe5Fcavw0MkdPwE2jYIwbLDR3DvFZTKxY/Xr\nImoOdTAUSH4Nj2RyCblB7O5+E3ERz70pAUtdoluXxT3UNzxSGMU4Iwnmu+nA\nkbq3nKisWbDKhkqbJoliXi9cP8rbn5wsl91nzoEF/5UdvbEtK0XY09Z3+fk5\nvAaCDCPKFjFgv+G8eRNAdu2lV01PzEF65sAAyVI5Wa/MIVfzSS/fpq8MxWoH\nqIRaC3Sc4aUf2teTx4PsNKhaed3IQwdJkxYT1ST0M6xWeCfUH0O0txlgXlBy\n62o0KXyI3kMCesu+arvRGsYeV5irKxzEy5/bwBfGyHsxXUq01NcZPrNO6hMO\nWOcOE5lBVIUn0bGhNTPM9rNKnol8aGxbdwBsOMCvVQrMd6S8i0I8+rVuKWi0\nfofpS5OLZEwxmLta3TKef/Mw4bC/jX0Vf/kfgLOtR74xIG9yzzWyoa516v2m\nOiTHYeugaZjfu/pFG2FkzdI2TvHPIO+mnYNzK8jLyMAitGRqbK7fZ4kxcE1X\nfsXDBD8wQLiNQYaToQL4+yiTXb0Mj+7LISBPcleUrVPHz22qdASo03tV55D4\n4j6A\r\n=1TDR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1ungAFb05ForhHjCBnTeiGMIs6KFmvZRIUQPJ9HkUEAiAzna5pZp8HtYxsiuJJofsXGV4mSMJkb/QoA3PIX81HlA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.2_1553919246868_0.8428065714344353"},"_hasShrinkwrap":false},"1.0.0-alpha.3":{"name":"typedconverter","version":"1.0.0-alpha.3","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"tinspector":"^2.2.0","tslib":"^1.9.3"},"devDependencies":{"@types/jest":"^24.0.11","coveralls":"^3.0.3","jest":"^24.5.0","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert(\"12345\", Number) //return number 12345\nconst numb = convert(\"YES\", Boolean) //return true\nconst numb = convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = convert(\"12345\")\nconst numb1 = convert(\"-12345\")\nconst numb2 = convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\nreflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ key: Boolean, converter: x => \"Custom Boolean\" }] \n})\nconst numb = convert(\"True\") //result: \"Custom Boolean\"\n```\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.3","dist":{"shasum":"77025c6a660f507b9305fe3cfcfad88ef9da8d2e","integrity":"sha512-EZ1qZHCLTLha6mFTpJDVT3A0qAopaTObcG/QE1lX1uMnMLmH6aH/7HIbTVX6NmHijMEOsliQ+9ZKzM01gvJ44A==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.3.tgz","fileCount":7,"unpackedSize":12561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnw82CRA9TVsSAnZWagAAYfQP/1hZXkRUBKbMHYg3RQ3G\n1xzhgE4VZzlHyi5uf1Lz3HXkyzbfhIh3K5HenSyiW/QqrZujiQxYm0hK/jPm\nXq862wxeL3JA7jOpoT1rjHKsup8K/cgoBUCXnX9+rd2MP2d4vxm76JlMgHtG\nonyk9ewFUj4SpvZnpabkyNRqep29d+ZN8uK52U52U6HdwCUVroZTcTzgely3\nO20iRnPNpKckxAPeQX77K9eyCJSmht/OqjX6rKU36HgqzM+FHlpjma2i6Plo\ni7w7nxmvWkpr6nlb806jZJQnzE8vnttUiLB977Art0Ccp71CtGURmCOlBhQl\n8EZXB0m1i2RaaieLjLw3G+YxdQWWKJ7+Zrfi547JPyO4Aapj0qEQ6AbrmKuB\nNQ/kvn3f+mdpytVjAsm6cGW/VTGFa1Yfaqyohjjt5qCUsO29F+MlE+hb1+Cs\ngn/mUaIFgGccjVCcnVcMp4Bl9dfAIdDVetXR7TTAr2F+eE8Pw9Eivgtjyesk\nkTcy5IgiQZqbpB2sxO/MJeSHOJdItY9OKT6fNQMW9Qp0EF34xfDNd7CXUyoo\nTm+tEHyUx99+Y79nsAxLz6kBmsy6tgTAOkJINn+xtHkPICZGBc6cv1KMSJEz\nH/J+C6c3I8rEheM9skBUSbkwuXxx5jH4sYypUukJeNHAMv34w0uXURMbygPc\n2+qL\r\n=oqMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC72JKPzwsyeL9UlWjdTyuPupLvDYGo0Y+qWC465tLANgIhAOyJDGm0kxjVNS1BpgzpL1YcE7BIo2e4Qjvly2L6yBTR"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.3_1553927990057_0.545151133013358"},"_hasShrinkwrap":false},"1.0.0-alpha.4":{"name":"typedconverter","version":"1.0.0-alpha.4","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert(\"12345\", Number) //return number 12345\nconst numb = convert(\"YES\", Boolean) //return true\nconst numb = convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = convert(\"12345\")\nconst numb1 = convert(\"-12345\")\nconst numb2 = convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ key: Boolean, converter: x => \"Custom Boolean\" }] \n})\nconst numb = convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = convert(\"1\", [Number]) //ok\n```\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.4","dist":{"shasum":"e8b50d0d81066b16d0b629247efcdbd8a84aa886","integrity":"sha512-VeUKzYd2XrNdERxCdKXfqGMJZNIDoS9+m0Te7GamlJJtFdJ3m8lYnuVeCg6jXnF6/26Rfza8puoiBEbox9moZQ==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.4.tgz","fileCount":9,"unpackedSize":17632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcooi8CRA9TVsSAnZWagAA+KwP/2HfeJyW1rtRFKHEyxAb\nwvDzCmGWZ4IeRm7AHy1QB/lCd5dWjEtUe8TQORV+ajX/e09hcHV0tK+G1GEi\n8QkEwObxRI/Gte98USdK8qj6ghcy15OcFE8w0kMXrpyfeAgADvoSZL5nGst6\nw10UPaEBV++hQAiNUWXhkfBcaaZyUUdK6NQxbGApo3s+h2klQYxofPzfc6q3\nt8O9Ryg8SI6/qHKD4wMtTkvIcCtvGwp37CLEq5a/ryyam75W4PBfHO3ydhyd\nCLv8DGVXHYJkQOVvurrSQCdTTBUnYN8hqJYJPlOU0MvSs7kT6ldC/a8kcbyt\ndfStmR33l/ZWzUS59sCr2ev3wY2VdyZQTMyJ7eLmik/vKF8GBr/IW2mvoeNe\n50yFkyhJUqdyaNrWMDvLmgKPCY08p1ZxN0jSjhB54pU+1JYg2Pb7yTXkeyGG\nC0sltDb4SOXvJtnW2tn7MsmrdYkn0AZ3USlPwkXhTOvoxfBpXeg1YwRLrQ68\nySooAFdreiNrjmSnlsxedjcp8/vnjZB/N6MGKV04wwj2qTzgBJ/jnJ6qSBtK\n1Cj9l1mv6kKTgHcQDo7bPAwNuN6QGV4XEyXCQHDz8y+XLFMZd+F4u1+x4BOe\nme6Is8XJfoufuV901Uo3mYICvtpVUrC2vIAf8fycQJ37gcjMxO0EfldheY8o\nNp2g\r\n=BzA2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGlHyfbZfakyhDdx+u1Oa73j5ulvxBrDJYvC2nAr12uUAiEAoMV5Qatz9/zEdDlRe7i1SYRoN6C1n2wXj/W9x5H8D6c="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.4_1554155707374_0.04442459705341073"},"_hasShrinkwrap":false},"1.0.0-alpha.5":{"name":"typedconverter","version":"1.0.0-alpha.5","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert(\"12345\", Number) //return number 12345\nconst numb = convert(\"YES\", Boolean) //return true\nconst numb = convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = convert(\"12345\")\nconst numb1 = convert(\"-12345\")\nconst numb2 = convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ key: Boolean, converter: x => \"Custom Boolean\" }] \n})\nconst numb = convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = convert(\"1\", [Number]) //ok\n```\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.5","dist":{"shasum":"dd9a0fde8e260aff04df252c287a2056ab6795c6","integrity":"sha512-MsD4sb+7PhpLEXoICwyokriGnTAfiT1tBut6ElFPz00SGpSP7m7ryXYGK3537l1d9VBkgfZE0bdN5g+r5NavaA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.5.tgz","fileCount":9,"unpackedSize":17745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcor0tCRA9TVsSAnZWagAAP+kP/3Z1kVLMqO8E3xNJ65Dq\nYoy1wLznuEsEZCBh0PeWI2MrPeAOBptLZs9tDGBjl0hfXIk83kRuVUYoDp+Q\nf31NCLJk2aKYxsQffFWH1WGAa9fFJtY/Y8hM+os0FIdhLFkncSz2i0RaY32R\nsvTtphpu6LL7+CwaczU7h/QRFiZ1N+t93CrnCm6Vj1n7dAopNw1peeDfv6ap\nFIFgaIlo1YKVpL90C+BFjxNaNhxWzK+jgojMd4TZC9wyK1RwFYlIZSaBsAGR\n4iRy7pw1s64/slCQfKir3UqGt+I+Siyx5x43vGUSXRYg7kKWFnI+EQnsmRh5\nvCCK0Ul9IfLKfrqYwIAFyqz+55nWKCK6Y1R6IVQZ/4vF1Gc8HQBGIcafin5G\nt4o7aimBf2g/6OAsBBASWbGCzAdrPc6OTNAWJqVm+0B9xy6FtYZpogBEwEWA\naKPp0J6CQ9OInx819D9buPMgB1o85jyZvyhlo4AJoEmLy5mB+2huBTGeRTEJ\nT6I+9RXuqQhlyhmbe36DocziYxzXprRNHpKpgh5QV5xVDL22l4QqEp2vu/b7\nKhOWNzWQXAYY0AySmlRaU1XaiATOauwR6cO1UWDF3O5J7wT/q6TzRH/OJTzd\noHd+xItIoqCf/qH0THl2TOIPjxfzJr/5Dg6Nyyudg6c13+YYzc6s3XJgFuoC\nGcdN\r\n=V05J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU3hEZxpiv8SgWtjLgzvGIdyZGbajD1CKsLc06cB80GQIgFthO/xYEvkEg6piwEmprdHTGuWQcO9b6sDtXkbh0Ymo="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.5_1554169132798_0.07320978381896559"},"_hasShrinkwrap":false},"1.0.0-alpha.6":{"name":"typedconverter","version":"1.0.0-alpha.6","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.6","dist":{"shasum":"4e41669c824dce738dc5ea6d9e0e0bbe67df67d9","integrity":"sha512-zSeiBopu+GX5on1h7JHIaKBHEmmxIEWv6VEClUMjaUyYQeaLkLOZJ3EFxSClYaEo3vGuXXhUciisHOzKyidB5Q==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.6.tgz","fileCount":10,"unpackedSize":22608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpcl6CRA9TVsSAnZWagAAwwsP/3jliImOO3l0PXh9CD8P\nXGkzAUz7BuTrYvV//F2VZfAHpVdIB4lP3fGkL+hOXB14R2B6kIpGhbJB5Rgm\nUdn3j5WU5WPvF4D18o13o5Yorx9WxSeMzZC8O3/3xgZwApSVouXR1q48RsoM\nxuYkdQdOkOtxmWrVKZjMiGJS/AiDcEUEY6LxWJJxRqoTW7YB9/WX4znxSlLI\nJ+++LfvX7XtyybIKzPMLHRoQOEqyRg0BHs1bn1y+fpnkQZPC9oBWj+ZSx3EV\nTy1s5BxxXIH8fz3f6JyjPANgHbXM09s8O0j2gN3cPFUF3JuFyw0hyq6rlBh7\nVRmrr7r9kFEZrAfHTl8sX5USUZAInqgzxIjtyu9x0FdrnPCI/spXcK0xIjam\ncjYDEenMPwflOP2/csWpj6VuRK3ROfP74OOr/ZswtbzTGyQnTzbtA2+XaSlo\njeg00n+2Lqms9ASGPUNOWqGKF+ezNxO+PnJyGBuhtZK1GO+ECvEo0U5gNSZH\npbFCtN++CGPi8brIy6ebU7vwX6N9xTjvz7uTh1RwNYgLPzczyghjybcvOxiE\n8eXDoX6CvCiS2xx/dPt2NzVqf/DqJqglpO0b/GO3d4DbcyyMqew7Ko1VpumV\n1xMDkP8mcqDLjtcW+F8pT01Qt1O7oIn6evMB7ya+8w7omSIcGLB2q0Oe6Bqw\nP4eA\r\n=PaJv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAfeLoajMsaMFsPKWUM2GCVPsm2RKnxA45SvhXXCpo7QAiBmUTYQBFcaXjRYQvuAZ9iKak5QM4174R2c9Y64NyAa6w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.6_1554368889380_0.7009835758684142"},"_hasShrinkwrap":false},"1.0.0-alpha.7":{"name":"typedconverter","version":"1.0.0-alpha.7","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.7","dist":{"shasum":"ba959276e4c643a2a7f85d582665ed788a07707a","integrity":"sha512-ZGTYY8Ac/UQmZzVhbKDNHq/xGSuDIFbKvlDcHjh+t8MmaGO0Cxb3hWJ5sGPQxLdZfGT8JPU4fpGD8o/x6ax0Vw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.7.tgz","fileCount":10,"unpackedSize":22774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp8sQCRA9TVsSAnZWagAAlBgP/3ipXfnLZwvuNu0JfWQa\nTFtPUdtDcB23CKVNXubZLJOebCO6mNhpjQXH9HzllsjYakNQDartw3p3eE4V\nreWSOOn6M5IjxdFIwT9SxxR1jH7NVzWPZfO05uU+IAGSgOuW41Uf4cJIsfKq\ngArOF/uHdoidnWn88xTViWpEl9vk6DIPoFIw95bsDUuh3Of6ITJXiFVZXnnO\naa6o1FBlob24Svv3+x3LUYwoti7kH8p4Fzp7tEyddalUlr0z8fJqb9N8lNTJ\nSb045doD56YQwNdLEwY7HmIubdM0LuC68tTCZUK/9Q27/L9TWf258pxYJo/E\nI65nXfPTOcB4NrqDYlWcsGt81DydKkZndQw8++6ib7P1gMHB1Z3FpbgZvak2\nm1geR63LhN0+udM97yfRVpQTEoJZQ8oZ5m+kRdxCqxmywj8KkrLqnGfH07Z7\nEqVN3bQfMNAL5LdNV+er3TY1yecTcGVsxqNMeC0NjMj/1KXTbNe26xmUr7m6\nupT8NkMt3IOVp9UfjWLluPbTz7wLoR/ZZkX+de2ZCzlHpvN4th+xL9bORwLT\nkGbcwMxHvtT5M6atUclnaAWDJ19iPrKs9RkOmaCWeleRKDpFJhyna+LDC3nu\nniD5rm+OGAVLC0/IiIcSgHHA5jo75bZj7vGbuh+sAdaxEuznRSDafzGM8quQ\nNEw4\r\n=/uyH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeS4vMPtHw4eh+YFlU6Y/SKoUfx+5FVdaXGc9g4m4vuAiEAvw7M0cak6A8ScmS0ZRG4++hIKLq+++b++xyGqXAoJVw="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.7_1554500366950_0.8600167019474145"},"_hasShrinkwrap":false},"1.0.0-alpha.8":{"name":"typedconverter","version":"1.0.0-alpha.8","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.8","dist":{"shasum":"d9ffd663b5133987933616a75ceab7f9ab1c8a5d","integrity":"sha512-j4reXU0gjugwQDa0FiUgoGIuaxnppiB64BDC4DuvShQllcSu2VflN2ICAiJoAr610Yu8r6PqELWMRW7/j5MwmA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.8.tgz","fileCount":10,"unpackedSize":22847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqA4cCRA9TVsSAnZWagAAA7MP/AnmzI46FNYlHEMK+cKp\nPRg9kQ/cuVoYHKahSokTm5re9m7vU0sorzWXg0RckfzA8Ml5EY9GqNrr28RW\n2woo3eRDKxwkuJy0lqgRHvZOA89w05KI0CMcZYQSosVKdAOS5pOhUKccSYlo\nVCfVMCg74Vl4DaWSJF+0zD1/xMyPZXs/u9Y6YW+KekTxyrC9O3iK3QDflfV2\nmSzdNxsb1xmjgKAJN1mUVNrxj03i3McdrZ5FMjXH5iU7Zmg4+3+hAoUQVqbv\nGtzDLr36WsQjxmKoqSGc8D+Ly/pqsZ2Q2lOYDBYasF0WW8vLL52LQR78dHHL\nz+JXXbzXG2A4LExpT9DSDjtwLzveF6eNKlJh6c/Wi+pNdVv0JAgERjlFGgPA\nivp2ADp2+hBTQjUcfZ3W2kb8CEZdB7e0kwYMc2G/iONnRhqhXpvKl+t2NeBp\n30uucw7YXTY38rZhgq/yGop4WMh5pLdcwdKSVyH6+aX4BGJq4EG0eTWbrsCr\nKLWD5qJdIPoZlVfbc0N5cJ8fw86mBXh8tqC0VW/L8QqImC1eMuu2XHBT1AT+\nIS/jvULN/UXgiGmXwIYssrnE5SxETVOenQ0jXIG4GWmXp4fWQVb4vZvI1BRk\nNBbHGhIuQNW9roIW0YTUwvyACQRPCkdRxXP3TndSMLMy+J0xy1ZGY9hKKsB/\n/h12\r\n=T4XX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEDLurCPuP/ZnC6alxnZMZYdLDiowp9F8v3GAd/mbDDAiA3v4G68XY95orVkS21JuwZWC5za4Oy0CwtNIEwnyNK2w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.8_1554517531266_0.7258387642000581"},"_hasShrinkwrap":false},"1.0.0-alpha.9":{"name":"typedconverter","version":"1.0.0-alpha.9","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-alpha.9","dist":{"shasum":"a7d1dcfb8847a3c16cfabd154e03f8c12cf7cef6","integrity":"sha512-UnkTR2AM+VOW2H/Hh0A7tW4i3oIRJqwrWfgD+BBl9F0AtEc7szbF9t3dEZGAe07MoulN6Dp54g8k4nsGscYC/A==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-alpha.9.tgz","fileCount":8,"unpackedSize":20320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrAjMCRA9TVsSAnZWagAAtNsP/2qRlnHAzVuBi11Pg7RK\nJSl7zwt3rIImyIQi3iW5ht3U6oiJkmT3kVdrN2UoljGet8op5FadLc8dfCxh\npYlTBQBsp1VO4ESMbiCIazspjJiGTyXHsIPbZ+4iRjOzFHOb6UwS49LQyaHR\nR3NiYJ43Q1DeFwPbiiYTfZZ0z0Qn1ttXphGGBW4YL+Ce3u7U8DAPj1+pQktP\nL7VfItatrZ7E7GrPCdOpwDnJnQWyFHBiF5iongRogIEqRXxXHQcTC6jU8ZaD\nfnEtSKLunOJq6Sh8PZXvlhmGU9K71Dg3m/7Cxsc65l4TWiFYVpOBivtCuXY1\nKRqnS6qpbyqJ6xa02Mkqwp4M/NWNGCBYiRCvgAl19fG9kvmA3L9OrlA5K9od\n1ETfSbpOZl6uOtYDQA6v7PMPYS6zueYVUZd8Swzs39BXqKGuOp1YMtBbWC16\nK+6O1b+MsgVGU+LxeBBZtPsO1XOLoGLfFG+NkhS7Nr4ki77dbp9Ps0lMnNO6\n+kYS4Fqe6+XswFuLY04W3asDBS+XwQW9DP14EJRUtM4V48SLSzEzIC+yJQnn\n4+NRuhKRwy1M3HtI6/tUuCOBuY29HSVRT8ud06B6ZrHiEeIeLpSSZ0r8z+DB\nURU0CuuaTCGbvuNu26Trrfl39jHjhsGvB5+/mFX3e3so4hlSNYnOPR1NtOOV\nibYG\r\n=GPDX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8xFY28FnUDSG3XOGcJsytS7vIkWP7LrOFgX6wBj8foAiEA+yZLRhX1QANb0+uo7xxY/wMTj9UpNi5l0Slw85EqmDU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-alpha.9_1554778315349_0.43706681459757357"},"_hasShrinkwrap":false},"1.0.0-beta.0":{"name":"typedconverter","version":"1.0.0-beta.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.0","dist":{"shasum":"cadd5da6a43720a5ec4b0244406b71ddfe6c1e68","integrity":"sha512-NzuGqVn1Vp1kP79jxTdeM3qLP56zIAmV/khu0/Rnvc0p/Qjo9j4CcXwqSo9hoCdqNnGFEw/+KMm8pDLntGvQIg==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.0.tgz","fileCount":8,"unpackedSize":20483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrBjJCRA9TVsSAnZWagAAt+gP/As6sxNvcVqLeoUah7in\n1WmJOlyETLyoslZxmFBioYXskWoz71EXGZGxFFFLqBY0ebBsV/AOzipGSVt/\nK8XYU7Yd9LN7t++IsWUPPhex8mAZlQjBDKmLJuje/wWSCz6XJdjg2l8ZC5Oc\nAvfxt6d+ad5D+QpxA06GXBEIYTdVLgXEGDaB0vCOsILBPMnnputWAe3EdHNR\nW+A9OVspYjz9r6GpBeSGwM5oKLZR0vHuxkyU6HjIDw8Mk43ScsJ0ggRaNLup\nTQ1MICGNoMMjjrhF+OTGODCs81x3W1D1M7vHJwl7zhCyKs226J6yEiJrMDuj\nk4zco/1aVwuCNW2yWT360wf8lUM62uraKiWkQxJNDJ+eJTSxAdsJVsiYjX2q\nVQXwL0Ogwtuap/lpnQfeDBufXfyIE8JDfrZZEzxGbpA1B8DK/ue01bC7gnfm\nueX9PIXtXKX8L9lkyVArHGJOEbBKuITC6Xnk9OpW0YwaRKozw751QsQLP3a2\nc+Ze/fygfhMfhhWA8iyE1tS0l2f/RAWKcZ2XjMtrlHmiu6pxfX01lsHOxL1n\nEsWQHy04BxhwxuOqad40fRtr2xL4AKcnHOxzM9Qa5vpw4UXQaYqciwhpJLYh\nMwppmnAr3UmlwkmmNJF+BBBHEBYp0iths7XuHDr6elAxR4FtrmVDEbFq93ST\nL6aB\r\n=TUVq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGn3S+eTvEIDTw1SFcfYa0qtStX9szhce0Dokl43ecvTAiBq6VIE0EwRcuc1iLQ2bpUcOAURsb2tvGCLAMT497FVeg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.0_1554782407677_0.7664921504551852"},"_hasShrinkwrap":false},"1.0.0-beta.1":{"name":"typedconverter","version":"1.0.0-beta.1","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.1","dist":{"shasum":"b3a9896f71b3ab2c246aff4933c2a497470f8d76","integrity":"sha512-O91j59EDyiJrEwLZnQLU64NywqN3IlPlGA5ge6dYSOO45MMrhWvFUm2n5x90SrVrsz/BFRa4+wqqNRAdHu1SkA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.1.tgz","fileCount":8,"unpackedSize":20624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrGB/CRA9TVsSAnZWagAAhTcP/icQxUmHusVvTBX5bg5b\nTdh8PA45FjWGIynaW1u+vLHpfQOKN+s/vOfjhMJBiN3xwbRSRe/AWCyGDPBS\nQTb63J0dJ0pEdEoSYjlk/5ozrU0h3tvTo0+GC7Nn8iSf5q24/YEkZ0IzaoSG\nWukh0nruTy7SI8oBFifuG7xNNVhojhsq79jbyrDmZrV1cz3p7rG5La2IGdM9\n3SK8+46ul/lbOC8ySnY+Yb6A4YULEl0VmbD/XUME24AJcS7P9F4XfqsdgmJt\n5mNDKPY4LpBqX9QfnG7AG+i4gEcxcVVY+KGlX8Ms5GI6+H167xBwQoEch0sR\nrmH03YP17ohXY1MLqIOQ3TSNyvfrHMzDp1vl+Zo2KdFWCvjKCMDcSOniLm6H\nplynYF+4a+8eXw2LuIzZJvDI7egpPKbjkQ4bRYKcsMxzOj+kurg+7SqMLJYY\nLLiJZnlHJmFcYpDu1EUUredsOs8Oy2Hx7aBjFKAtDYhSjDBp8pInxzhFws0s\nWKppLvPbTLOiIwG+BtlO5KkkFJYHl/VD8bCgHOjCC6ddFdObgWYu3N94wFfd\nIfQfEBlaprAB6Xv7OSI428E1D3KxeazaUlyekT/lKK59/f89PurPupHIq9ZT\npmB2Jpo+hJJkVSjobmpgy/CvMwzZ9Rx/w/zZTFIUiOASShCta6ulLQuWgMK+\n8FWJ\r\n=2sko\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRoLvI9Cne90DdjP7m6O8lhFQ9630sWvjnvXIC5pFcYQIgcmrcIgT2JHYJGRtgj1TSTY4AlWQ53xxMhgTQpPfPvnw="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.1_1554800766650_0.6983031597073905"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"typedconverter","version":"1.0.0-beta.2","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^10.11.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","ts-node":"^8.0.3","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert(\"12345\", Number) //return number 12345\nconst numb = await convert(\"YES\", Boolean) //return true\nconst numb = await convert(\"2019-1-1\", Date) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport createConverter from \"typedconverter\";\nimport reflect from \"tinspector\"\n\nconst convert = createConverter()\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    AnimalClass) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter()\nconst numb = await convert([\"1\", \"2\", \"-3\"], [Number])\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport createConverter from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\nconst convert = createConverter()\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, Animal)\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst convert = createConverter({ guessArrayElement: true })\nconst b = await convert(\"1\", [Number]) //ok\n```\n\n## Custom Converter\nProvided custom converter on the configuration \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({ \n    type: Boolean, \n    converters: [{ type: Boolean, converter: async x =>  new ConversionResult(\"Custom Boolean\")  }] \n})\nconst numb = await convert(\"True\") //result: \"Custom Boolean\"\n```\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (value: any, invocation: ConverterInvocation) => Promise<ConversionResult>\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `value` is current value traversed \n* `invocation` next invocation \n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.2","dist":{"shasum":"88323a5b9943e739335e7ca2f740139886ab1d6e","integrity":"sha512-7MyfLMf4gnB+JAnJt9Kv68aRuLcIdUVZPvn6V7BlRkCQ+Otc1plfl5hXcRZrEvpIeAuS1HRCNsmvGUOG72qx9w==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.2.tgz","fileCount":8,"unpackedSize":21318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcryxOCRA9TVsSAnZWagAAnRsQAI/Ot5zS1B+gx9TLDVus\niVOS8AfkBQoSY5qZDZtTefYpE6mq+RqiBrwgPe9ZObdQR/4d2THpF+Rycev/\nggKCo/NPepDBuYO6z8zjiUwfvqQjZonCSQeAj9T19gG5PN4ICUn8b65K64O7\nq6UjMm4kif/xYEHKv36+16nyM6HgzQdz6N5W/uMXyRn+yBp3jLX+ypmta3+E\nLko37uLAe18dnT6EE+Mro3kHXuPTb9LKus/dT5nxx5PHDbHIzliQeLnuSsLA\n2MKVCEpnfa7UouQfG9RtlvsfmkTPGazDBB9h+lRBZ1KIX91do9iwu2ZcdMPl\ngHxYLx5xJiMg016FdXdXbFTk6AlTg7xko+8Z/EFoMJ4wXPzEFQwaXClx1MJ0\ncgPZteYHNDIjcaPWy5edT+b++tC30hcwZr+j08SA2GY76v80s2WGfKYZqwuq\ndm94ST/BAh0TwDXv80CpXfpsD+X8OqJzqZDhKbYQ5eHjcJTILicPKwgUGgaF\neuD/y9476xhONj0KRaPmC/IsFGiWNIHw4LPn1WwDXmYfu99MHD/2485N4Wwq\nyVHHKOW32ZnwqSg1dxuDvMTDqOe8H5eHO+zM4mCR0WKjwFCd+4lziq3cJKId\nbksWPyKtPPpGMknFA+EYJhOn8EfszHePBdDx8maTg5iheHbn2qJCyjSRlt6F\nedoY\r\n=BEl2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDWsyhnf7QXWCql9SG4QCpsgnrlcZOIKDmnpYNOws01QIgZ/s3Srt236ic/RZ5t4H/FnCfUUrj2sCV/ZfFB8JL7tI="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.2_1554984013522_0.3788046974785728"},"_hasShrinkwrap":false},"1.0.0-beta.3":{"name":"typedconverter","version":"1.0.0-beta.3","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^11.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","ts-node":"^8.0.3","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport { convert } from \"typedconverter\";\n\nconst numb = await convert(\"12345\", { type: Number }) //return number 12345\nconst numb = await convert(\"YES\", { type: Boolean }) //return true\nconst numb = await convert(\"2019-1-1\", { type: Date }) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport {convert} from \"typedconverter\";\nimport reflect from \"tinspector\"\n\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    { type: AnimalClass }) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport {convert} from \"typedconverter\";\n\nconst numb = await convert([\"1\", \"2\", \"-3\"], { type: [Number] })\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport {convert} from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, { type: Animal })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number] }) //ok [1]\n```\n\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport createConverter, { Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst convert = createConverter({ type: Number, visitors: [olderThanEightTeen] })\nconst result = convert(\"40\") // { value: 40 }\nconst other = convert(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```\n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.3","dist":{"shasum":"572f7162515ec1e71cc40bea7504448cf9c5d020","integrity":"sha512-E8+eG4fd9zlgqFtMDHFB7BiikhL9zaLU5HNZMPlqUd8xo6oVob6w+Ec6MvPgTxmLV+WigDMG7ITuJwxKGWKY6w==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.3.tgz","fileCount":22,"unpackedSize":22045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFd71CRA9TVsSAnZWagAAKTEP/0fFlRmG85e6lGZuELyA\n2Rhje4LJSHaM+zDpUKyzSVjvQXEKlzFej2bbaOSWogHkExhazrzeKY+jxOuL\ntpaNzvpPYHJk+p04haOK2FVhLm1ARiG3GUrKRpnOGGY/O+OWJARBJcT/61XE\nN/RMRhNaO+ZmNwNdCWBJq+n5iHqTnqL55qxhdqe+7YpraWg92EXNL8YfYQrX\nuQWDSBz5c90iOnm4in+b/JnI1RN9ZDLBIZgWg55eIg9FpTsUEZqM5SsVuKvR\n0LLxjU2UrJIoe3kMWz6oNq3Pnj/nn2vxh2ck1pETMUbnz5Dze4olSLg1+dvk\ney2QIXadQguLhZV40/yosslCn3ouCASm8rVxEcLM3yURF4tKlO+M0XgMxpFy\nu7Qow8EZFv/hPJOcpJK98SR+r6DVgnWax61Lc00y+9IUs3iXi/ISK7RFmdYT\nMI7rRq7p9TQSaQWr5ZtWq4gOx4oU1qljB1skO2bEpTDqvTH8U1e4VA+SqQqb\nuSWsj7bmXyjyzwhJ9OxYDrytw/YtDYHhFEK80F3ylRycF/rAALwtcMeW+6iK\nzGbeQZkhfKc6x5tph49Nsz5j30zCBohafI2/pLMw41/pOYnQihijnkzfaEqo\nqgXB0nZ31OAzQ6CPSARGobU8V8f5kdQqRwEn3Kr/tuBjCUe/i3BjpsEvw0BZ\nxqcg\r\n=juny\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNzZx8Z95+qAxzOlBeXrvJwsOnDvYq+WTLeMvH5SiEuAiBys0mqjERUsArH0dXd9tCE89WSUmccihs1BTBENaueIw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.3_1561714420492_0.13225004782063188"},"_hasShrinkwrap":false},"1.0.0-beta.4":{"name":"typedconverter","version":"1.0.0-beta.4","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.0","tinspector":"^2.2.1","tslib":"^1.9.3","validator":"^11.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.11","@types/joi":"^14.3.2","coveralls":"^3.0.3","ejs":"^2.6.1","jest":"^24.5.0","joi":"^14.3.1","ts-jest":"^24.0.0","ts-node":"^8.0.3","typescript":"^3.3.4000"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport { convert } from \"typedconverter\";\n\nconst numb = await convert(\"12345\", { type: Number }) //return number 12345\nconst numb = await convert(\"YES\", { type: Boolean }) //return true\nconst numb = await convert(\"2019-1-1\", { type: Date }) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport {convert} from \"typedconverter\";\nimport reflect from \"tinspector\"\n\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-1-1\" }, \n    { type: AnimalClass }) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport {convert} from \"typedconverter\";\n\nconst numb = await convert([\"1\", \"2\", \"-3\"], { type: [Number] })\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport {convert} from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, { type: Animal })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number] }) //ok [1]\n```\n\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport createConverter, { Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst convert = createConverter({ type: Number, visitors: [olderThanEightTeen] })\nconst result = convert(\"40\") // { value: 40 }\nconst other = convert(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```\n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.4","dist":{"shasum":"c22ed1bd16441325875c5f9690cf559d36cc7fd9","integrity":"sha512-22ZFGpinZCV1+Ma6V8mzAdgrQ0xgMNwQlDG8JdNwkKXRTaA6B51xQKb1EuviJ5+VMjq7DAnJ63bo80XyOqNxdw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.4.tgz","fileCount":24,"unpackedSize":37767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdF+eKCRA9TVsSAnZWagAAkVIP/Ri0D0RHk5ocYDnl/QNx\n4iAG5LtO4BhQ4HoaYCnyfK1onxDC2EwZzQjJtbr0gONQrv3TspbMpReUvVjI\nJehgTLWU21W2bsvqaFFhfzkqGCH+0dteVlNDmDHp6XCyCxNARixFuR3zE+P0\n9BYm/k3Nzx+vEFqeCVe+piSvSllwRtglv8PVsQm7IAp9XJVCkxeKD8teLcct\nRVqVODCBIRm4d9TkFBfalJhJOmFhka8Ht1oaMho2MmcsJ6Lk6ZuQTW/2mPyO\nLQYdxJubRP8PjrjOq5nxz7RQh/eHzeLE3Y+BMH2zGCZYL2j3urKPQMfVn6mB\nAXUKeSd/PZZZEU7eBr/HQalPGCa9oW11QezFixVUWSTdj0AtmlbdXeQvomWd\nJTDCL7Cf9TM9E68VxqnfSXPyH2pqS3s00T/REHuGdb3P3gc8R7xyND4KSL64\n0vSrqFhfl1EC0yApR7/tOhMXWjJjPE7hd2D6YVeYjmhf11DFbKJaBENoNYPa\newgXSiWytzPxJkF/wqplLgSyPcYT5AJ/iAnUCrYRxVxFneHGCR0CxmQEwv26\nk729AvYeOcsVcWxC2h/Zch3mNVUzYD0uehRsPsrGEGmm06oFv/nRox1WZBvN\nf/ZevlU6xPg0sTLBGIy4QEDH8HjVePDBslr+5vo4sGk4CWcaWNYImwRtyPyC\nzVti\r\n=yCU9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2NqAIJlXurNGztnpflNenh8u91id0lS+7Gfzk/Y9PGgIhAI0c9XepIbKSoODADtj6bWXWW7jEiufJmkui+Sv/SgTc"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.4_1561847689996_0.16528332384325894"},"_hasShrinkwrap":false},"1.0.0-beta.5":{"name":"typedconverter","version":"1.0.0-beta.5","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.1","tinspector":"^2.2.2","tslib":"^1.10.0","validator":"^11.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.15","@types/joi":"^14.3.3","coveralls":"^3.0.4","ejs":"^2.6.2","jest":"^24.8.0","joi":"^14.3.1","ts-jest":"^24.0.2","ts-node":"^8.3.0","typescript":"^3.5.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport { convert } from \"typedconverter\";\n\nconst numb = await convert(\"12345\", { type: Number }) //return number 12345\nconst numb = await convert(\"YES\", { type: Boolean }) //return true\nconst numb = await convert(\"2019-2-2\", { type: Date }) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport {convert} from \"typedconverter\";\nimport reflect from \"tinspector\"\n\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-2-2\" }, \n    { type: AnimalClass }) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport {convert} from \"typedconverter\";\n\nconst numb = await convert([\"1\", \"2\", \"-3\"], { type: [Number] })\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport {convert} from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, { type: Animal })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) //ok [1]\n```\n\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport createConverter, { Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst convert = createConverter({ type: Number, visitors: [olderThanEightTeen] })\nconst result = convert(\"40\") // { value: 40 }\nconst other = convert(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```\n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.5","dist":{"shasum":"c98affe092676ae50a1bb5b63da3d24894364696","integrity":"sha512-2tsPY1xiLAp1Tdcyg5j69kMLD9/anqM8XY/i8UfjJyYWzLfJAn0YePd/xO02ti34eVWlbEicRy/UkQZrgcGXbA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.5.tgz","fileCount":25,"unpackedSize":38864,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdG+EKCRA9TVsSAnZWagAAZCoP/3YdbjtCEhLHjqkM3Kpe\nKGiV3zXo97p9HU24OZE7oIvk4DQ8B2hDG58zF0FdNshfhEb+mTVChQSSoGr+\nAbI/gjsTLRoR6rElo9xxuycTBGnqANGNyKytpUybL1uiJ6ZHg27IXxJt9Ruo\ni7/HzoFRaDIYIrSq/l//V/2lmfrxbDMnS1nqDvarRAGK0pS15+SGkePno9qa\nZIWxqJ46nAATGoPL97f33RlerwvWpi8i8dR09rW6VZ3dmd5zSsUaM+rVwnzW\nqZ2Kaae2COOjqSOvm4fwxZe6OkQCufKeN04jZb0JvxG02N72rfMZ2HNkb2S5\nS42SckrYwiWXJUTEIz4EZYHhwm7KvNT0qfon+PvDCmGOK7SEbf2rjz8po1Gb\nWQh2XDNxA3f9f0C93YB+hWhmfSqb1qC0L2k3rG1XOtsQmyuO8l5qL5NDqDlv\nd7L9ESp/qopI8WWJEeL/8TzcQluiRZjQWYQVqh39XC09/d8JhZcE9SQRJTD7\nAUobLVOYxDCc6jScfblS4jj+zR6oF/2VmjwzVY63tHdtR7E0UnjzwsfX0sCV\nf/mPofRVt/cwqLAOqqqbw6H6hLe9xq8sdNifWpiM1B39Ncp6WgmKZyFUZnrP\nZAgke2pdqKe9Gh8ONlCKjFput5ttn+hBHpdsOtW95BcXdba2Nl8R9sQp7XRU\nG3sU\r\n=CPmq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD02FfkvYvh9qSmhcGvxZQ3M/pxQl4/4I68SoLLHeyQowIgYG0GYF16QZhZxaRrgF3lY/s4WRhM/dy8XJGqmiKamxY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.5_1562108169961_0.5493928171376727"},"_hasShrinkwrap":false},"1.0.0-beta.6":{"name":"typedconverter","version":"1.0.0-beta.6","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.1","tinspector":"^2.2.2","tslib":"^1.10.0","validator":"^11.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.15","@types/joi":"^14.3.3","coveralls":"^3.0.4","ejs":"^2.6.2","jest":"^24.8.0","joi":"^14.3.1","ts-jest":"^24.0.2","ts-node":"^8.3.0","typescript":"^3.5.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport { convert } from \"typedconverter\";\n\nconst numb = await convert(\"12345\", { type: Number }) //return number 12345\nconst numb = await convert(\"YES\", { type: Boolean }) //return true\nconst numb = await convert(\"2019-2-2\", { type: Date }) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport {convert} from \"typedconverter\";\nimport reflect from \"tinspector\"\n\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-2-2\" }, \n    { type: AnimalClass }) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport {convert} from \"typedconverter\";\n\nconst numb = await convert([\"1\", \"2\", \"-3\"], { type: [Number] })\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport {convert} from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, { type: Animal })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) //ok [1]\n```\n\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport createConverter, { Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst convert = createConverter({ type: Number, visitors: [olderThanEightTeen] })\nconst result = convert(\"40\") // { value: 40 }\nconst other = convert(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```\n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.6","dist":{"shasum":"2fef7d8abedd38d8bbc202173ed82813e7b3e41c","integrity":"sha512-p5YsIJZ9Mrqf2tema/PB+MnFkm2GbQ64wFJWhI+EuF6i0oJf95MyZi8O3mq5nDSAFn4MMMWg4CDyXM4TL0tRnw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.6.tgz","fileCount":25,"unpackedSize":39649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHFCkCRA9TVsSAnZWagAAFbYP/1+bkq25ITXXHDFLs4fd\nIIwIDzOElUW9OFfiNqmqWrwFUt7tYNSJi3kIeMiVQ45fS1lOsNkwLyXK7Ict\nM9rxk8Da6iGMNCmp/MD+H7Mdbk1n9kMCLbPRxvJrHPcn3sgz4iwgH7ZC7iv0\nHOfF3zITm8x6cfVc1r8QiKRXOvRCaPk1qhtidPJ+MXNigkEDhG9GHLadqVTt\nv6kALBdDwi1tvD/7yAETxTRvHdTYuqum+mUyos3urijU04tFd7chW5nt/+AH\nWP21/UqPe6OJLffvikgQFf9n2mgQNC0Mu9kKKLCGc5Z+Xey0aP4JECwZSUNj\n8A/Z9M/JVi6bjcrbKITDrKKRkmdvGKfSRm3mCBwD+uf/3+g3JOXmpcctk4IR\njgpHvez6uNV6xE5BWfrE6Kd93kcPSlQdFhNKqLEbRxu1xNadB5YvMjs3ybQw\nidMQYNkE35vvLjpIjXGuzBcO0MGO7DlKIuJqKNODDznFGqR/NI4soKYBFF0+\nyOm/ucAmInFX3NH/i2EvXIHue/n9kGacvPkCbeZZdavvEjhS9t2mAlyoPAX2\n2ZFH6OKA1ITFxaqx6TAwBHNqa7NUAl9v0WCeHaV+mD73R5PJjXyzx7QyFVvs\np1N8vP/DpIMmT0Z8RI6uEHJilyluWZOTLcVSGFV416aBxj3chAdJBDEuDGHt\nlbiS\r\n=uJMr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjCVl+jxzN3hEEvPEstW7qKO8JdsD3VjgvaZAC1LzXwAIhAMfUnAz/fMMhwFQlQDISO8caupLod95tB50MB1kn15nc"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.6_1562136739263_0.3474028079583964"},"_hasShrinkwrap":false},"1.0.0-beta.7":{"name":"typedconverter","version":"1.0.0-beta.7","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.5","tslib":"^1.10.0","validator":"^11.1.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.18","@types/joi":"^14.3.3","coveralls":"^3.0.6","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"readmeFilename":"readme.md","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Convert Primitive Type \n\n```typescript\nimport { convert } from \"typedconverter\";\n\nconst numb = await convert(\"12345\", { type: Number }) //return number 12345\nconst numb = await convert(\"YES\", { type: Boolean }) //return true\nconst numb = await convert(\"2019-2-2\", { type: Date }) //return date 1/1/2019\n```\n\n## Specify type on configuration \nExpected type can be specified in the configuration, than you can omit expected type on the second parameter of the `convert` function. Useful when you want to covert several times without specifying expected type. \n\n```typescript\nimport createConverter from \"typedconverter\";\n\nconst convert = createConverter({type: Number})\nconst numb = await convert(\"12345\")\nconst numb1 = await convert(\"-12345\")\nconst numb2 = await convert(\"12345.123\")\n```\n\n## Convert custom class \nTypedConvert uses tinspector to get type metadata, so it aware about TypeScript type annotation. \n\n```typescript\nimport {convert} from \"typedconverter\";\nimport reflect from \"tinspector\"\n\n\n@reflect.parameterProperties()\nclass AnimalClass {\n    constructor(\n        public id: number,\n        public name: string,\n        public deceased: boolean,\n        public birthday: Date\n    ) { }\n}\n//return instance of AnimalClass with appropriate properties type\nconst data = await convert({ \n    id: \"200\", \n    name: \"Mimi\", \n    deceased: \"ON\", \n    birthday: \"2018-2-2\" }, \n    { type: AnimalClass }) \n```\n\n## Convert Array \nConvert into array by providing array of type in the expected type.\n\n```typescript\nimport {convert} from \"typedconverter\";\n\nconst numb = await convert([\"1\", \"2\", \"-3\"], { type: [Number] })\n```\n\n## Convert Child Array\nNested child array need to be decorate for TypeScript added design data type\n\n```typescript\nimport {convert} from \"typedconverter\";\n\n@reflect.parameterProperties()\nclass Tag {\n    constructor(\n        public name: string,\n    ) { }\n}\n\n@reflect.parameterProperties()\nclass Animal {\n    constructor(\n        public name: string,\n        @reflect.array(Tag)\n        public tags: Tags\n    ) { }\n}\n\n//tags is instance of Tag class\nconst numb = await convert({name: \"Mimi\", tags: [{name: \"Susi\"}, {name: \"Lorem\"}]}, { type: Animal })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) //ok [1]\n```\n\n\n## Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport createConverter, { Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst convert = createConverter({ type: Number, visitors: [olderThanEightTeen] })\nconst result = convert(\"40\") // { value: 40 }\nconst other = convert(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```\n\n\n","licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0-beta.7","dist":{"shasum":"57b4e156145597dba10a5fb3cb06ca8c2aa3a66b","integrity":"sha512-YPVCqGaR6xQz06VqEM9txWBpRJqXgg92um9wHB4QFVkQ9l4H5oU/t9DKjhHggsVv/ocpU+hDY7dHxuGhK+nWZw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0-beta.7.tgz","fileCount":25,"unpackedSize":39649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdib2/CRA9TVsSAnZWagAAtBUP/3zu6Va/Bu2HWGTzfvCM\ngpGiocyoyW2op7p7M//AFOJ2IlQxl6EwBJsMb8NVHwPp0UXZXWI6aT0sJI0N\nQtcbetg9Og4/fttK4YaihkBqnoJKLS+Og0ugcQAUhOhA1SVPHVpI0myWvFNT\nmI3kxvmSupCAwT3j6uSq91/tqUq1lWwewwAAS1kniybYlS424CDWI8etGE62\n2KAjS27jzPWv1xRF0EgckwQEd31U+MglgsklZUARf5YRFcc19x6HSxuMJTWB\ngsT7+hZ/m5s5Q2XZuLk9MzzO0ZSw1ZSYHli7NG/v6rzJJ9csRbhcZ/YqOw1Y\nt//sqEFA23elPp+EsVJ5V3i40cmQ6p13refcPgjuJZ1ma+9xfE+BYv8C0cX7\nN4BtcWnHKWhawdzXgDM0IlVvD3GAZXMGV5SdsHYOr/vOoN6GkDJeOshaj54C\nN1zLT8xdDYVLKkg49c8s54lpSmcxJCAQnts5HmdlpPDIFhPxk6dD+Hnubwgr\nibSzNzwXxEf5zxjSQpRJfzPNhw/mF8c6Fv5nY7OGJOcmOX191KBwsJjaUuyk\nPBmUQs/ccLGTK4mRIFHRoyACJZbG2uZ5ZoHaPQhWx8CG2yK5b4PNOekfd270\n26F8F01zTqIwSGn9l/8hpx2kNe0aBhDgqTIqIg/3v2gCNvTp+F/bE8wA6T1C\ngrbY\r\n=4QPt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP6Vg3ENpRXjPtBY3g4ZB+cmRJgFS7ZEcu4y4h/1/uzwIhAJa22lDtJKbsJ+iE+JCUMbv0O3/jovEDG2YEvUu5LV5l"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0-beta.7_1569308095369_0.5034334849136819"},"_hasShrinkwrap":false},"1.0.0":{"name":"typedconverter","version":"1.0.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^11.1.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.18","@types/joi":"^14.3.3","coveralls":"^3.0.6","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.0","dist":{"shasum":"bf73311039cc75e65a2632cdf6126beb3f432e7c","integrity":"sha512-qhXEXW8FhfRiRFmg/FS/f2aHJT3rphos3JQZNrHswAl46T3VFuibwEGQRFyQhZWe470gMQ8NpPyIn5FGgLSEZw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.0.tgz","fileCount":25,"unpackedSize":39642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlxnjCRA9TVsSAnZWagAAZ+0P/2+FPxicdJZ135Rsdfmj\nmDSTsY/SixOx5N73+f3JddOJc+N7v5OLt7sfp8Sl9y72OQWo1aICOPO5y+w3\ntMpjyDrgpV5KdNx0pHnOa3EuCFrE+9OrBR6nu4FzRPsCQMIPRmbrUMtHqcmM\nkUAuLHhq2rf79admodc9VdGQ8krRUwbdts0IFcI0Dz5nTueINZxr+FtMfDwJ\ndTWjbaYVXlZQbZfEBOqnME9zYYpoeOevkZT4hotij0FnK7sVEmkujNYXXIvn\nWNRByNvkV7Nf3QbpnfuB4p6+WdgJJSIhQH2MWbF52XuV1x+dkTBBXHy7BpW0\nw7RICv4PG03yV/Ws9q0774o4/tMtI/sUPtWIgDC8PCQMK3D/tLz+/V7b257e\ns+xJ3UIOzHCx2I1k/31FwmcM+d8P50M7RDp2jQfF0dn029w1YC+w4R2UzOFR\naifL2d1Kz+QqXSVJelSZ7z7DUvz50YkmeQDl+K29mznA/tOFBMdeYf7v4XYt\nCldbVdQ29nCpzftcZ0A0Ee+Y4IiLKUR6CDs9wrwU1NTF7E/d93ywPeh6/IqN\nP9/ECcfmE7+La4900bixJX31rJ3RRaWcUQl4zt6PFKHZiE/WnkbNqAsyxR0+\nfKsrAFCuwG7P4qN6V93lAIP16hwlVHVK1dBA941auKCZBrTHe2ZDCh/MuQqE\n1Flq\r\n=Qjlo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMExq4TDUXqVpb6OQF0JH9vDwYLs/Hg8DaYPcZ0+9syAiEAh4z2k4n7yj71tISEsmw++FdA1rZoCA2NUjBn8NpqAhs="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.0_1570183651372_0.8005800771207907"},"_hasShrinkwrap":false},"1.0.1":{"name":"typedconverter","version":"1.0.1","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^11.1.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.19","@types/joi":"^14.3.3","coveralls":"^3.0.7","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.1","dist":{"shasum":"356b41be7aa4a8e9015e224c4ad6028ad782cbd9","integrity":"sha512-KmMtGPtjdjWSvvAptn0vvWCXG4bx591WqchpQU0wL3keisL0WHsQOFxaSdU875QrhFFf+SamxWoXALttI8lMEA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.1.tgz","fileCount":25,"unpackedSize":39665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsVXhCRA9TVsSAnZWagAAzn8P/0p65Ps0T0yP7A/KvqP4\nvtUb+zN5wnvVW/6cQL/ojmLeNxKh7JaF1woJDOeyg2BGhX1r6fJ0RGlfNBo2\ns22magwUu1/OrIaMsZSJkMYxwdDxj2k+uu4/Q+psHb8q0u4isOo+5RuWRbzv\nRLADhE7HqKUqXkMbhREiLXVYAO3yiK1XmOtYsxo9yKMYxSSbwOXLqTk9b0YL\nDhXBaXOC9yl3CHDNVMuoTt964ngZA6sYGsHdg2AYW0uV+sW89Ovk5KtXTFya\nNlbvSxsarl5IBdWu5WENCKfR6Lu6bALPXQLwiR+I/ZcXKLUuPTnZ9w804FoU\nSMsvOMO4LzoaK5oN4L7/g1mbO3lQik0kOf8M8Yh78wZBAYNbzONIsFdUDhBT\nQQRKfeVCRniTJb1bv7r3HZVTD4wuWUDuPVpvhpMutpAXhgE+u3rcynMvG543\nqm7daf7H/Nn2JT+3WrdWCDM9iq+w5raN8lBxtOogqiOTZdhrZfQxaLFjjH7u\no6qF8yzKwb0jDHiAPWNx48bQ+XCzL7dagozekPX3ifUU3VrkVzTaZ3wDo6Ta\nmF6p42kFhOrBEFckhEcBLOAA2N2sfikRhGftE3XR9b1dki4GkXJSsm2j+xzR\nvr8OrAI2PF9DD8COne8DSD/ecpIWzj4FycHIWPUhqIpIZFt9BCHW5UfQ43IE\nq4Ss\r\n=L6IE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYpszVVDHQK+gE5K36+sF2FF0VcZIEaj/GRhfVcXhFmwIgHTIijvJLewJpwf3BCYXpD5Gfjoi71yUWejyd4nwt/Ak="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.1_1571902945176_0.5924605038024877"},"_hasShrinkwrap":false},"1.0.2":{"name":"typedconverter","version":"1.0.2","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^12.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.21","@types/joi":"^14.3.3","coveralls":"^3.0.7","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.2","dist":{"shasum":"993c465a7d400e1d2b02290179cf163c5c682e98","integrity":"sha512-ubcH4rxQUVr4Px2jYhmdjzpL6QhLQXUB5aG8hpiL95sBYUC20duLECqfw/FPKOr1Cz356s6ntiQBgC3GSkbQKw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.2.tgz","fileCount":25,"unpackedSize":39737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdu+7DCRA9TVsSAnZWagAAlDwP/1YkvO4YXfF3AYyRzhIp\nnDJTwrqOqJyMz77hi/ChGCfGianjUcTdS+Zp0bSU3dbq1qrMu0etC9HmM/Ql\nMZuOI/ZLlAd5BH3CJSXMHl/GNR5zBpL76hkGltodzys//rR6bwtHtX/mSeoQ\nEe6HP/J12J8eRzthH5dEpxltIqKcES6tKqsbbkBxrE1jpmSl8GorCcOfIl63\nPKIjAx3p+xC5SoGDpQDNTtnhR+WivnT80oh9g1i90ZXwr8b9ZwOjB/YZG6FM\nqvUYq26Nbv0HIJucCQGbJIec8X3x3btNHl64J5g6gSgYXvnM6tyVhkBmPAvj\nstYB1Z6bYBhMM9OPwwG6OOFopXD1rM2ds4/mPcLH3ClfldSn6JrK4zIrW3nA\nE/r44CSbFfuFH5TS8PVWkhMh95g1yT6TtH1ZCK/ujNN6p6GD0WN6h7wnhgT0\naqEFMKh5xeuey/I4VKFNeClTQkfbdEVFRB6w9japg37sgX1zIfcJ5LHxhvt2\nrfmluxr5+D/fbhNYx1ugHGtUSYShSzRWQOVRNhjrKDblSOGKK5PO6xma+a/j\ntqPZtpfi5K2FX12I2M0UQAYNnxtRnfYPdHSyCs17DbqTSK2oQTDM4siz6tpu\nPoD/VcirPNTmBDWSjtNiAkqsybB7OFj3ou/HrQqDkBzO+cele2BtpTD6duAz\naIho\r\n=2UGy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/2NEBovCqBZFwshg7TW74k3fnIfs4KYMURDCras/fdgIgaQnutRUtlGBFfDrqRGMil9X44dUXdCP5zZEwgATQobA="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.2_1572597442594_0.47837171099151377"},"_hasShrinkwrap":false},"1.0.3":{"name":"typedconverter","version":"1.0.3","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^12.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.21","@types/joi":"^14.3.3","coveralls":"^3.0.7","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.3","dist":{"shasum":"91d5537365415855401d0fe90a85b2a8c0568b6c","integrity":"sha512-IgDSwM34KFGXC+wXeKohoVjcHe2IJSARNQN/Uy0Ijsr8UGPfwyReW7eoHCw1TlLHovu38m9OGzfszYYC208bDA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.3.tgz","fileCount":25,"unpackedSize":39706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvJJJCRA9TVsSAnZWagAAtHsP/Rd8kkPS8zEF2aa3Jnbt\naHhnAJRQ/WT4RZDAUEZJMA+g/oKfVv+/IvnuqK+wbXI4dlnCzSv5N0KQx+2c\nt2T9ggOl235RV+YuJe3VMeA5QVMKCvHoHrlSoN2dQNEvktlM/DgBhXUPZ+C0\n1wFPPYr1LuJHtZ6UUOG/ufdwRbDzuwk7NTG+z9Q3Fxq4lbUqWVL8CCOnH1v6\nttevRM+D8Sh/Kk8Eb8a6HsPkHBqPVR6lb3me7VVMtQObr0b99h37TnESdQxx\n/+lba3EBDjFcWZm99zzjNaf8Ylf+lh1GxxyQhSftuLqqZV5zuqGBm5kciCi6\nqAQz9atbPrcMoqtyUPd7RZf0T4LOOnBsLVkFV9gQ8tSeV4wtULK0theVsWMz\nBMuA71JrUcHe583tfVaYndt37sTU2vq+aWfOHLKkjx7gvf37VvtJu1RiNiTw\n8VbnE49tsNuwUKaLtB7dj6ykCMGJpCNqE3FI91Tv6eBXqrCSZOkaYVQSYJrH\nI1ImVLCbsL/RsPEzVV0VzZmslNjhvM/W4M+GN+Iz7EpgV/D8aeu2UcGVuuRc\n417DtVwtHngq0Be/vMfgXerIXqxxxTwgXPazH9SwL2LQiqwVTLEBFetnsCq+\nJg3GqNAoaMxSnM38H3jgm1IcxNjWoJ+qwHuc53IL/iA+5KFmYJC0xg0tEPbf\nZ+Wu\r\n=YtRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/i7xboqUCNKxo2rhBfofZUBmjVhoclBigo8Pq8joGHAiB+/ieWySVXzbayKpmht8rEWsBUR40bvIfVT+j1VSM49w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.3_1572639305110_0.016026222324050154"},"_hasShrinkwrap":false},"1.0.4":{"name":"typedconverter","version":"1.0.4","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^12.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.21","@types/joi":"^14.3.3","coveralls":"^3.0.7","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.4","dist":{"shasum":"b716f77006833460cfe43413af0ea13afeda829d","integrity":"sha512-bn1T4RS4TSSY1tAZTeZhyM6p5grqUjVe4TtZVklCsaRLXLxDg1KbkO7Eu5BQlDgIQAtXz4MRdWY4GeG2Olisdg==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.4.tgz","fileCount":25,"unpackedSize":39753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvgrKCRA9TVsSAnZWagAA8CMP/1UHfKSNDykR3n8jHCoo\nsNZzFhix3y10nRWQU0kMRSQ71hT9IOCOElZHdr0H/J+n+MqOQs9208uJ4hfw\nKKnJutZquyg5Dc0rwTfN2fsJ4Mf7vQilIMUPrtl0YSupClOYI7VvGvULRN6W\nESNO/YP32yxZ/881Bt9NGaw0XggQLCsL69ZIocRzsQU2Xg2XklzHx0aoOw4I\nTM3S8dZJd2Us34uNd31l+Fsds48WnZf2YlxuT9g5YBIyC4Ey8AKkWjT/PHp4\nUCTaaTIia1LL6gSK0E+o1YoUIbA7tXfT+4LKwl2FDOJINaq2LPWsz6FHUMdn\ngGe5sLMBm7Z8ov2oW3kAabAgNJgse5OLWGCIMH17zpU9y7Xv/BKS08SOSRtZ\npVw9qtBUNIe51/9PCjp6+NzPAN1dV/2E757a8u7p31LlpTGn541fagiLkzTH\n8Fz7fwHaCKbTL9IcAd9DmrhUMxwzPJtAnkUf5GLaVvfC+MVeOzI7X0UYYjXI\ndHIph1L1O/AqXOQmsXp4ArHPsxuEHs8eRPSCObqMGGmkQZDHQSnRZvgWgj7P\nmUpD6rl7zjnAUxP3yXlrc2KhxxomkZWWjpexNusCWVi42bQMkOxkNG0Qv7pK\nE/hvsJcsoiAYxY07AOlaWlyjAWrMe0i7RWJDuDLLfxhm19SRDLw81oPDzgxv\n+qjx\r\n=NHAQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPrfXtVYhXRe28lfbRR5w0vjYysGQkLN/TLUM3d8l9SAIgIA14BDId0AjcIIyXOMWnwH1A+RDVqFl7iQWV0UuWyC4="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.4_1572735689681_0.26562138532754953"},"_hasShrinkwrap":false},"1.0.5":{"name":"typedconverter","version":"1.0.5","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^10.11.3","tinspector":"^2.2.7","tslib":"^1.10.0","validator":"^12.0.0"},"devDependencies":{"@types/ejs":"^2.6.3","@types/jest":"^24.0.21","@types/joi":"^14.3.3","coveralls":"^3.0.7","ejs":"^2.7.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.1.0","ts-node":"^8.4.1","typescript":"^3.6.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.5","dist":{"shasum":"413bf0767a9fe6bce233ef0bc0c8532e3adb8326","integrity":"sha512-LksHfC7XHbUNq1aCUcMvtvdLlLa01X7xUNV/cJuSpb5Zy3hzQBXZYh+i3lLDxrfiYfMmLiSezRpTPQWVwVZ91w==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.5.tgz","fileCount":25,"unpackedSize":39858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1I0bCRA9TVsSAnZWagAAkXgP/3qen3TfzlwFOu/PLTpH\nHGY0MjbigXIh9Bwb8oIqm0KhMgNRNoDi/DQuKs3mfyp51FhgbNlwM3Sic3CA\nhk6btYZN/E6RAP54gxYk2G88IZRS05/L600eE1A3EaMkTZwB2l4pU1EnsOOv\niJfFMnPqUxxTl54szfiNPtLhbdUbiUKsBy3Dyvm2PrckVlzy1TB93LgCQjnV\n8tJB96droMFP8gH8r+Wds/sB+rsxlwPnh2mJiIfPZAeQL0zBFZHnIeFAkawN\ndgd3JrRHvF+137NsQmCFcdYNARz3bKVBIZuldSVnZe3cfxhMTw4cFyoX/JbH\n7jmZwr05EPwmI9s0qT0421Lk7G0i1xT9JKkPNWKbE0kxxbb1t4qR2zgcaeDf\nulteXTjEMJXYLSrRfG6ms3rob2ang6a22rRjCwbzsR8VPOFOIdBwB7JSa53l\nH1Y4ILyQJuSEgrlh3rXpA+NG875V+ig7eKINuTJofgIc7JMpJzpPxvNv9mrU\nOepTT8pXAHDIpCuoZj3c3EW/udbKM7zm3NipunRJoP/Vih3AE1dxJOs/ESQP\neAL10KsFRV8ca8gR7Fjqgv4cRpuEgxe3+E5h8dZPMwdAXpRs2MmnJG3Oeqvt\ned0anYKxYmMskHNfCtRnyd8ULGFusayD8gH0oIBKHJUMxY/NEs2d3+frBcBR\nxFZU\r\n=QxmN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmQpwvhfqqTBAEMM/8BWy9RQ1FmH9AwVU0wgTP04SsMAiEAi0ovRzQ6yD0sCp8sIzrS8yXTzLmp0BYVxhUqxV3P1wU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.5_1574210843514_0.1725100494441052"},"_hasShrinkwrap":false},"1.0.6":{"name":"typedconverter","version":"1.0.6","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.2.8","tslib":"^1.10.0","validator":"^12.1.0"},"devDependencies":{"@types/ejs":"^2.7.0","@types/jest":"^24.0.23","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.2.0","ts-node":"^8.5.4","typescript":"^3.7.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.6","dist":{"shasum":"6aaec0e42e3bd7d2c1c7625be15ee936269a5bed","integrity":"sha512-TjuK8oe8KMg1IeLRC3ub6BKSYpFv0PJC7yv/MPn6DQait/QAssenZ2KX1/uq0iui83btpPPZjVNdBRX3BlefcA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.6.tgz","fileCount":25,"unpackedSize":39857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd43LOCRA9TVsSAnZWagAAKGIP/1N4HAJoUvzmHno/xuyD\nQTIGJruztDFhsoH4po7Dhth5TUu2gxaB4cEGL5U+CQa2VsSUIqzHOKL6x3Pr\nwJIykK+WogkIYxBJdNySSXtRCacxAiOlUIW9u/hnqVQIDLVwm6uz6153ZfwQ\nubxjypova8+a/DqYbe/AxyILBqCIZyOitOZN/qKu18Wh1CFanCuasZEz8eSu\nyZWsZltAfy4h5Zzom6i6bxZrGBnH0YVL+5YkIUj894qdTU3zWtkM/3wMPTHn\nPaQN26eyBX/Pz/X2/IvYxqFUDi/IGHy8rqbO+SMbaewknLfuOhJCQXXBKGGg\nsAy9FPERNAKJrcd3nsNGAI/bFH2YRbOyx3CKU3A8aS+cKBbYJF0/WgLGT2NR\nsG3h5cYIjwLhC8flAeH6idfAWtPTAW43hdXBBWn5qTcR+EO3Qxl8jvW/zWY0\nVn4Vo8HtTWzY+xUIWAcr0TJpm95g2pCea31rsRfWybTOE/EqwVPYUPfagIQ+\nywaJfY6KjSZS/NzkNO4JmIO32kihSr27PKB54yCCgCJaUyvzNElpnHZvK9WW\nyGghG98T1ejtcky4eFLc1h+TFdFbvxlSDCTkQZlQ45gAAfJb85kblU2wY2R2\nOBHLYJR2y9fpE4vv3k3/Xk4xwbvjpML674M1Z/N1Zh2MUs7hI5FzNDawPsZd\nMGfJ\r\n=n+Aj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoJkem9Aa8CkL1OzKZp/vou3aFquHCg8bzfHK3uQvlPAiAVS10mUIhkUadd/PtPayMGo/wtEGY/gxs29dvKhqF1IA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.6_1575187150203_0.6973326350352134"},"_hasShrinkwrap":false},"1.0.7":{"name":"typedconverter","version":"1.0.7","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.2.9","tslib":"^1.10.0","validator":"^12.1.0"},"devDependencies":{"@types/ejs":"^2.7.0","@types/jest":"^24.0.23","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.2.0","ts-node":"^8.5.4","typescript":"^3.7.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@1.0.7","dist":{"shasum":"d2c5e28de39bf0c6fb4ecd579cd5400f73ed2b10","integrity":"sha512-8wIdF2whm9Vv1riSArGe8teNsBxbWrTVAw2gvo46vzINlftIH76j7/iEh0szf6kda/4jo4U/dvpozps5xfYN1g==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-1.0.7.tgz","fileCount":25,"unpackedSize":39857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5F9ECRA9TVsSAnZWagAAbCcP/jphGerJQqeAb9vUU9cS\nm/w/ZeV8p/dlYW6sV25ORItBX3YLqYdKdvs3tzfa34XanEzKGY14yyLAf61b\nLk48EB5JUpwuzo9LseqDAXXKeVSAgIsaUfSmQI61gTgsse28roaXmroODTzE\nGesinqM8cdZ2WjaspuxCIkBE/FE4cQcZGC+flugNCJ0YWFHDOykdIumulRwK\nUNt/YYjnUOxkkln+2cd7oJAntXJ1OKdoUtpV+yuCsrCjZrRRoWJKyV3qDTJl\n0JrHLjmRbknosV5XwDhfpsFGNgluVWSB0xrD/PYFPh5RW4o390BijRoi9Q4J\nj4DC9K3gEFeUyIBiLQlmBHKWI4mJWD1EqLtc30vJbnjJdmCFIFWwGrYau82r\nLdQSVOxN+iXN8OPxKGjJLton2MRrCIcqrdT51bi+mKGRVJp/d2MRiU88fYXc\nzfISZzudA81mI3iwTme5ZtIPMxByzHRHDv5FEDJu3z3DKZ7MHv4qzTMmauNZ\nKbTM1Qmh0qKIvcHkreq6SWcqH2fCWAhD1/jlqzQprGZoanFBbZtcvuTlWme1\nH2zXpO1q3hMbHi6NO3sAcab5hjPmSkMu1MCdLsnHxID9ExY/rnG9LfWm1goP\nDnTYunkzmVsswmcovpXvNMLLVL6hok8oa38G4vFhezovpB3kbPJDCVmPKXRf\nvClA\r\n=W2AE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSEpSUOT8biNdhTLWGYaLWeZTLe0gHO9n1Tf384aop9wIgTNlMizv7518p/YLUMm0JMu/sT7OMKazji+Lv7iTc3NE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_1.0.7_1575247684131_0.994404531934026"},"_hasShrinkwrap":false},"2.0.0":{"name":"typedconverter","version":"2.0.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.2.9","tslib":"^1.10.0","validator":"^12.1.0"},"devDependencies":{"@types/ejs":"^3.0.0","@types/jest":"^24.0.23","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.2.0","ts-node":"^8.5.4","typescript":"^3.7.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.0.0","dist":{"shasum":"a5fcf75be1d4674eca5be7c6190a1863c68184cb","integrity":"sha512-ZBPvT7UEGqMBUbyo2JChLSsnNCiuGelU07HshMCvmNt5Yn8Qo77JVwXLi2CnwB+FV4Ky5Rz0EOBt6eTbBzU73Q==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.0.0.tgz","fileCount":25,"unpackedSize":38747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6ThOCRA9TVsSAnZWagAADdgP/1wBDNvnTZrcWvvqOKkP\nSFgrCbheRQcP1j9wQFslMj1NULJX3L/G/FTTfSGRJ5D8n9ci6h5EPbnjNfug\neo9oR2ZlbziTkKKp255UfXo5Mmx/2uOf7jDwY0zhzUDkjMExnDfGbq29TpFl\nRQdJwVFW4CL8MFbqp8BFsyGMmHu4FittsNCAiEm2HLPavcqprDpnyP+EGtxV\nSOUdVffkIkzIL7pq6mbnegEmnxiJoyAIM+azx/l7kTK4uNHyrVDGA/3B6Kvq\n+zRnz55ty5jfLUaAEI128nub7rAk4l2VP7HHuzjQTvDE22Zpz6dB7osCOmMK\nuKwgo34CyDHzNRatd0da9dV/4C+vqvi1wRDaEhWprhzt2n1Hd4XcZDuoQ+lQ\nboFJCEHnEDU791yGuUe7Er18ehIwfJpPiUqdjqFhbqe/ajrYITw4o+hgTVwp\nmzeWe9392IYxUP+Sh7CpIVOzcv2lWdGkYj/mUeRi74S8fpAxsaDrG9RElYPf\nY4wpxqpKu7b5Gn32tYdRoMIWflNd511Ck3QjDX/P1ivu6SvCbCdVssqw8Cx2\nx8pPz3eXy1sH0nljGNBFzIP07MI3mec7K0ryrNkpB81WAZPddfm68iFyvA4C\narI6ARKsyCU/CO0bbfDG+dznptbxiglmRh85GLal0vn2Qqx98DzQGkqOX1J4\nmAdO\r\n=hqyj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDroAm43oUs/l0ARYAURtc/com1wA7uhafXi2mcHe62hwIgbnfowH+1rGJlec9C//MQ9E0kHPlLgcCHSHu4hoZlBuY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.0.0_1575565389832_0.46788851153149236"},"_hasShrinkwrap":false},"2.1.0":{"name":"typedconverter","version":"2.1.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.2.9","tslib":"^1.10.0","validator":"^12.1.0"},"devDependencies":{"@types/ejs":"^3.0.0","@types/jest":"^24.0.25","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.3.0","ts-node":"^8.6.1","typescript":"^3.7.4"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.1.0","dist":{"shasum":"cae7b519d2ac08bc5b899e37ffb7164aa1c228f5","integrity":"sha512-ZDY2eJliWqBDSzejSgv9EJ5QXD8TAa+12PZ3k4jCUTeNpS3s+x9a9hiRWsQSHykcFL3bnYoIQKcUZvc0GT20oA==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.1.0.tgz","fileCount":25,"unpackedSize":38774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHbGiCRA9TVsSAnZWagAAG6UP+wfQ+LOlo6vpwSv3Mrfv\nioTiRg7sHOw7HipVdObplpRONZJOzvFZCMNPMTvGZUkmm7+VCCH0Zd8bj1O/\nkbA1Tv5Wk+ZaxxAcWTMkKqUYd+lfnEXDdRV63aIHawfaEBHohEClh3log12f\nUWDMI64AOVMKscOe5Orq5i/NWkgAtwJaALQSF2EP2dLhhQ9VePu9O4E/j28E\nTm5bNTM5rWepsTjOBGaGG9fRy8qYx+r43x5Jd2niRpR7UKCcAHJJHA4UPc04\nEPbOLKOp/eeVWQ0rTCgj55Y2pR69KtkTX68L23Sy0rWQsy79hAbIM2TsaQnC\naM7YYw9lw++81aZwgmOvNPeZQKEJiFNrm3M3dlHu8aD7pjEA9A2gT/dGcp+Q\nwuxNC8GVAsEjNpJR/5oob3GVNqZYaSv8drBCPM51CMh1TR5i8YGkYbb1nEwp\nB7KdGhqNkl8osl1fMQdxpUxrZsQgxoGfrTiFkTYfUkHVeohSGtatM28KrBpR\nPB2LdwNEK/gCed3HeKG0iWI0ScEbajsA5Rhvy/reKDwXh1hN5NdNP+/b115O\n5e60gupFoP8gCvi23wlCqLXQ7azbXrnN/nY+h1lHKcQT2aUlYq4cCfEM7037\nd6Fnr+Sm2L7iXMrZIiZ9ijXVBT6EkT7GjIZtJR5/5MsM8y/TA9QTqj+ku7Sh\nlQB4\r\n=IVSh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiErMk6a45egH4ECatmZn0y75ReksZ2Dm0l2pvdewAbAIgdod/AAfq/yPnDdhl36g9xIpxfWKZQc6qR4SvIc0lorU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.1.0_1579004321849_0.6284881946574714"},"_hasShrinkwrap":false},"2.2.0":{"name":"typedconverter","version":"2.2.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.2.10","tslib":"^1.10.0","validator":"^12.2.0"},"devDependencies":{"@types/ejs":"^3.0.0","@types/jest":"^24.0.25","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^24.9.0","joi":"^14.3.1","ts-jest":"^24.3.0","ts-node":"^8.6.2","typescript":"^3.7.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.2.0","dist":{"shasum":"743c38d89722d3915799b80f97c455507ae81fde","integrity":"sha512-ScPLq4F0tjk8i7nhgUlD2pmDnDpQsAslhJjF5X7AIvpuexorguNuZCSZQ/Cf5VKLxw09DQ+HjBeNG3t2kvLutQ==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.2.0.tgz","fileCount":25,"unpackedSize":39156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOIrtCRA9TVsSAnZWagAANb4P/1RXAeDOIa7jncjEHQ4i\ng3LqLfK4rfW7rMv9qYVbRWGnJWwu3Mer5GISji03HBhl0Za+IYkg0i92wptA\nPU2HEuSC0xLYy4AnR/3i6Dn+nF4HvVXD3ReSzqmZeOwRS6Xo9knlCjVOzjsk\nS48e8Ad3tWlJmqqcHStqI7buULdBQ1DQpMZKeq18bIeILc+EKr11mhYGTaYb\nZVWldX7Ervaahas3R5QBJKuuBT3Vgy6eAiPaG9GXM2xV02HNjEYv8CchFurL\ngHKIH/a6Vs6IsUQjJWwXZXtXjGI49uEUlwqtdM3dMb+LDzMeO2k7oYfN8AJF\nZa/sgzjxtoB/Eoo+5jWvwaCrxwLqWMFhduIDIYsB9Rl83zPv7x/yV4jB0L/c\nXYbYjAKslzO8AVXluVbCICG7NwPD0fLYc6y8NIYIC0EIvLhH8RjW8KXdmcqu\nQqyG9i4ZGlfu7Q8OaUumzc3kf1EKSektt1siKzRbD5mlgS40/U5i35QQhTNh\nP4S0sAJLg7LqUF2LxDiZvIH4I27dp4O+vJ75VnPoBidsEIPPeZHlinLGiT9+\nWhd672CHQN1YQogEnQrN9nrdeOQBMYZ1E96srTqFSjKxWKu9igkMeMkEQapd\nuFsOogwsi3tEa7AnKbwG4HYf9qzVSX8zLstBItm4zrjnlesnNTKBqTJ6ILU5\nR3IF\r\n=DF/t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxGsQljYiawwtHkrXLlalNenrjMDdfyFUjUGJUXV6vyQIgNfZgoCkscekGIbHbSjwc3rEWOADAWPbhLF1FW6+ivuk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.2.0_1580763885112_0.07230751688526738"},"_hasShrinkwrap":false},"2.2.1":{"name":"typedconverter","version":"2.2.1","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node test/benchmark.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.3.1","tslib":"^1.11.1","validator":"^12.2.0"},"devDependencies":{"@types/ejs":"^3.0.1","@types/jest":"^25.1.4","@types/joi":"^14.3.4","coveralls":"^3.0.9","ejs":"^3.0.1","jest":"^25.1.0","joi":"^14.3.1","ts-jest":"^25.2.1","ts-node":"^8.6.2","typescript":"^3.8.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.2.1","dist":{"shasum":"cf26e10a78879f0e1c58f1706b020eb464e723da","integrity":"sha512-vV3XbKrvyyMcydKcjh7VC/FKq1R5P2Pw2/3bWQr2AaH35evQIB0Awy1TCq/9qkirDXvpjhOvySEUTHtJ3PKKag==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.2.1.tgz","fileCount":25,"unpackedSize":38636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebh0nCRA9TVsSAnZWagAANd8P/R14KrzqSw99Twv6tvdC\nWHvDCFOmcgGIhjkyQO2GEPITR5QY3c2UGqgpKdnE2L1PyRfDLUi9i/RpRGV4\n5JhCVery4v4P3EaGAxvZC/s9zR5SoK+GVBq4+gUYvptefdO0kZBmgp6XE0ym\n13GOoqSXTVIOL0umVjkB7PHiWqcwgfbeHfhQPTJIZM3IRMbV/SDom6pApQZV\nk8TROTht7e96js+yBrTsf+6Ie++TYOprlFLN6F9O2Zm9p2CypNEy7XFjUbzU\nJaQijAf7x13qpT2FlEadXr/tNdcTRR8s/AgG4s9L20r/xWtofiuPmpiIvfS1\n3+CML+AGyoVaLGQqbye3Gevfot94DyIevHSWDWZEEaAYPVEGyFdxsPO4rlAQ\nsfevkWiMIPV7G0Z60fZGQ6TsA6nrpiAXdbz7r/oTh1vXO1bIJ0Jcd/EQvo+h\nvGxvlWhBeV8PF57Mp4L5aOCJOjUlm/8DgxZGI5y7GTIwn+ktxBCo5OquJdkY\nEC7lhnQpbw0vgcnNDjWvAFB0suL3GW9jbUzyGcTBIIKRcwj4dO1JiNu/O/GD\naoLyhNDeojbwFi5Ja5diiIiKfXvTvdg3rLxKNTuwfthk3HMX9CZpdoeWVUkq\naAtqm3i+AKNe04vL8TuiniRJjI53gMJu7m1/jB0fUj9eEic7+fxhxMa8D9qe\nrZWl\r\n=DDnY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJ+frcWUQKcrEoUyoJPzpIDNaTh+otAO3uPHC9iviAqAiEAqygLKgSgF/zRgNR1MPLe1TQVry0f9mEfG7TV9sSMF8U="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.2.1_1584274726947_0.020332380440315045"},"_hasShrinkwrap":false},"2.3.0":{"name":"typedconverter","version":"2.3.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^12.0.1","tinspector":"^2.3.1","tslib":"^1.11.1","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.1","@types/hapi__joi":"^16.0.12","@types/jest":"^25.1.4","@types/lodash":"^4.14.149","coveralls":"^3.0.11","ejs":"^3.0.1","jest":"^25.1.0","lodash":"^4.17.15","ts-jest":"^25.2.1","ts-node":"^8.8.1","typescript":"^3.8.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.0","dist":{"shasum":"914296138e2c2dd01d8f244176b8c39c3e6e8f7c","integrity":"sha512-w6jwvAU/tdNXYF4sHDPYZ0hjYpOcdN56DImQxz97WvQjcDQSYTVgMCH1lKE6ARp23IEyATpGm4yll5o/ruNg5Q==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.0.tgz","fileCount":36,"unpackedSize":46984,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedtjVCRA9TVsSAnZWagAAHjkP/2zB5B02QMAtphYNkC5N\nn5IhdvEZlWcSiw9oUZOiZ7et5raft0Z3Rqv72PYNCtrWN0B7QIUItThTdqT1\nmCG6MlIFJG+EhaM8Ly4QHgc1B7S2OAPAll1ebWTe/DitiQ7WXMR9DHUnC+bc\nonNZR+UZ3fCP631NAjb03nbMOlu2pfmOdEgRfh/YH0TIPqjf0qXlk7weh6He\nLKoMduiQpY4zGy03vO962rp5NwDkZT8/9mjrXH8ejpnHrb/FsOv8cb4+UrI9\nqIV5/zMb/yxjJwC4h3jRzu0zzy6q5PSRXMEQAOUwbuCusWsQKolQrn839ukO\noJ7xL+C4EQTDBNGiPn5SrQuVrzySVuP16Xm+5DSumSoohAqxN3/v+gDk3Z7t\nlpPP7vVfINqPSRX4h7MQYKBMM1ukXoH5M7OxAVXFtHH5DGSJEptVaEkhd/Vl\nCvnATdTF4G2ZVqNAFMWE/l1vPaxZ5ig76fsNrRwgn3Jlt7nCMSFzd8FX8TE+\nw8ltKJa/p5QMoXXYsD3I5w5XV1gIZuiNOVjey67n1Wrx+deJ9PBvaeFy7Sl9\n4ppWjB51KoAgvG2RojoqEJgJ3M8uZQUiA+9hrwvQrgyBWkYJtIqwHal+mWu5\n+zZiL1YaOhiOLDpiUPDBpH7t6Q+SEcbe5KgLB9kPavsx1Iy1fGkZIhEQP+Bx\nUEU7\r\n=Rwmp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBYYKFuFC4fwLx75B64Ihk+MdfDp3H3a6wU0wM178cqgIhAMPvrrIimDFLoWRApHxTzT/QwWj25SXFEcLGK8v9YerG"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.0_1584847060035_0.899694490557289"},"_hasShrinkwrap":false},"2.3.1":{"name":"typedconverter","version":"2.3.1","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.0.2","tslib":"^1.11.1","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.3","@types/hapi__joi":"^16.0.12","@types/jest":"^25.2.1","@types/lodash":"^4.14.150","coveralls":"^3.1.0","ejs":"^3.1.2","jest":"^25.5.2","lodash":"^4.17.15","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.1","dist":{"shasum":"999a8ab6eafe0ba5b64387865c8a5d5da3b43ef3","integrity":"sha512-lO5SAE3t5T0LrXblkqkdim8ZVmySMwEKdXwNnOYogP2cn00vRUSmGMcf/U2YSFofS6BdBt9Qq/Je1G3X2cnrew==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.1.tgz","fileCount":39,"unpackedSize":47832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqgnqCRA9TVsSAnZWagAASsUQAIWHs8yHdv3VPgFnaI0g\nT+RtG/40pVIrTfriHkttl/Zd7CMEjfLL7Fy0ep3EW5qa0fItCaV1BQnFkzl6\n13Ol7m4gEr3N4zy8q5RW5vte7vq/VT2154O/4oixegfvyvyinosqX4TLzxzR\nzzral1I8aY9VodD70KKXzgLqrZXeBnSMSlKi30YC0JPvn+zHFGQK/FedY6Un\n+QZu5vOzH6ZCrJTNU6hTfOUdk4nYmcxtmHHZU9IM4gZNZ5bJkpYLdFrJibDX\nCAdNcVwnVmMSl9o4tLjIsyuhVG/B+yeUCcbEtwDIPpilDAZi7bESY4t9xnBE\n4FoEx1M2d4BAurvlAnMElB8Oav4n+DDTvTWSyNu7rPTeQZxcuw10nkRGsWRX\nJs+ATTBakk6nMca85ooQz4GfF17W/7bZSE3NnrDyI0FUu054K0rqz/bL4jna\n7+pT0wpOlRv4EfpK3XkapvKibNSbQu4Pno0s94MmQSbXDQSw/FhCHyI/ihEG\nneBN0drYg5848JshFdX350SrcWptaahBG0vNxamgcK+uTMbrZewiQgAbe0VW\nbE1utqFhrnXZ3FQZevKRQMla1uwK+hES2quXA4dP2HtwEoY2TJhYOvTX687i\nkV3BOPRU8ojDjyZ2sWfF3ePDGI7YX1cLrO8qpvLR092K/dhXofcDtylHeWSp\nbDa4\r\n=KwVv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2/1vhHCtN9BV9D4bGt3AcSIAqcWhlsAiXCnyIWvxB8gIgB+cbmbuqM7jxFzsb6tzJH66rW/Wdfu/JbR3FtNEQ7FE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.1_1588201961842_0.4444874415225126"},"_hasShrinkwrap":false},"2.3.2":{"name":"typedconverter","version":"2.3.2","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.0.2","tslib":"^1.11.1","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.3","@types/hapi__joi":"^16.0.12","@types/jest":"^25.2.1","@types/lodash":"^4.14.150","coveralls":"^3.1.0","ejs":"^3.1.2","jest":"^25.5.2","lodash":"^4.17.15","ts-jest":"^25.4.0","ts-node":"^8.9.1","typescript":"^3.8.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.2","dist":{"shasum":"49899fa0efc2479c11efd040be856980f20d5351","integrity":"sha512-e9RjrUvoHTsR/S3rQHmR7+W11aYOGGDKztcf31pzYPNyqFHSrwS7U8WYd8Pt0HZpOpykD+uWjY0en+LqSiObgg==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.2.tgz","fileCount":39,"unpackedSize":47930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesTb2CRA9TVsSAnZWagAAi4UQAKQsqH8rQud7YxP0SC3Q\nAQYbOi0zcgDweBvtT8mA7sg0nIZdZYkRlioSrxRhnUvdL91WK3b7CWVNEIt+\nZykT6xtSUThwexhIutfJvlEoJOI64PX0BpUMJuxOtWf1Sy3ljw46dSCrziex\nPNWmSRaYk/X1scdojWeXcDpMMo6WhNVPdUifhHgqjDe8iNsA1Us+YcqvUYBf\noLkY0TJZlgIYnucS7afw6nSDyaeJ/m6UcmCIpoJE07pYnTXFRD3BQ6L9xLQ6\n2mrWAwnSGWZWunJNKpyvBD5EE5FghTJ5nHdvVwEjK5zy/YxJ4IljNNqjgow7\nS7pKo5GPXmi7GMOT7e2EOZZxIMXVA2lAzgouR7SBKSjvqxrYSFInRjnFXJSE\nskkCXoI6RZ9+yvneouapM2aYrVzqYBof4AxyaXNDXKQIciyppsr7AcRzduCV\nuBFPP2qAH+jVTPnRCv4BanS6tVXmW4hNFZtGIqIH0GJHUzMLiJyoNbvSdUSf\nVrx+oZ12yk2rbF3pi4f7xBmi60Y0YPFHYhj8VSfIKiaxc1h2wkin/N/yYmaL\ntjQ6KlHVgbyJXRUtX4utvq/tIr/Os7BB/xemdwBOiwFkIlPJGuaY0XszUFs0\naVuAEFk4gd4GHX8DBGzcSB3bez6vXQR5xeI/EFCp0wJu5p14ZqRCV8TgzvCc\nej6h\r\n=zoYj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKvKYvPlxYo18FY4POpTGFAaatbHZkoRpAxOMwBkwNfAiAEURUDg7Hb/KHYC5hPYUDGEUhY8i1LiZIA+ua5LAZH3w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.2_1588672245784_0.010184161756585208"},"_hasShrinkwrap":false},"2.3.3":{"name":"typedconverter","version":"2.3.3","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.0.6","tslib":"^2.0.0","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.0","@types/jest":"^25.2.3","@types/lodash":"^4.14.152","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.0.0","ts-node":"^8.10.1","typescript":"^3.9.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.3","dist":{"shasum":"76a2fe2afcc3dfe43a05e888a4dbb7f824d340f9","integrity":"sha512-EEiCYKXC8NkN/MnMSxgjrVwrjfwhPKOVLJXDHxwgg4EjKc9+w5XAgtcsia8HQGZ1eKm8HnZVnYqDGt5uMHW/jg==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.3.tgz","fileCount":39,"unpackedSize":48917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexM2bCRA9TVsSAnZWagAAO8QP/j/5HQUMLwpAeYI/v+ex\njVaLpekjf3yoPIXo47Lx9Cey+YUu5abfapncFslIaa515GpIrZoAdvEhQ4Fo\no6x4js2xA3f338plvEC0Z5NLu4VZqZF5Fbq4E2o5OityDhJZDj62zm3bEUbx\nzX6Eu7PZZUGoO8qLA/UMeM1dQBp7EDL2Q/DCCzh7Wob2m+nYkFMt/LLBQXZp\nbAWxY3S00C8Y4UFntxHkR8SOZhhN0rhsIxMrWoEKc814+OfZRrC02UX1doUA\nxSQXW/ozLhgq7a6Nu9NsHzxOj/+gYP/xjNtoD43xzDiSv0+HRJ4mYShMa43V\nm/qTQ+W9uNxHzXHhhOS5+ukqwBHxC6WD4a08WB8Dw9WLIk/hoP/1I3YURyLm\n5oqiegw3T/+YIS9uLguxM1zxizN4L1MWZT9CbZt77WFuqO6e/DUUfOz6PpDf\nRfsDtd6pLN/yXG3H1KohCQGdHrjowkEAL6Uu9qEu/ByJvXbZcKA8REwHBB39\nm0guAr2QYufWYgT+5SRlfOqpf8hj1Wx9R6Q94kNuLsA8mx4HJlu9mfB+FXj+\ni+BGPdKZITTrxpkw1HgnKUdsRcOdvB/U1QtjOFj+ECScXfZCkMT5lEL3MzRc\nqdfzzIc6QGXVJb1Q3BxEl99W4NbTLJdnYbj7J9FRtgDYZoDUTFLErFRSwTF6\nsFY7\r\n=5Pd8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJte9wU3WgO++CelbnEjEinhdcix2jWdIIA8325Xy85gIhAJsuhT/llJcLHAgxtO73u2UBKGvRJMG4bZRMKmVBd4g/"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.3_1589955995407_0.5740862525412427"},"_hasShrinkwrap":false},"2.3.4":{"name":"typedconverter","version":"2.3.4","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.1.0","tslib":"^2.0.0","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.0","@types/jest":"^25.2.3","@types/lodash":"^4.14.153","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.0.0","ts-node":"^8.10.2","typescript":"^3.9.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.4","dist":{"shasum":"9ca116e71c4a281f006ac2e0694bd2a5653a1f82","integrity":"sha512-qMAPr69m+Qw8kVaf1yBQSONLUhInjapTz3hOg6xoAVDtwqC7Z0nDAYhDXQtt4CKwNnTPhAeACaQ56XZpYCH1wg==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.4.tgz","fileCount":39,"unpackedSize":48906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0Cb9CRA9TVsSAnZWagAAlZ0QAI6qXw+f8JRWQQ9AsVsf\n8FN430xzzmDkGZ8mqL0iry1H6KISUsMeE6PQIG2soBjxTvdy8PD6nVVm/RgB\n+zUj3f4CxVMeinY5Yh/kCVLI7gpOQMRHNzSK2O7kOJFOWnnlUsF8PrruYhEh\n/jPpxy+63ZnIXUgm2Xb7WxHnoBAJ4pqcYOJP2K7LCFo+CWkWNjD80HnaNszy\nfe032Ii3KvlSrGoWuIs/TDCNSwmMkJygZTuexz2dLV9g4PVwS+Yqe19bP/XU\nNmxGn7fDVccnc+IN+A64HFeOBok94iadK0C8wgbuPhnnXEKb87LmGRYuuIVX\nh8LItUC9fiR3+xlVAU83CI1Zx14fHpQ/nOBJ3lk/HDyIgos8/rMNPf33RR/J\nFnLQoYdgLJJwLqmwRL3Lp3pjl5njkaxsbrdk/pm54X/2PexxyTsFzSAadfzs\nMN+xWBxz4T50Fyekq/ZaPjtFa/FEIL5Xjw8UpgeF0WMZl8/1ZpuUvTOBTIJq\nxaRHmFHvyqj/XQ12FtK0l7ZoOLHrECLZLbfJ864BfKzPwvkGxnK3h70cghUZ\n6vQ7K/gt5KbSPdsHRNRXz7YppuLGOxLdQdnmMJkh3h5EJHAU24Tq+/H+1qF+\nqt7+9WwM2Pf1HElRZBnvTXB7DwxqV8WyJWKUWMwWIqq8g0FHsY9pEhWkgUAr\ncaWB\r\n=Yz0e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFE5E9/EpXbKsl9s8lyihnFxJB51gF99cj2uC+AEfTdAIgd4rUi3ClsGcpr/VOGcpyg//nKizBVlreNR68cFOY4xk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.4_1590699773339_0.6608603374388644"},"_hasShrinkwrap":false},"2.3.5":{"name":"typedconverter","version":"2.3.5","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.1.0","tslib":"^2.0.0","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.0","@types/jest":"^25.2.3","@types/lodash":"^4.14.153","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.0.0","ts-node":"^8.10.2","typescript":"^3.9.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.5","dist":{"shasum":"48682a33405541da943705614c1a07716b3f6fb6","integrity":"sha512-EB+iZ1Yur9jNyh/LbJYhGR8R4yYcyBOb8L5jj13dNlXsFv/ZqdDHeASO/XV9j6DpM45P76DqNhMMnatfB7Nqzw==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.5.tgz","fileCount":39,"unpackedSize":48952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2CbvCRA9TVsSAnZWagAA7K8P/1CyvovQdtdQlocVCLbA\nNWl/5IXa+1B6cMprf69HnalCmgRLL/vtny5Ko6Chf/GRzNSN4vgNhnAPWYLP\nn0VHhneZaHYkjSU/j6Ud3iuSfAFzAcOAWIPOgPxc7l0JGjhTg3Ir83TYPzKB\nG3Bh3UYLcDKLM+fU7r/WbQeJqwd79WiSUyw+/XiKc76GcL0VdLVsn52gZas3\nmglbZly+yBppaM9q4CB//6t5P2/RZGvARnNWmJz7SB2vhuGAXObiWlKs31Nk\n1HHS4UtOR86j6vUo3jfbn5XTRbUOe1rt2EygGsg33j9iJJVAbw0NQ73bbiPK\nIBXyGtT3KfxseOardUslFYYn22gugS4eouqXKHjX+VMoitjAOZOIee0kIpbG\nEFGSUcDvXFqLB/a1WL8PXVs0zcicto8U/UdDmIcjM9fv4Qe98k1UtNn4Rk6A\nCNcEuKuqSt0zdacTHprC8GIBSSpUezdUn4tqSIpOqBfXZxhJ11B28m/L6C8f\nU2xMxjniBEyzBJFTrXhIZKo9BEjlX6WXDxrz+TDNI1eZytbDuuSJbOl9egPo\nJBrXAWnzUO4AZWxY5t8gA+ENC8wsoPIzcGb3mXIAcW4cwJ1+mnmICgNcuQyS\nJ/lgRWFYKEKieqN1LkhCQrAVRFOSe1DCBDY7asTF7g7pPXonMKk15RLFCWdi\nkzL7\r\n=5ZTq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCjbM0HRTCU3iupkL0FWZ7BE3UKWvLnTEhgHTXe0DxSAiA/ajbwMYROrsQgTf+AeJVlZgcwVfCJ85XBLFCeF8NFXw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.5_1591224046414_0.9831811135892885"},"_hasShrinkwrap":false},"2.3.6":{"name":"typedconverter","version":"2.3.6","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","prepublish":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"^3.1.0","tslib":"^2.0.0","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.0","@types/jest":"^25.2.3","@types/lodash":"^4.14.153","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.0.0","ts-node":"^8.10.2","typescript":"^3.9.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"https://github.com/plumier/typedconverter"},"licenseText":"MIT License\n\nCopyright (c) 2019 Plumier\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"typedconverter@2.3.6","dist":{"shasum":"8579692dcfe20a362fd1492ca8cc01fe6f859852","integrity":"sha512-2Fnzm6UnQk5+F1qtp1IRld/uSIMCe/oS/T64A29oXFcyUnSujpg9hgRsHF0iTeQf78K0OSYVwxpPpgZey9XEJQ==","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.6.tgz","fileCount":39,"unpackedSize":48998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2IQPCRA9TVsSAnZWagAAZqsP/1PJUfqevkRFDw9xKULy\nwv+6y+4MHk9BVmdHvglsx/hzpkFBW+Nl7o4XFDbNcLYAYrARaRSwyeFgyWU9\nA+HTSwAuPMYuSLhzMqTQ/gVtjDkzxpMZ3UOi2zMQEU27y5hAXpYEHfZfokGd\ncagmxrRdzX2+OENo1wHlWtwSbb6+pg9vsHPdeN5h+sVX0phI0ZjPq5ehRpLJ\n2RYbh7OLEttqPm/d01CD9+gCXg3iRMr9RuV98o0RtySEDXWBiMbtjIKIPDXu\nosAl3fnigTZMXxtBoF2Ov+NPahi1sHYtWNxZXYExtoLYjDyQirg3B8e504PD\neZtlAdz4lM2QHEItPlMX5/shS3tghQvgyy4nZuS9tL8yV6fQx6qtpPzOldlE\n/Y75dmKrUlzt01luhHFfyG7+1VOG850T8qSCD7zLlGb7Uprm5htxIumALvqJ\n+2nncPOhUXNaadbdZg8LMXX+J0mGoWYF3vZpx1PMc0/ErFxsya53yqGLUH7T\nNdafP8smK1LR2BNYj53ma+WPp58EuV4zP0xGEIZ0iv2HczeL4ZuK/Rdz90ds\nfbiQHHWcN/BEvjXmJYvdH+fN0qTRjAC3mnPt+zuxRVlgBkt+1M3mUmmyybeX\niCIl6cY4hkgQ6QyQ8gFOyO7VQHGoyvLnspLKp0jMFgJhH9CcxezQWBEf0qeN\nJreL\r\n=o47/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjDm/id3IjIrf1tolNIkrwUcqUa6CaBnlsnDnI4cfoqQIhAPkX7OXB7o0OnoCfzixotVZCctKmjIBjBO9C0IlJFyTi"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.6_1591247886651_0.33322458828576074"},"_hasShrinkwrap":false},"2.3.7-canary1592806142.0":{"name":"typedconverter","version":"2.3.7-canary1592806142.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1592806142.0+06cb125","tslib":"^2.0.0","validator":"^13.0.0"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.0","@types/jest":"^25.2.3","@types/lodash":"^4.14.153","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.0.0","ts-node":"^8.10.2","typescript":"^3.9.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"06cb125750ec650428ad9dd81e1646264673dfeb","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1592806142.0","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.0/node@v12.18.0+x64 (linux)","dist":{"integrity":"sha512-FO4hpG/eJs4FbOrLzAX8SQFqpdNByet1xnr6Mp3J1+6ZX2NX0hUr9jbqvG0Yew8FXsOGFAQMt5R/g7pRyLTG2Q==","shasum":"9d4b84aa51c32e558b8f679a1914042d3de12116","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1592806142.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8EsDCRA9TVsSAnZWagAA50UQAI4d04O/VqadZkJYYm+1\n/8pzuH3paLU8sCSfd16o5N5O0vFuj6i87iTv0nHKVcGm2RuWDbYzocZG8BQz\nUPcM+ymvx7zIRa/k9YG921SAw0ZilINbu23Eq50MN619IOMlHpwQiIyVqN2p\nNmjL0eYIkbfVCmenOP4MUaTTGPnXHjdHjY6p9WJ9JCeCe4wLMMo45IL1/9ga\nJkOGWI7ssZnxIJIZDFTGpAq2b1TknDi7HUbxcA/I5RhOmAjd3CdwBw4xLDhO\n5SaAsEjOfdZXkw4vTnSE5rb6hCsjzWAbUXD4RhXzf32ustqVchn3i/YRpLyJ\nbNm7NC+Nofbx0IeBg1kdqLGy4KnlB5lIbxzrbnblVz1kKj+duE2bjwGyo9ni\nMUpKjEBexpVrDpKIG3+6DJkNNJKIRMdPb2mxGJyLZVhNcdCmHn1y2YhxyJyW\nlnqV8OVYO7/QbfG0cHopJsdttd6sx/UqYIwctXWBgdBBCWzoBhXTedLT+ml0\ngC4TdAJ/fIEaRYg8XFPlPQ4x8/6eReoJgsTrCy4HBQhWjsMSpiP4RAhSYT0+\nJoEjrWf7gcBc1pgxwbYSRNBFKY8ULvDG+L1r/AmaIXN8E/P0TBTehHnnbqlx\natSyOqnzFc3iYRdlVbL6iR7GgN9aBYU0+f+tHxzGMZqGni6xOXMQzw6dUG1x\nNOJU\r\n=adS8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGKT2VHFbvRN2bZ5sQnTceJGd4MCtcj1kKDoeKd3zOgoAiEAxSqbp84Y0WhN8hYrUNT3WiinE7gb9i/F/Cu5KzCaX88="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1592806142.0_1592806147399_0.18094376289037295"},"_hasShrinkwrap":false},"2.3.7-canary1592877058.0":{"name":"typedconverter","version":"2.3.7-canary1592877058.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1592877058.0+786bef1","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"786bef1c6466ad189ccf28e811ba21b4732bd9f5","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1592877058.0","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.1/node@v12.18.0+x64 (linux)","dist":{"integrity":"sha512-zoX4v36rIM1mMh6Tcmj5GMdBLQXVR2I/q9Ry/hN+cVkC2sw7cb3QzLssrzFAd1H98hHf6B5gsZ5g9FKr5O1C4g==","shasum":"41949eaabbbf17687975f738280ed2bbd1c40ead","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1592877058.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8WAJCRA9TVsSAnZWagAAIsAP/jhPjHfnpyLDWdnxnqlP\nym/dH7vaD22EhoCHEY0KINsHmpRIbjbWyb0cGjLYivGyBWCXaE3/ffuAyb9Q\nmIb0v1GVOOQCnyyGbIOu6rgB937yZ1U/GYYoyKN8oniVD1x7YBoZX0UoWrET\nQBiF9I0Flt4iNtzMPUHvU78UHfMZvHqoS6Xo5W4avUrscCLNsAtxTM3H1sNE\neNvZI2qQ1Ad8A+Abg5wWMgNAGDmWQQr1yN76agKGO6z3IyxG2vVODDQ1YgjQ\nxC8gcH3bFj/5nrAEXpWvqQrWzwaxWYplym8XYSE5GgT3hE6BksSHNu5nys5T\nWs5CNJeL9EcJYRggF7aANGGHnkoPE+4C1d5SM3FE/B1vyVywUbb5HijruN9h\nCFZSW62u6HbmbQl/4gbnddPxpunywk9aXY/8NsDgRqt54ADpBeE5TV1m6Oyd\nlr1lDe4Djl+mzW2PL+fJvibsa3ulWV4AoTyfssmaNUpRBx+JHZXoOcLzLoFj\niHsqP9AhQplclPlGX8+KcSuyifz0TmSNnjbMPJgTNkK70MryNFI6BYtMCehP\nSqjVjMkRVstitPFaXU4yJ5uls6eBP8VmhvfD7Kkn3P7QyxLTG0hbGPGUhJfr\nYLaM7fk1dmNkayT0GtsRjXDT+CZFnXuzakmxN24y1vLRsiSWgvA6bx3/su89\n2EKY\r\n=OvzM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5Wlj3Jh/Axupf9R8Ez0V3kJkbsLeIMFWWpUw8NXWJBgIhALJ9lbY/8ae8Zouc4y0aTZG7bq8VAwGTZETwEXXBzcAT"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1592877058.0_1592877065439_0.22030279214278758"},"_hasShrinkwrap":false},"2.3.7-canary1592886862.0":{"name":"typedconverter","version":"2.3.7-canary1592886862.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1592886862.0+438c2de","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"438c2de2249305176eaf2c2e6e526924781edd48","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1592886862.0","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.1/node@v12.18.0+x64 (linux)","dist":{"integrity":"sha512-R1JomFGJJWkP1FljjwB7P7OyePqz2igGtURfMtso2i6/GY3J6DU4C6vmr0dlSsks0LoCqprCRUDAainlm13juA==","shasum":"08954ec9cb637268e02e04e55c1159423fe923df","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1592886862.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8YZUCRA9TVsSAnZWagAAW1gP/0VPYPkDJo8LR7tvJU0I\naCqikiOqPlHKpHrTQ7NiRdHFxzp01J3GfqliVEYMHQUEIk2bUdAlsBOVf1Aq\nip07qhxtC7aSoFGAXpV2BQ9dNh6b9irbmOwtFpPd+mUcYqQm/vF2F0XOyXwb\nNQCiiPwj6pyX7Z7PXUt7BJh8GC+RErXxDTPsypB3Z9PPhHMZwbP/F/mm9D7b\nm7wNgSxKnBUFb1AE7nx6tiZ+By2FCgil4UeVORvMyvCC12epk0i0MAniJPTo\nLTWtbVt9e1nOB81bymsEIKyHl0EmPo/0odCjhVc2gJ+ymhk/M9eU/qNDTkMA\nEHSZSsBMdZww4ltcivwPxvDtScgYcgxlWtaKd/3J2pXT3EWKPoqDiudN4+oc\nDtJROrXCLuK6FUJl1bikxZzHxSskSwURxJQDmOV6K0vVXjc8bktOhUkmVhwf\no/W8jNcj98Ft4P5PAtZsiAYf6UxDlYpcg9iji/knQ848vYsP8pVuX8gN/cvk\n0w7IPXmdnhITWuc8q6akBYAT48sSb5rWDM/epHFbPlia5Wy7pNhgN21B8ueT\nXnYD2NTy2p4cvHGg+g5zpEYm9GChwz/idR22yTbLVEcY087OAkLRI7ZCUSuG\n3deOQpvjRvE7ljejCzSAzmett8AYSgQqTL1W3V3C3cFqkYnnTdm8HpVrtRpX\nXzve\r\n=xqXW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGr60RVRX8VaY6T7QncW9jd6tN+3fKsyQObqQgQK3QA0AiAbQT5zoZfRev3LAzXG8OBMYR+2vjJKhaxA9BGaZuXMaA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1592886862.0_1592886867842_0.8519818143148314"},"_hasShrinkwrap":false},"2.3.7-canary1593026645.0":{"name":"typedconverter","version":"2.3.7-canary1593026645.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1593026645.0+7c5b780","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"7c5b7808e61a5c8bb3fa768a3083f47a2cc28426","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1593026645.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-Netn2L+Aed/fwddjAWwXfnNdG2GpMLXem+UqVppy7VPmx7OS0v0qAbVdVzc0H30HvRd9y7tLLfx0Mqo2/3Zmbw==","shasum":"a244d0a99540f5f3e00e82ad04f1e156ecb3e079","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1593026645.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe86hbCRA9TVsSAnZWagAAxg0P+gL5jmqJ5LTJOO4QZHGt\njzm3OKlfCYrA1HBbyrw5k+PYJRJ8mcA8rv+5OiXjLf6MfdCR5sKkd9MlV+tE\nsHd/PhR6R4dpUbETFSXxj6pnmCCXG9dP+HwdrmnEwJUY0dAef9kkwD7fz4W0\npKXNJpVaX1hb2gUSMbfN39/8hsyAN4QmjPbzgS9sOHACPEIV8o+9BouYfKqP\nEBXTH8XI8dUWDjWN3LLPsfDLcR9v/PUWmn6yzzpMq9DAXndYdDXAYdNSp7wT\nV25gaGqbZLIu9FRb7nX0o9zW9Qii0yKgblWvhckTkNl5A/DoLUpVC8GMXGMI\nR9jTlTvyEVsj0PT+bruHLUpDQlYnnsowULImeYvvq/zRG9ne/Hj9zLVg1T52\npm6537PltaqD85q/Mn77qebJBjYEBGb0J+WgS0KLYe14imWKq/uN5u99zLcu\njPcoGK6fT2uyuknzRIl//+z3yg7dtdFW0npwScrVOD/zuDJ7cl1q96aTuF5a\nhfzFjOZGKNfMycjlbxEshUCECSHBu1ZZ/6v8JhFXUjO6U05QKE2paD2HtalS\nmNyX2lsNGPFTbj26lXMMHc8BOgyKarqISRI0xlLs3UxJVQ5gz+ZMpqJJkCWx\nwCH99dri+TwWuGMOE4Jh+dcgfVLvpSZsC/9SifdK+8xTyeSp6FEcM7UpHEn1\nours\r\n=tkea\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHwYpxmeQ3B3SusNVbNsLg+R8Iq348xls2JlqYStJqDgCIE5MrZ2irChbX82ZrdVyqm4bK4BfSFiJrUXQ1h/pR5TL"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1593026645.0_1593026650839_0.5848059359810165"},"_hasShrinkwrap":false},"2.3.7-canary1593069049.0":{"name":"typedconverter","version":"2.3.7-canary1593069049.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1593069049.0+0d2edd1","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"0d2edd1c9bd4933a5afb0fbdfe8ffa53cf43ff31","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1593069049.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-P26+SJzF7nfpwr/1QMYFCmcI+Sjg78/E539g4PD7OJyI99mUQB+ibGtqcjaCB2SZaiU+VTWJqF4CWNLAimIKdQ==","shasum":"af553fdd7af983636693f30b60c5834bb39a9009","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1593069049.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9E4GCRA9TVsSAnZWagAACl0P/At/vjwosxl0VE/4C3sP\n88P2KtEWDPV9Ds3EgPzZ4R4Z2asB+qe0qoUxs5zp6Xs/N/FGtjvNetwo6agh\n8Su6bf9XcAbNqP6BjJU6GgeU0MZnZl41ywcssTHo7yOig32iMKourfP1USmk\nNXW6Uyvum8alTOXfF8xIhNMbEZMfHpMnRGjcOgsY2UPpkadInVluHsYplmaD\nYtODGul6NZO+UKWbogzie9MocrZwhA5PcxlqvdTNu242EZj4MW93H6lSbaqL\nReIWkAVnzJdfuyc2BfXp9KNxaMlsDWF5urQk42VYOPVDHisrWbyWus7VVH1B\nG3jeX+WOLcORbBWsKViWYURIxZEeAGC90ffpcYm/vMLQZbD6mc0944/pZ1Gp\nMEsXk5UTRQAv4Af7ZxhdW16YtJnkPSMr2sTCTbr03tRRM/CG/+ZhTbmIkCih\nDMs22fhxPJmcPTe8CCGVsRKTMRsZV+yOpKm6AOp5RNXGo1G8KrrMqJnoSF4+\nsdhzFYyadPkbmph9/0vyc9pENCZVO6w4Fy9qJbx31fS4ACNachUtoVSQKZpx\nfYRukQ5gsbT8gbC39xxNJzRLT0C5MH321C6K77Ux6ygjvTt3VpfOUa735H4r\nNjG+ku9HF/5/W6NIMG3tmMDQW5IyuR4KhoNIaPn2N5aydR+Mz+9htkVXJZvu\nh28y\r\n=sY8k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGsEzZqXOYr9W9oVX1YgBsbiQbkcobqsGhebZI+am0ksAiEA+hszrpUkxYwVvYmUWVn3UGwveEjF5B6wWXctgup/1Bw="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1593069049.0_1593069061837_0.16697951679402312"},"_hasShrinkwrap":false},"2.3.7-canary1593125083.0":{"name":"typedconverter","version":"2.3.7-canary1593125083.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary1593125083.0+fd9f134","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fd9f134964f69f03a1aeba6b8ee3f8385cd9f5f9","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary1593125083.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-FX2n00sP3Ph5jDdju5TyM+YKggAQbVzZzMlb1ctpBTfvdAKtZrA7OWz/NcGY1GGIo0A/8W5vK0mTlYrw6Qi5Rw==","shasum":"9ed72c1383c41bbdb58f91d9c1293bf810646dd1","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary1593125083.0.tgz","fileCount":26,"unpackedSize":45345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9SjhCRA9TVsSAnZWagAA7xMP/A4XCBOv0l5LlqEJrprN\n26R6Iz41ZHrz+kWptZ07gfP132hnTc3Y2qB3xEDUfH/q5gr86iRhGfnICz/n\nHne4i8aa0ioQsMDHyMppFYOLlcQKeucRqxdolIGRB7VFdci0gyEV5Y4UDcDa\ngYEcLbKTNm7UpdeLaLcnWKSgtXEH9OFWYWNfvJulxSe4lF5Sb6n61L2CN2XR\njoRq14X4rQOSpNHvV8u7sDZN9D6Bmg7DUo2+YIYFcNWpEGqQuTBstmfxkMoX\nVxaJmwnb6IMTp4t/li6Pr29ylHsX4yLRdco3mkA1xree7MQyYerRe0TW8CKi\nYqKtM8dGymoA3s2s3WDLu859V+S0om9kklZQlKo5pG8JQSDlN2pQUafd0sHx\n2yFOOyTPUEYb4D8xr5daQdrLujfEioPkGn2ArDnoW/oQJRdEjMeV7FcOhMIf\niLMra/Ung2CJHppaW5il6Si1pVi5/s0y/RmOIhVJ7PgyGkZpBblZZuJQLRCn\njrgSjbRgCXqOk/Hd2SDQ58pgclOB1YeszbY1oaHjdjovyopNiLKDz2zsL/wM\nTieXL4nykibE/JgZNXnAeR3/K0yTapkppAhKuZJF7nLgKzKRUGqwjgAZbKm0\nqvRMT4O/9zR+SuPf/Q22w1pgxrgYg0wXxeiqXRviKnC73nW6JavwsSLOJNfU\nAtOr\r\n=LYKS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHccpN+KDqcAtclz2PQ7wWAi/ylsm6QZ/CtbU8GteFB4AiBZRB9J9lbrAKyGYRBH91bYnkKgGfsGkca2aAd/SvPj9w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary1593125083.0_1593125089321_0.4236791918482572"},"_hasShrinkwrap":false},"2.3.7-canary.kbwv88am.0":{"name":"typedconverter","version":"2.3.7-canary.kbwv88am.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbwv88am.0+078d37d","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"078d37d1ba9e002ea2272403880fab107a8c1817","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbwv88am.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-68/lZQ4Caia47Fe2/fMYHsJpFCX1qHFy9MzcU5im4I0hv5gmiUP8NA00annb4b4jMpTRHaIjUsdDXc1CXCmY9Q==","shasum":"061a23371e4473e8a871be1ced587ca07841e2ee","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbwv88am.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9okeCRA9TVsSAnZWagAAop8QAIUukv1z4vvlZoS+NG6F\nnCBMJ9lwn0Lfk9gcRZV7ltY0/5B69LMHSev4dOAZllaZVB4uofZki7e1Dcqk\n/6FhEckfW4ybf8QjxxxVP0T2A/fpeiCuz8GNd/L/B9ZhajirFwcscBowHmQU\nzWsXMPhkMyWIO2tJbMMY9Ve95KtnWnijBTqA2D4+RFW2ixF3Wg6AJyU2g9wq\n8hgxYxPNh6VbilgTp1U0TTC83KQDjI5CtdbncxZ3YAIA8u1dxSQR9Cd1sfmD\nrU/TVKErPzcJvJH+wWgjiwRTLZiqkvaOUFycDpwH/BfOnSBTDJWzZJ3ZD3JG\nAyXvTF6Y8wqdxgNZqQ+UqXvCw902T8De+Cy10fjlHjo7vd9THF6qHQ1i7tXj\nfdHnIeKRLRFhyXygE9km8PLDVBMevbWD7CMn76oYGpX5FHmb53CZW01BAzU7\nPdapDWPwZw6i+5karPkMVsD00pRfUVOf0mmY5E4BKCkAsrQ5C0B3xCD/C6Q2\n4dhNExgTC4bl6bOHoTTtomOgZ6uMsfoNXGCXuLb8bLAa7Y2wMVv26BJ/12a6\nwxbQ4gbUxlxH5yell/hmnhUvS9QzVPNTVplDmck/5RgHJu5TbAyu/ChuLQkD\nn1lwz9fJTyMjYF0KG9RVD5kzdjcbs8P0j7DO2gZbu3FaPJ6cFKXn/E2B50op\neHii\r\n=q9Lf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDg6livngEFrTujObBXchEAJ4+aoOGOw8XpYnf/vQ11uwIhAM3TQ4FiMlIyLg/c1Ka8k/J3zYpSBjpvmgSQZezVu/AU"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbwv88am.0_1593215262378_0.4586349305626427"},"_hasShrinkwrap":false},"2.3.7-canary.kbwxgwmn.0":{"name":"typedconverter","version":"2.3.7-canary.kbwxgwmn.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbwxgwmn.0+9e58720","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9e5872096730b4ada056db7bd448b509f7950c67","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbwxgwmn.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-ZF/4u1/aiZ50HqDDxX7IEC0wOaixwjbXG+8qWJSkc3n/c839PZy4aZvg+a+6eXW2MXPpWm/AhAm1TsD4ybCtNg==","shasum":"d3e51e5db0d0c97ea5eb0e7b30d12963a6796bdc","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbwxgwmn.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9pfTCRA9TVsSAnZWagAAaqIP+wVPC8HJwDi+KrsK0y9C\nIITkoZMHARA/3Vy7ZkiGJcoEr8ZQjr6Gdp7PLmJcisZEzVhMaTnYJeQA8dHJ\nwyf5eTsehmeax71agb8YeL8l9EHo2yQkz6kaEBnvz6UQ3ldbSOC6D3sNtqyI\nkDcZ1QKTv3K9jhjp1QNegfX/KKBrj6eUm9+qWLQpwEdU2S8ocSxoVQLGsSvU\nQcfNLoJZ+1rLL5fvMti4d1+Uld+vo+c8MZhBLIwyfoP47CYLqIq3gLiYZLpB\nxSJY02PLOykO469B5Tu/Dd7tRJXfy2C+dn/fX4E9cg70hfblw9OkuldPpjrT\nKbMjt4x9kMSnI0pjzALWcHhNf3HFqaYB6ezm/tlfYH0EdjDoNA0g9h4cJhIH\n3oHAInVqJFB3nC6L39fuMwgOshH2bQgMVoJANfeAiQFQwK8KsHFcHKiMpIqT\nSbeC+skXOyGKPmFDo9VuiLFM05U68KVHnsQThwk97s7fMPW9VaXZtoBVPt7j\nfRefWJH5jsWEaVFxY/6DxVWTtiQIX7v41HpTi9QvaKb+4YeJSxlEPpq1QNis\nQqZo/xQagFHeeR33N3WLZ6XBSSEodwfjbhUMRcRuhXDIb7YUCsPhglwpGzB7\n8UtLIdKaOx8J4IEw9uY1ktOqIzNOUPa3x74DSv81VBebzpDp1A4OevKHKJOV\nosXg\r\n=or9f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZJmyoyp08Po4yxuAt8FKq3ICcTBWIstLosakhbXfVNQIgdi3S/xQmxkhe8ffwbsaycA+B4EstSxEEsjPTiUp4EdY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbwxgwmn.0_1593219027103_0.32118161843526893"},"_hasShrinkwrap":false},"2.3.7-canary.kbwy7dnv.0":{"name":"typedconverter","version":"2.3.7-canary.kbwy7dnv.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbwy7dnv.0+8340cea","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8340ceac4818b017b05164ff69bcc243f950e96d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbwy7dnv.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-bI/0rRsq0ZCxyr9J3mNCAdDGnaVpBgBFvD2HHuEEXW0+TZZtN1MFipY4RWISpoZM9dXcS40zRwoj5rhjxpn+Dg==","shasum":"7703afb09a30ae5a75f1bf64c0b88dc2140ce1cd","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbwy7dnv.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9pymCRA9TVsSAnZWagAAwSgP/3uZ4ZYrslTLMvwBYob1\nEP8/yw2/gJzmuv7ym+BuUg/cBgY3Q933YJp0bifMJ0m1TZh0cmCUzlg8vhPY\nGw2cxMcQpu3O8mEVwpm5DTnGvCn4QjiRXxNOjhWOWXgo0ljz7WkLof1upMdc\nGNiWgwbCvrNRL5vKVVMr5KuyYoyR19CDmfN++oLbgYj/H0mROOZHeAVirH49\nVFN8KlB8atxFeceFSJ0T5RFARPyRgyADZ3l7ab2yTJ3G5QwikLzo35I8UTmE\nrGlipvBM1P1+hE2Mu3ynZojwmIFGqVxY16jxPwlj3PX/dkwXUUrv9tFk0cIU\nANglA8Vn3WPV1OVlMsUnkkg+bwePhZkW2hJ5tTv8zFVTS7sFHBYHoI84GVY9\njVIxGYGMNQw1pgXKMQYOOcWosts/2IB4/So7wpjv6C1RcxjzF9/mHbVE3kbD\npLNbJFqmkPE+zWRFZHohRgqCsVdkmlp9oNsd+VQjb4AvwA35YpaHbd8HLKYR\nf+vo3LrOKBCB0ATKusKLLswg3UmQICT+1vaBdPeSN2VaQ3Ih/Adwk5ElnAPu\npjJ9ikAT1G4spV3EGJYo/EnVlkhKKtmzjX9xhXhj84BPQFN/NQj/5Uim73m7\nfRYsOdkTd9ICTyhglSitAkJ3olRTPZuzXAKMlhTAbF6gfOsHERjMpDhdTD/d\nBmw8\r\n=NGGr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICc8jiHAiP2B7TeQ7dnCG/UIfRQ0y9Xji5D92a2L11xgAiEA4/ITMxgcxw4B1nS4v1U8ALt9pkZ3zq7nrRbw4zbnPgs="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbwy7dnv.0_1593220262415_0.9951289880201841"},"_hasShrinkwrap":false},"2.3.7-canary.kbx8uhbt.0":{"name":"typedconverter","version":"2.3.7-canary.kbx8uhbt.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbx8uhbt.0+5c9fb4b","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5c9fb4bbcee4097ea4518f571c46b874f022c260","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbx8uhbt.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-UxISv6jVN5HG2Oq+JnnZZSvwbr9iuzx5pB98bDoE2EvIyCuEJnxMTuigcCzsW1c0IrKSEN0d9AFgB1ezD9zGCw==","shasum":"013d374748aaffa622e422b34e7cedb40ec4f7d8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbx8uhbt.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9uJ4CRA9TVsSAnZWagAAb68P+gOCrfXhwGAxpuSw4hxH\n1WBHnlV5LjZH6bCXpb5a3Z9P+af7wpdTVOJuXOLhXevnsyPb4CURz1wGRMKN\nn3tLj2k7+JbnbNs4t7sdFYYxM4L5pJ0vIHH/eZmtXkj9wB0ay+FxZl1ONWGh\nz9cuKq+RXI3gu91hYrqP2pArUH9w8IIFDkNpqReiTNiM4y/iB/SJ48Z2h+DA\nQ4pIR89OrrnR/a7tma3634lKDltyEQ7nyGB16HlSYm/WXxI/pCVRQBuR71dO\nOTyAutlr4ZdFo/WTUGmmhIdBhQqjwzZg5yyaCq1v7rs3K+36eSzTjAW5fO+z\ncaUdSiGOAwMrnyf3GULAyQ08I97yW9I1Q3doIUTZDgpiqvi7JwUzadZZrgnj\nCEUt+SUwUX5rKX3wgoQukWGoXpR+fy+nzpEdpao6/syGeZ8eAppLQUnlbmyH\nqjxhHWS0rrqaz0EPoXkP5OYnJtElr4BISlVyxT5Ljdz59vBwCk9S9socgbSD\nB2SvC7/Rb2nisq1jZtd9G2iO37u+QANoHXZnoZoHibmcxro1M7vjRb+/Y9ot\njYS4qC9bq1JiSsPzaJOZePm4qDpShyQ0uBrEmDNZWqodmeKT6LlB90MDGXHI\nutokXDke4xVA4yrFoHPhWPTL4L5t8lD2Oe/wj+HZbS8iY9zeKbJjL6YvtnCD\nBdRG\r\n=Uztz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVhydUte/PS+d5E/FoOzBXPKLa618lPm3Q4zac6F2LrQIhAJwAgBtIVSId5+VAIJ22Qvnmy6Lim6VaIVfu3QfdeK/w"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbx8uhbt.0_1593238135944_0.355083895073947"},"_hasShrinkwrap":false},"2.3.7-canary.kby6baek.0":{"name":"typedconverter","version":"2.3.7-canary.kby6baek.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kby6baek.0+3dcf2e8","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3dcf2e82f9270aa8077c641dba77ee30d287b0d5","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kby6baek.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-MjKouMi4YHNGeOiqVwaEce7oZv8DfzEaPMIPZpepnkEau+VAS4IR51Ldp52Em3WHumMSDEzEEWFgpcnyVQWlJg==","shasum":"4779c9ed260f389f7c54d85fa8589e36c92df426","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kby6baek.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe974MCRA9TVsSAnZWagAA9HoP/Rn6HB1NMfqDhplEQSh1\nnMTniuzJ+Do3qeZWXJsbFTAN+Vsm9ugcZSdjnR9lmfHrGu6E77aljauH/s52\n5nPpVArbdJ2WHhUx2vPk9d65xkH3kqKpWlVidG0z4H9GvBgrN12jTOq8DGo5\nqak6k7YnMsl6m64gpbrL8vKFrWyzgjyDqmp8hK++1kVwMzc1WHmxaG7ic6Rl\ngVNqwPaaArVRTxSjo2rZtmSTlYbK0TKEoUEF58cOSOhiJ47FVtHKNQt5C/DH\nocMpJBRLSj7Cjnd7JeSOwKTcqzq8YDo2OM+4DlU/qEr6Kvqy/zoior+uh0J1\nolcyDivjxIMGxjy69ZrMkDg9M5tzlNsGEQtpG+7JwzjAjOevXW+PnNGVcUMw\nP2yqZP90NQ3pZVsOMQTyopKFZqI57xUvE3x+vPQTF36rcrA6dA993vtJAw0+\nKU3rUNZkITbIkvqciaxzQF6kR/0KHZ7jt3sUHriNmsQJ6+EsnrLslIDFdqRG\nhseuyCv9pDJY8GiCYMR2nZHf3ykARCivp/79CT2Iv7i8nA2XcEI+9pbAd4sl\nwBonRiVaqvRkQUJcrnqUErDdAmoNI1HWk4uvYzPZXPWXpbUANuKLaVkq5sls\niHYTyY7BU5beAcR2olbtcgGC3mFcOQCxJvETzEOAse/P+KjytorafF/9Wyaw\nWEpv\r\n=w0XK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7Y49ijxlSllriYj3whrb0HbDRLFOo8o/q/FVUHetGeAiEAxDV1CGlKxqQvWknFlySKj2zKU13WtJRqTVJ6SQ/KIAg="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kby6baek.0_1593294348057_0.9397888963162533"},"_hasShrinkwrap":false},"2.3.7-canary.kbyejgob.0":{"name":"typedconverter","version":"2.3.7-canary.kbyejgob.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbyejgob.0+cdf586e","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"cdf586edf2c62ed689f8b7bdfed8605d6802908f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbyejgob.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-Q5AXjz+dbivFP6mflt0cfpKeT/kTAOHxLigPwCFi94V5feiMBVKgjjMoR7F3m/oLW6XK+QkxOBbKOa48K/ZU5g==","shasum":"f84f4894dc221b2b619b805f2183961340803d1c","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbyejgob.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9/QGCRA9TVsSAnZWagAAMgEP/R1YIQtUWlabnw1gRaPN\nnzscPuMlaH8mL3dNNb6eNPFV+b072y8K6NWRzGpYeAmLZylEfz78RnHpl9jN\nB61rS/zrNmY9/AbAmnnKUG7l8zE3XcwjgGxEt3jSETZBMbd5f6V0EwcDnfyd\nN/LlRZCiNu0+KpzyCg5SySGH6YoDuyr0iZtS9V7SnvmPO82mS1wEL0vKFlYF\n4bkJH3G9NZO62zqUTF71mHFS//Jb3zc7qvZy1aZo/fHUpNi2u3xL3oE95iOp\nTzpZMp7Y/9RPVidbFlvVrzqtdlG6s1ekrntBG4mprm+2e6C9YINMxnDNJiUk\n0h8KjDTtj0ZyFyqsDK0URFXANq0XHV8Ym0yu5mYyxkb8JmLekVXtq7YUNPwd\nX+UNNI/FpKUezVWYGdD/IklrdhTukWVWyqeYvVka9DWBSaGk2hfeKvhKZJFu\nbFQuiP9pIWIr4KGF8h5MKe7gIv25piWYsCZFtEFmZl7P34Nx/YzhCD2vO5Gh\nW/d83QYmtD2fPbLz+TfzEYp05+rBq1NtAqCHhlEnKC6NzZ7fXBRnSpvUVNsT\nF1vGe8TK5EKGduGHg0uQIRoEdw7+O20WZwyfnOMqwjKQ/akxKwyyDwLInFMW\nKVrSqJ17jKXZnC1HxynLmUH9Sbzvm3aiCR0Ck3ZkplhiJ8jvRyB00WD3z3+6\nldMc\r\n=zuli\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiGDi+7lpZSDgo0UNjjHpmApKxxGyJgttBV20JdlApngIgMLLlauR3TmbX0Ywvlh+BlBOR6sVvoGRkI/d6/niq1vk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbyejgob.0_1593308165821_0.22271202412615"},"_hasShrinkwrap":false},"2.3.7-canary.kbyvfeer.0":{"name":"typedconverter","version":"2.3.7-canary.kbyvfeer.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kbyvfeer.0+c34b656","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"c34b65684d8325dfdff30fe799cbfdc5583d06de","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kbyvfeer.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-i+I87m/ocxuRc3Isu5Uz0xA9vfhMJjIPdnvJYl0JgnyJqTrV38tMfzjEChmTaz4V3frRlVuN7j20V94hWcn0qg==","shasum":"8fa89afeecb7b872c18ed7f125167f378de6376a","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kbyvfeer.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+GLSCRA9TVsSAnZWagAA3JgQAJof2G4Z9rYvsXw9QF9P\ndgZGLJ4dwQgBtmdzr2ZRxEbWgrH70kGKrEkYh4+c4/AiZ6D4xxMdVsMJhjqy\nDyQvmoE2iwL4l08Qoio7kz/GKMlSB7L9LIJ77alfJbYodsBBD5CIxJCmyQOq\nWJ2HMtkvOATcBjSTgS14+DbV1lUJS89ayTjLk4GtU8W459zJVlJZDtKD0wGu\nThNZAG1HXkTtxZiUdWYkM32IVNyj1q5jsBcZclfNC7deXA2SKyskaqQExu3D\nT8MfhvuoPFdQ61LP2aEB/1lvXwqE+se5JDA0D7IDqkQF/rO47P9No7+fYlkb\n0KPamFvA1CjzocbP0+roNIQPZVHyPgrB4EnT53jDjMrNWm8FFlmQfGgsQiNC\nTt7zOt/Eiu9Hcxvc2EdQRKwAx6Ciord62I8JSkhppVbsIsSGFGz+fDJCcbkV\ncDbJSj/ydAAX3l0yQK32beUQgd3uo4CXRqa7VK4CkG/Yw/FcWOtiXYzH+1Lc\nfrBZ+4NaKp6qlHBfDTgT28ZQjMea3/8mt4kqW13Lt8dogyiPsmTjC190iSS+\nZYYleUVduGJpUlGSxpBJakDRfaMyYHbTWc0q73Ts/rEquOIxx0pVNO/HshVx\n67ozh2FSWCRLHo4IknSasO9J68wOV87IIlNmGYvaTi1ujITs+fOq+CfpSral\nBaVI\r\n=D1ya\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrUSYmhCT+gH4ojb0eLDdM/7weC1ONCfcbgnUiZX80EgIgH3c5eAExxFqprDsXtxkxfQzXiHeQSYtDYot3xhQwH1U="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kbyvfeer.0_1593336530399_0.6970089651690021"},"_hasShrinkwrap":false},"2.3.7-canary.kc1bv7t9.0":{"name":"typedconverter","version":"2.3.7-canary.kc1bv7t9.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc1bv7t9.0+8b07711","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8b07711f7c88b02d9a92012c50917c7bbf3f47a0","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc1bv7t9.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-RYGunbawJ8sKNjrSAZxevokAA8g/np0JB82f1tVyXUpeSl2HuISWwGF0VJ1cB1HXA5o51ZHViZkg00uioZiKDw==","shasum":"79ff7114c92295ac917ef15d4849a7d6e708e6c3","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc1bv7t9.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+qcSCRA9TVsSAnZWagAAxRwP/19wGIKr3IyHrnZnNY0E\nMQ8e2OMy8SBcHh67bh16t1pbyUsL7xu0Nf7rga9VO8191cH8yJ+LYSyV90hG\n0/QzeEKBqQwU8jH3iYPcrvwzuZq0eKsGfdbWy39o7dOH2PyHaia4VJ+xlAV+\nmNssFdCYvO+M7XD5jz1AkJhrT+Ngwv3xgIISadW2B3+R5t0gtr42g72moTXh\nLtHlSG1jsPY5nZ/TYX8IDOSM0zv3eynptLfxc5EhapMzXIt4H1LCXACUhVLt\n9sC2FgLoe4vSpjgPDUUnIwGySOtn5wnU8Rb6c46OVkDHfP04uzsFMzSX7mlX\nQ0L18QWIC/xPrw26WJ7IIFIIkqkWDTM9ANv0hRVJQZ8R26tS/iIsJXnqOfWS\nkaB5xcYB1R6kHQ66Uuxon72QHVmvEnX3XzbKGHWgFYaSMTNp//rt4gSQDUpi\n8oW7PmOmB7dujhiKEGawE7nXe17PL6ous1hfG5rONyPLw9AI+ATyIcXkVUQD\naMIvy4r0b+GvNy66R9E1SvKDt6IUd6x0msO21vMczzZUU6xSYAIB3QwVzUfE\nr2duKGia4NsD1+rOfchutUitkJnWHkeoeLkEYFTvvW3EQ7/UHFi2xeON5r3E\nnsiRDcf/Oz2QuuCr+RMDOEZBGTfYolpuHgr6sYKVUO6xgRK3XUy/t7p+el3p\nWJtt\r\n=aUlx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQ2DDPUpSpK2dCSpkut53nk8HbgcLhB4C40QeDxUev7AiBiAY7h4YeZYLMAPASxshEtmATq6Kjmei07MqeMxdfpjg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc1bv7t9.0_1593485073877_0.9939621604950384"},"_hasShrinkwrap":false},"2.3.7-canary.kc1j62zf.0":{"name":"typedconverter","version":"2.3.7-canary.kc1j62zf.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc1j62zf.0+2f98d37","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"2f98d379811b8883be0add0184d0394e516d4099","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc1j62zf.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-B8uBDjTJbfuO+ofpuv9UiOJRetar4SVUTwTn3Vjw6Eo9w3wH3pRBAiHsBzlmyL4zwK2Ms7C5rrFqG2AQ5TEl2w==","shasum":"8c0cc91a87431f6da24e6ea8568b8532fb7c02f9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc1j62zf.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+tb6CRA9TVsSAnZWagAAqacP/1OFqanbHWFQgRQ6jpnQ\nsI6WER+5unGrSSgxt8hz0gxkZClGQwj/dSbB50+8PBNlFW8XvzRrt39bksFb\n4kPQ8N+wc0bR9ewwIp7LIH2LhwQplftStVXFEMknE6rI1V0fCocyxiNC9Hhb\ngoM7sXqjuoKespAJ4cOUmpYefTV+gjrjWh7iKLk1PivcfW6KZ2Fm2BOjreAu\nP8OSMr7oUiOTbKpD3EuVP8u5aWOH8cs4VIMaybmxwG9D5WxiLJAkfc16HwB+\niNtmSCXloWhvesccr0HwA0qgkPMj56jLV/hku/y12LKQxATBKB6uAB7HKXyd\n6+XK7KlpXwaVzPYkHac0h3A6A5gylvSQAoUCprOTqElhLMHHJdz1kjqcDLrv\nsZ8q6zZhawpTeggyCUTsphRdGvhqcjELpxPGOOLIaScXIDxgucU8JRtJKTnB\ng4+1jwO+8iauGjH3zbY/FGs12UeGWXp4/pKMwqR1CX6jb+nzCaKqVyUw8CjI\nLw4Lq/DI8e9o7cnZUguultWKOMEJrk9d1k7ARTCmMQ7MebXS+sfgFMRHH1S1\nsN/8iuuRqTHDr1kTkBIriCoxUPRleEsQebx5F1cAAqonPxa6AbktTue0Ynxo\nC5b0/w2AmEcYyatP0Ie8ApiVL+XCZwPyso221Z4ErE20irAMK3rXiQDNg7hT\nUjmF\r\n=AkcG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa7HmgInfpAbVaD1PTLbqEK2WG/e0BB6RLBhkt/Y89rAiEAg19VfWGs1C+YCyzvHk/V/6bMAPDaD5wcWx1jalCQMjg="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc1j62zf.0_1593497338218_0.6072576988014835"},"_hasShrinkwrap":false},"2.3.7-canary.kc1pwqwc.0":{"name":"typedconverter","version":"2.3.7-canary.kc1pwqwc.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc1pwqwc.0+5a00072","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5a00072e784b732caa800ce0ceb07e6264de1384","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc1pwqwc.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-bng16OuHkGFtb/61BlOhJ0RlOc2YcIQwyiihkUc+/UUHb3nTYXp7gj0ylixt5gjM3+hUJO1mywjAV2iYrxefzQ==","shasum":"2281845bf01dfc57cac8acd44b908b29b4b9af9b","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc1pwqwc.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+wM1CRA9TVsSAnZWagAAnm8P/j1pgSu++hIxwaqHct1h\nYZodV7ifNyLqVFSlp4hVnIW6IbaYoWAjuRBRSKejiOkwNFsqKQ4ISFXOfNgd\ngOlv7n7Nmipza0SvzPiLNWnLofPgjGMXxRwNVjJHJOzQxBo9NhOMT0LLmLLJ\nk5k+/7dG/NIRPwURkOJDMRst9kVfSDuvLx5k5BjBHFTXxM2v0LVUmusIjRf0\n7BV07sqacjOHjY87HZeT5b5ivp3nm3bHtcRY5sAZ+cATAVyaSKH/Bqlepco3\nzid3ejKoCpO5nwlXJMk7s7TsPI+iFdidP6d2W+5BQxJGSd74s31Dfh3hVWWI\nZjix4rrYcbvD1ojjAOrSnuL7VOOPYYy6D5m6HgeM6wmxOh8n0HBdgZc5XzEe\nQTojMpFFfCne4DGlrI0SCABCBq0wPm1bGwY8zTog/q7PpOBN4oRW5BO9MNRS\nSvQ+1TuJRGOxaM9REreOkyS3b3N1Bb/psB+aCEfJLMP9qtR4Z1cjZ8YnrAD9\nA225WNUJKn6AkWXHH6flsvwrfNBKEz1o1i5teU6HIhEDXY//tTTwSEYSga95\n4MFemu67gkhyWsfWxcLl/gtHoqmlmrlY66wB+P2Zg40ufiup2CvH7Q/J8GhX\nEv7TNBHYkK2zhNoeJm8Fn8hBwfqthQN/Ajm1ZbKKGOUaeNHnZe8KBhZRwajy\ncAd1\r\n=6/n5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfDc3hBBeqg4LRfopmTz/s6D6zxPCm+XxMrUs7YtM5yAiBDW3F9NcgikBg7AELXaZv0Q4hliAVTUbeTYrLlD4u8/A=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc1pwqwc.0_1593508660936_0.9535069366775923"},"_hasShrinkwrap":false},"2.3.7-canary.kc6u1s8b.0":{"name":"typedconverter","version":"2.3.7-canary.kc6u1s8b.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc6u1s8b.0+adec22f","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"adec22f2ad69278c901d066b154114d5e0b6d1fe","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc6u1s8b.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-K1FMCUxKiiY/iYGcK1VTjQhNT7SftlX1lEaniUBM69yFB7Q+BN6I02C7HEF9Hvxgt9ISySlXbWOBot1ljt4Y2Q==","shasum":"f390784d37823a6a612adafb11fc4b40219e818b","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc6u1s8b.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/7tjCRA9TVsSAnZWagAAF6oP/j8RzzlDagqoKrrhj1L3\nl3XH1u6YC6a8RiZh66BTp+2mlhLG5W76b2x8bO85fUqCkbnJ6Y8Tp8/fKKTH\n9SGIm/dirUMiqBrHCe/OcJfOq0rq3ezIAD3a85/jWtk9z5ccWrlvXmA7AaMo\njZ/+2sDV5PD7F8JXu0wMIndy59VKmjLc+tdXk7ncI2DPXJLuACh+4lFd7YOR\nVRBl4YrU+oCbsiEnUkZWkGq8EGcQht4SL3R10R92DK98asZcJNQT3z48nvcU\n8kSMnosa30tzoIfi33/HpSzPfh5OoTUdMzSSguu5lnocTa5gZmtvVY/tNO6D\nSM+Lg+BDvnHZ+xXEvvy55lFn9FhIl4bq4AaYjDVwOz9jbFNYV44jZcLOa6NQ\nBGAStk/QXUlSwnGGEaJKfsARlNJ069iWbVp4c5u9ojag6qk00tSp7/eRnMFT\nnH6BfCD9rPf8aOpQsYgabPPBv1AYbnjNlsfmYLVCcmJc4Zr2JxiReZFGparb\nLsTDN2YcyuI04UzKhlocxcSuhVwqfoCx6W83PLb08MCbAZ7YE4HjcBL/VVuI\nv6eP6YwRwe1uIUbzjGjdJoK2rH+I9dwfNduIHFeRxxtkuq0DjcnU1iyiqi6w\nbofrqHGFARXkIEBRu4z+EtfEIavp3J9Wm61DBRPznhYi4tEnIDwW0JkZjPyO\np4UE\r\n=oXfF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqeabhuWxGoutqXlimXP0EFAdP3H//+NZCuiUAIjbZzwIhALiVFIQmZsSztffEcgquGxL9p+cMH8oUHj0057tcx/HI"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc6u1s8b.0_1593817954604_0.6041966936465974"},"_hasShrinkwrap":false},"2.3.7-canary.kc6zqei2.0":{"name":"typedconverter","version":"2.3.7-canary.kc6zqei2.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc6zqei2.0+5053ec1","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5053ec1594498080b795e4c92800a3b4aa5cf601","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc6zqei2.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-A5ZxCfUfIivN3/YHfwsEeh1r0At+W2ER3UTOHkLPFGCstRCj8y72onKQRBOvaErbr3Xh+b+CqJmv8EgDEaRh5g==","shasum":"0401d6f99180703800649c41fa1156e4fba3bca0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc6zqei2.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/+CjCRA9TVsSAnZWagAA/P8P/0VxZ1Y4oN9Olgqh799q\nHMXc3k5NXToF9Cik2MKiRowqqs5P0rFyMOmCF2BDsrchThPQs3ep4fEPkUT6\nwbVrCSMnOG0cylCzeK40jU2ZcjObTHyIvj0DP59lBFUhxi/H3pWuYoLFnty1\nGVa8sz7x1JFz/1SzI95mEP85T5TqFqzt2fRWGOJ06JxFANhq5B5XPs8ARlJN\nPx1TKgou0wTri17HtPC1JPeyoX8wA5bM/vZmaCOx4Y8QgkpdQ47Q56v9gjwZ\nSbb5nG1CQArwoGIQh2qp77CIgz5NcPrue3sITpRU2+sA6B8/M/jukxXr2rlJ\n3IOsWwWmQlHTLLrcZVrNyXynUtNkEO2ntQoHbaRoO46wBtg71gMt3rezB45K\nQvcmdi2IQHxZmCJZT6zMPws1fN7IxFtU6kAem7uzxzgrGoHem/ZD1QX0qmB9\nDgKxHBfGvbCzyrbDaT4vOtbu5U3YhnQvuJ8c+J0marjKbB4fJMN562XbPqvG\nbuMFEH87xDV2R4URrs8LP5f+idVCArN0wWkbZWrvt0ds+ZFLmrKPD56xFu8r\nvgaZD6CTQPrRAtIzpcmHOIMKWLNOSk9lRnHMpEcekePbonpIFnzIdjsDQdb9\nnbKvOQoiOW5jQD1sPiq+GQxEhbmnP2hoTwlth/ev1XfcOefiGmhoG3vcMNJo\nTNTn\r\n=EZBk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7+rrr9ONMTOfN1EZmCx1bVCR0bNjYz3zbp1V+FqEOHAiEAw/vkJB5yCSk+HpTyas/MTgpHJFuFIXZW5NtoRRFs6DE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc6zqei2.0_1593827491068_0.08425839862240214"},"_hasShrinkwrap":false},"2.3.7-canary.kc7ailpb.0":{"name":"typedconverter","version":"2.3.7-canary.kc7ailpb.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kc7ailpb.0+05f5749","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"05f574952f8f5ca131844e05d992fa7a2698f3e2","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kc7ailpb.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-sR7ty5m03+CGIe8rtgl/4GUoXiTFimeT6SRjA7eyr1ZfkRLZoXPip5+/3n8w9RbfWS6kS6fetafcShEa7hBFxQ==","shasum":"974f7c9552553916b24803f0cd153435c5fc4d13","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kc7ailpb.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfACdjCRA9TVsSAnZWagAA09oP/R53CIfrsGnYdOV3XxeW\nybxKVPFegwo1OT+bIm1oMTSYqOc6kI2erFWBv/+rrMpzdl7ANYcKbYj1ClZr\n7sX4GgCzvY+2E6HdY6bjy0WPtHjX8/6mP+EwV7aABGzn1vyE4RQLp6swmNIx\nOKLeLcZBj04WutBwGmrTjhtbwLIt42jyJBp0dKVElaKLLpkUiGCKTvEfDszR\nyJz1DQiwSNNdMc+lLwRcc1+6GPBn9Vhc7hW16C2IKc/uXn1re2Bz1sQaOFr2\nGIcGlVYXttEII3joRrvC7VhK32ol7rB8/awyQwkaiTOA7dUS87HKr+aB151D\nVK1U74Ogq44iJpbGHkrHMsTZXlC6c6KtnBWd8FMtU9TufnRH/ENmW2cbPW/Q\nPIi/5ld28Pcp/hvSuh6jrgpggalkr1Tv5aNKhl9UsD5tstEt0p91VuPC1Vus\nNuz8yelqZmvvR0XXO2VFTbnBWY8NUlgDLFyi91EtIkX2GwD8he7+egL3UXrl\nz9y49mEbAclKlQHgFo5Tfz2AoNmRBfO/yHW5sJj5/QMiLtEyw13BTNrYdH0B\nopBzMzGVGSvmDOChVn5XxH5bXAsXgGxbyPhtedZOWpFVv1qxqn6BAEVkoezQ\nIdbBSdTzYIGZ4bCgFcCKhP8ozw/cPFhsyrMi813hNMLuSzjuK1ZccG6I94Vh\nHsxM\r\n=YahI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5L4VQo5DPyB97oA+mAiuNan2OJ7oua1s3z/aQCdDoigIgb+nbz2+V6tV/E/DmZLQdV9EtMUd0nLhEP6LJ4BIylkA="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kc7ailpb.0_1593845602731_0.4295984119825571"},"_hasShrinkwrap":false},"2.3.7-canary.kciolr74.0":{"name":"typedconverter","version":"2.3.7-canary.kciolr74.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kciolr74.0+f1d046a","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"f1d046a0797df68f93a1a502270d0ed075d25736","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kciolr74.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-3qDLEiieZ+VgbLgrn1WBbp8rVmwDUF9v7d5epLEUoxLmJ0isPh3z5Ip7Mgo1pxw4Pp7rPqfsG3xUOzfE5Q1K8g==","shasum":"90077af0fbd262b751535a7d43e53104eb75a3f7","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kciolr74.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCqn5CRA9TVsSAnZWagAAzPoP/AgakHp8ZJ4winpLFwyb\nLDLJG5dKePI2GyI3d/FAIvRIYvPCSYwELkn+hsomXZBV3jXPtmlydgra7ORw\nDhNG32Ql/csra/nlEzqZ2fOoZ8ZNt/9v7WMBayoIFHUyuVhJjuWap3aY2ZPz\n42SDUNWMliCgpjKyT18r53Qh3oZdyhV/0rl4fNiyOuB2+8KpN5Em4ewmNy1c\nqATgEaEKBmDh8IJ5WcY2bDSqUWthXokIbjoNsjX4BkP7dN4tOKCNRLp8vt+8\nAxf26huyKDT/oW9c6K/lhjt/4LRjS4eBMzaiWc3vM3pp5grMSrdUwiL7znLH\nF1EsHveuowRrJLPu53qwGhj9xDR3jO6RIAtewIAjblt78TTElpDc9u39kYih\ndbxkTDCkmjCaKLckk+IHdWsVCdoj1PnyJj8qbcBHuUzPzrZp5iHzH1mACwRO\nxfz/VMfU2sHzxfRqCXGoaYjh+QMr3X0Ta8Ia1vEiTxSrzyYQa080CMN3J3j/\nro7EEuGkoRuxtemDRVRUEluEeLM67T6LJenWZR6Blxo0jROT8HCIZ5GBFC2O\nQ9Zrh5wTUfx+xneRmvqpRsV0czMRwJkw61xMzrcJK6EmYRvUH432gjLfOJhg\nyc44OzCIm87d3Mrtx8C01dw7wToV02P6NWR4bkenTUnkWFWyx8UWVa3n/Cm9\nRa6o\r\n=ftKy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtpa7I6hRqwptJHczb+qYVNnzq58W3mFWJGwOOoO/ZPwIgQEVJQ0RSOKcLq/x6kU7eh0bLKIDeQtWxg1x/IpCPRHI="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kciolr74.0_1594534392802_0.8759586624594644"},"_hasShrinkwrap":false},"2.3.7-canary.kckaf5hv.0":{"name":"typedconverter","version":"2.3.7-canary.kckaf5hv.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kckaf5hv.0+d4e0415","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d4e0415ee441087f122f131b925d59190a0d95df","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kckaf5hv.0","_nodeVersion":"12.18.1","_npmVersion":"lerna/3.22.1/node@v12.18.1+x64 (linux)","dist":{"integrity":"sha512-ErfyBQRtvU/+rqA18X/jy8oQ3v64zrafwU1dHcpKHCu5HfLEq8kT50/4u4B/UopaQlW8Pnn6KZNVmSgmub9XfA==","shasum":"d1372d3a1caa9a8080f6648da03d0682618a0d24","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kckaf5hv.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDCVOCRA9TVsSAnZWagAANfYP/RTcuadNbGm8ep8s0r4B\nF5bLsk/I0eIi1tcaLSd+wrfUeiKVYl6sFrSOQ1MXT0JUnS9NE8W7x6BwcjIO\n9a66bUHpOnC+9dh0ouL1mUeCI/qSyQh9VhSH+qajW5WzJCM/CWrR2vBbTALK\n/5hQN1b4soneXk7fMYxGHi+tc2kcnVP5ZttKcIqtDz5d23xWoHz9zGLoNu7I\nFlsXDCU8jN/1oJeEDOiSNWCqQfOLiuzvQou232gDbjfP43sOKCw49gnUGCDm\nfXgKrJTt7CJOF9bXxCz1joXFdxcT60WmNKDjgap6YSvI0P2ig4JGYnH9USU8\n+EthPhu0ZOy78jJoZfHCmwTdNWMthSeMp68SzuiD5+VB5Z1oxABYICV2iHoH\nuspHrMTL8oGGfAduwrFL5Mk1yaJRLIbt9hiS4RCWXkSDoGCZDIm16Tu2Z0kF\nApmWdQPALL3qi6yNZJKg7gRqS/4vLt3zmL4O6JbDxjBxWoxHj7W/brblgH09\njl9UnYCsFDjc7/SlL6rOTfXFCr99jn+W5TYGq2Y40evFYd8Sgo9ivjXri6Da\ntoepBF74qMDLWfxcpBxhV8C2K4WONNNtLK2vpv/B5pUO9z33/vEVbvz2zi1L\nes8pzugsk3IsOTaZQPLjq1Tw7Nc2QPzDSPvbcXr7MIwR2iQbo97OPa1SajnS\nGaU9\r\n=baOF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvqx1F9KhwDZFMLkLPinnp6LnLYZsUiSpL7OuZXsAPmQIgcyEI2yfB1uRCDRnO39shj/id7lJhWCVdHYBD6ZxmfRY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kckaf5hv.0_1594631501879_0.5024593071286814"},"_hasShrinkwrap":false},"2.3.7-canary.kcras9pq.0":{"name":"typedconverter","version":"2.3.7-canary.kcras9pq.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kcras9pq.0+fdc190f","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fdc190f87cf801025bd41495ef0ba37c018690ad","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcras9pq.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-amBpfOJHY7YJZfybFlVJMhbJ1jMQxcdMJOvZ48CPttuDNWWB6okIXciJezYWVs7Mw4SG6tBzPL3WaP7I3drTpw==","shasum":"8819c588ee784f6620af4cc9fc14f57a7c181fb1","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcras9pq.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEp0SCRA9TVsSAnZWagAA0CgP/0OWxUTCqkPimzHmpbqs\nxsTUur+e/8Arai3Qmm+6hOenTr+kcMrBKtvEeCQZThh8lOCU1r+uMemD82V+\nTV9/KU4xWAxVi4aDSS3uI4ZaM2JRB5XtsEfOgw3CDe6savRfdb7Js8yadE57\naYTXQTpSR0F6aHNgFCizuXMWmlmPCimcfYmmXagsEZMjAF4UPcdznR0ODO8s\nLxrQ2srpgqW7gTb7DMa3ijHoleRD6OZpD6X7p7tXN479mtXBi5Zj81kGMHHB\naOXUGETFY1zkbB1NeTjT8UEauMaJR4y4i0bq0uWWparyg0iybBaFSr6QW1dx\nHSnZYWxrfd2ivYpV7ImaCdu8G3zMJelh0ZxPwIh54LUsyKMHMcz02fzF3Fo+\ncobYKFXYEbQY2ZgrZHZur5JsNa/036okneY0dGUHVW0w1etnd/MWBGv0YsPl\ng234YZNZvHRE1v/cFuV8fqS6fIIREg2hWNsDI8S1N+oMyX9QM/7MGG+IVVYU\nn7oIsZngtcJIUxTCIvk+ow4AUkTbm1Hh7fXeKFn7mqrV38iAcIMMB3DWaVXI\nojBe6PcCqfGeWtV2aGHjFhKrc197BNcbkX7dEsLgn/QhK7CSchfTcHhYEN4d\nwfRrZpetYRgEJsrRNXH3lyjUzSgIps2camxLcP/XsV3BsgNFpCWVDglBej1N\nmxL7\r\n=5m8H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBHR6DEt60tlJaZvyZCk2oGMhNSzfiCabIxnqNh9mIlDAiBAHd3ySGMLD5VWfFfTLPidwPRf1ZB5KTTbUJyes1YGOA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcras9pq.0_1595055377525_0.822748245030622"},"_hasShrinkwrap":false},"2.3.7-canary.kcrinrbo.0":{"name":"typedconverter","version":"2.3.7-canary.kcrinrbo.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.0.0","tinspector":"3.2.3-canary.kcrinrbo.0+8cf3108","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.2","@types/jest":"^26.0.0","@types/lodash":"^4.14.156","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.0.1","lodash":"^4.17.15","ts-jest":"^26.1.1","ts-node":"^8.10.2","typescript":"^3.9.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8cf3108f2cbf5cd2a9ddf7da1fb02feacb1aec5b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcrinrbo.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-xFrMRBSpcCkgOT9A8xclMkMkvD63KYdP/1XheP0FKuGcHuxHUdlgAvI6tS6x1QepqSQQxFBkePkBALQHLiAacA==","shasum":"fd30e705399b82b2f20d37b61a3e4d78e414fd52","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcrinrbo.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEtC8CRA9TVsSAnZWagAAncgQAIFoaesdOwxG/uIcFGgA\ngEdK7iQlQuFDVkoX5CRvgWuUkfawj3mKCTsd938CcQJpyoChS0Eh5EuZkLrc\nesx9Wjx4TwrPvRCU8AJ2NZOyLaCcKix0BLll++mj8UFZeFzoX5EPSPW7oxYY\nUkqk5w8d6G1nRaU1ztS3FwnlaI4CnOQy1dcpG6Ayad71QAt2b1FvpxiL4wQY\nTpDaBj3yMIBE4RctYFODeFqeQM5Pj8PY9C7aen62Ekd0+2lduif4Q5qiJPdk\njpB0VlsASYaakar7Jl3kQ1IWNQFxgFor9TwGjABYk/JjNC81XTM+Aw9OcOEE\ndG6cm1rjiXzFmJRf6DuMYt3jOXeG5reVmQAuwvTcbf9Uu3el4xGgdbiUPJVh\n3MAdSTNgofH1GrwoqdYGgHwXCU5tUfak7Z/rXw6C/LrJ1crWC/yCAx7FnyyW\nNNgaxftnd8EADCvB4KFrxt0twOEaza8GJU4p76CafSuDG2BzBYYaD3SBYeyn\nd1iEHt1uTzI/pCbXq957uhavtqeO+MRZK84RwDUYHZmkrrhhs+PoE2bWhRl7\njpEi1WvPPkiU4TwzgmPb3896wdbcs3P3pLSKOKSHPC1f6FHMXoopUytW7X2J\nb4bX9KunD2LtX0Jo+QHOYQ/VHgi6PP22dLWxrU0GVUUHFy7u4ypLnr7keqrf\nyg9O\r\n=cnJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChSY0W1L2m9qPPa7gabWEqjLU2qw+/yp2hOtWcF3xkjgIhALqHszahXfLACfr1jvVkDr5TQy+O6iEqUrI7GgjpZOcx"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcrinrbo.0_1595068604303_0.882003326092309"},"_hasShrinkwrap":false},"2.3.7-canary.kcs5b8ny.0":{"name":"typedconverter","version":"2.3.7-canary.kcs5b8ny.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kcs5b8ny.0+5930d38","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5930d385ab838c3952a6a06fedda2417d803e49a","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcs5b8ny.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-XcaET9T/sJhP7AbifxFc0+S1PKUlHYwlAajDH75XG3pDrc1nynvGl7c7RmU2pVlcRQnLhiiPuZYVz/x/lCgqlw==","shasum":"942c0f274266b5d32b8c723d86faff21bda50265","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcs5b8ny.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfE2VbCRA9TVsSAnZWagAA2RUP/jNktRLzPCT90ew4qU8N\n9A2+566LvFJLF70VsOV7ULfantxMv6HRos/R4mANBX+dbobNqANxZTMA1cQh\nhD3TdvNeKzpwVtDBcj2z24kSEOstIWOvbZF8pJ3rNApfwYd33cpMb/QF61Jg\nf7o9aL0g/qJksJ4cYfTOtRO0YjI8ANh2wbQZ8PngeAjM4lWGn1ugZstkYowy\nDZNDrB/ZT2aei6z6od2h9BIwmTTo75wn+oJVwgr4xA81E2zbU4Lmhay0xCg5\ns21QZDcSCFr13nMdhV27bcT9iB1k1z4b/76RS6RMFg1T79jsVG0QVBG4fQVM\nCV7etQIcGZytFFdDlvqc00Z6sK0zGLfL16+xN1bK93Vnhc/meqVDvRovgngE\n9Q/x+MLdw9sSLleNHXCXi0/uG3+g2s6NIkIGiXflVaQqJnudSaw1XJONkMJP\n9cdAf/AykiuhkZpDuIeRNJ9+fxt130CXlE+klFitXm9Y5hlKpLuGziY7RarC\ntw/uHw9BAEwexX7WwDxcWRHWdZnbfNibJbJBYK8vOTiOd22szpgROP/g7SWv\nbqR0BB//6JXcwSlyIBFCR4wy4TFCYXpzie+PLwpwTIN1jitmYeYj69D2AVRd\n10JHxU/ujP9fFyIghFzc8/wzWPc9eka51BWr9XozNLXAjUzr3+0+I9nY4Sju\nxBAI\r\n=ubfN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3ZaxT+fgBajsRe4B3Z41ZVefMpIKBNQq3sjKSzZsFHAIgU9zNBPVOwM1SgtmHLPHSoHZD7kdvBE8JhQ+fUm15RnQ="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcs5b8ny.0_1595106650694_0.1280652703187246"},"_hasShrinkwrap":false},"2.3.7-canary.kcs8mlx5.0":{"name":"typedconverter","version":"2.3.7-canary.kcs8mlx5.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kcs8mlx5.0+d2ecdf6","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d2ecdf665d13b659b67fc5c360c7e68dc67ef5a7","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcs8mlx5.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-C/YpFJv5ARFZbk5jbXrPKlnEbOvDsuYbjDtAtvubwXKdC+vZQo3Iu64SLPV4DLaWSH/SyDpblx088PKe94FzAw==","shasum":"f770e731e6a5dadde28d100967cd0a7f5b0cf964","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcs8mlx5.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfE3scCRA9TVsSAnZWagAA/vYP/jmXs+ple8hzKywQJP9P\nIRYWJ2HWIug1eoZmWO/ow02T7jS1PJOgmgquSvpNwTGxFttNOWsFcmcv5ffr\nV2Ytdd8U69ZMkCEaSCXaJ2q4xQiFxFsVCWRKBHB572WaVnBEvNh1yJVtl3qG\nXv/QDIrJQ9ifhkqpI6dqG7lyfBI5aUqnTJXnndKTP6LzhjTOzF1AOChF/qX+\nQVSN5GTHBrotAr1Mvdut3crsvoqmZxZgV6WOqZnnlyOGRJcJDUGtw0xQl4iS\nMJb+w0plrTNXbmKkTmZ4cE0jcLv+I64pSFw5mHux0HPjllQkRU7M+JhZn/L0\nsSeRFB/v7eU0UWwUzJtZJCulLzg7WYv/UuyBU+v9QUxnflFGHt8yTkA3yi6e\nbH/JSW7iAJOSPFwITCDCigBkuIS3Q9R0Iy+OuGrMuUuH3BpboFyXP1AMXtyA\n7uZa0o8RGLlHc12WgDxtG8Xd7m3pRItu0ZHMPxm1qcQPlets3fnd5BLAIxKj\ngSzn7jFoHVpweg7MQkFJNQkcVYY07H8sBoS1MG1v7BiX03fs8EDtHLLoAOu5\n/m8AmA+mCtUnbXvOMqbRZAAqPGTbPbgti/bDqxWiaLWegRMG7M78ykewK1D6\nJBByN0ITPm4m6MUuolNAVaOC3EP/XH2I62RiIOux8ZiFTrf9rCfhf7oV+s7X\nDN3K\r\n=eG2P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDwlhVqYMZA6Gb3XIvN2bRTf9v20I4BTfvMNRwOAkk+wIhAM8+pFveQ+YSEjchR7RsoKJAJH0mv9Ir0jRMz0AsRGP9"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcs8mlx5.0_1595112220074_0.07761228409449972"},"_hasShrinkwrap":false},"2.3.7-canary.kctvam2m.0":{"name":"typedconverter","version":"2.3.7-canary.kctvam2m.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kctvam2m.0+d32dc04","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d32dc0490fd4ced6378d0981ee5395cbd741a174","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kctvam2m.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-H821wn6hdiYC4hFgyAD8HiAaWdGHshsAj2s+3MQwgNzy3YWDIjsPyyNsBBoVcGMgH4hRMZ2hcR0OCBof5GOytA==","shasum":"46d9eca1f3e326f4cd63fe8572939e7a0c2c5f26","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kctvam2m.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFPwGCRA9TVsSAnZWagAA/roP+gPldvGh4gaWcgDhkZRU\nYu0+LOD3DXNP3R89DZfo4poyayYlhEAGjU+adf9DX7f68ToVYXxBV9h6/Mq7\n6GcWYF0CnZoJrPo/+OX3PbnGeav54Q8Fstbtb2NJTXwaZRL/Ufj/fUsl0w6R\nwh7qwfgQ6UxWx2pDX9jPgRd3hGAPoKTy3HQsVdNR0K7CDl08cgGPe6y0r6b4\npgqpfYXPcwjP5ABc5CMKOwHBAnlxFKKaU4m5a9rW1uUwLE9AalWa2dnDFW//\nTOq1fWEuikYTIpdyNLvGzoqDiIptE0/ga6VWlJuU2Yd8tYdWFzZXKzrUGW4V\nl8Z2j0RP8c5W8fsUWle3iYT/DASBChCnFHSyQgUYPrSs/NG6/Pe8xVKSjuY0\n/AwuI4UDtfDcL1X0TqpFHpoJu6G5zjxmerYahnh2iemUCZzKY9uXih/DDuh2\nT5xLxvmeg5g683mi4ongcr0VDKqOw7u3rDhwS01dwah19PiMjt/enPdK6iB6\ng/ZIUKmSNAZmgrJfxccNCCd3//lK946TwT1rbxcRvUgvqf5DOtsYL9GjBxfw\nZljVUe3sCS7skFHQ7iSyKADM0pAWS5WrN93LHJyUEZmqaZas2bhAp9v/5Zkt\n/5R+oQi0eS8Y5+K4ZD5nuZxOHhaJXu/2M1dv5qrtohkX6/iIjmQxBZUrffe/\nrq99\r\n=TvsZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzskGAj0Q7PTIY7+UEqsbsfpzMLlerrqJZDv170SdVXAiADJ+sQd8Nqyflrvc1hY0UYiGOmF4rqui+zpORXg6cWiA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kctvam2m.0_1595210757961_0.9542845126782467"},"_hasShrinkwrap":false},"2.3.7-canary.kcvksj6x.0":{"name":"typedconverter","version":"2.3.7-canary.kcvksj6x.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kcvksj6x.0+e5684ab","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"e5684abbe1be7ebcfd212bdbb483341ed3036ca5","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcvksj6x.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-2ZF9IndXSpJoOTcV1qhyhVf5GhikIFxw23LuAQ7SUgX93S5NgDrwufhtQ4RaPWQ25iGPl2VY2jFCUAXiT2rKmw==","shasum":"f470ede7abaf1b62eab87d5bfcd3b8e388279d74","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcvksj6x.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfFo+DCRA9TVsSAnZWagAAi1gP/AnJkSyRdprW2+mvfRhz\nfysaEvEUifoooa56L4IFrybI77l+u9kn0ZeG1CDvuPT4txiCF3y9jrdIofhZ\njvWcOlrucka7h4+UpJCvHAZdGtrApgSHZ6W05xcHR3kPcMFyh7f6t/nAtpKG\noy6QA9rYgQjq/IHyBG0oJZuqja7cjrfCXR6ZlTQJY7tPISUZfWrOF/DDYnM7\nnX1W87pmsV3fIyfeLRN1NfB/9UYX+GNEN1jBwYWT3O1lh7LOlESel1lYcpML\n9a4aGiVQVEV0arAUCCqIz+rYqhPmZ0626/hWlyzhP9llbhBmkhJYuC35h53T\n/TYP0ng4sp3rEPTmNlOSKrZ8bVZ7npJ8sye9mYo6mWy8EJwSQnFSM3XdSEVs\nMuoG2S6RvCqRmB4BNRZGsac9T9Is/K4TZH8POB4zmrdVznl8UQo4i6419Zyr\nreas6QrW5ihZpq7jO86erf8sGQWDht27t78WdDHIHDX5ByGUvrV09iVjfXDm\nS8K4P75HkwaHeBRrDp8stwpguo1SI5uaEy/o/vmvA5Y3wx+2UcNDs98IIUqw\nLS05XaZxJGQoXOBNH/5ykCezTlYHFP5AvXwWFem+mGRId4yRYsDTkUfkF5cd\nJ4sFBOsjrTg+GNalNENVjEX7i7pLqEi0DeMjkLUcErhhqHxJayKWqE21tsfY\n/cf/\r\n=wd8k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC72prXwnu2DMU67bOV6QbEnpYyqEtzTMAGjbI9xkkkIgIgc6CXFMOVvNhs16IW0H4wNw8nnlJWsBkt+w4l7kvLenU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcvksj6x.0_1595314050969_0.5502486965455473"},"_hasShrinkwrap":false},"2.3.7-canary.kcwgd771.0":{"name":"typedconverter","version":"2.3.7-canary.kcwgd771.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kcwgd771.0+a07cf1f","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"a07cf1f3a27f19abe304ff482210ae9b31d4a222","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kcwgd771.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-vlTh1ggc5ajn9IiOnTmPs+MNTgWWfp4hXX9JhZu+ERv6y5SirWvy78XuO4f+YcJfAYTODyxzuqAyZQr0HjVh7A==","shasum":"5b4227c5e1a99782184b3dec09afd5d3450aba4b","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kcwgd771.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfF16rCRA9TVsSAnZWagAAV7sQAJKBmU9lAz/MxdkdnO5Z\n/Nlh8hT2m5jj+khnciU2u4grpaCxltdYbFIAAEjCQBtdNdPWT3ELfd8x1Hzh\nX+zZSOqA/Bl/6bC7ONjT1cMzKteBP/F5fU42omN5AgmblpAAUbgOIpJ2Av48\nv+H3PITRMyXseJwoE0fLxIDwR86lcnoCBsIkxCsdEZfdBnxcT57VdrLkeMUo\nH74QUnz42ukFxEsdu+wdax9bqCFj1F4/F4Zi4J0pGgSwjIpMhfzpgSMgzfJA\n1y8eHBEt3mmGbKmCtmi13+Cryer8wA2G4BRVUuwGT737kkoKF3KYbUUxbW/M\n1GBEKivrH2OfGAxoNeoU+HWno26yQwurw7je5UaV+upsHtrakY7oQOnaIVhO\nUapgAkeW1gbNSjHWFkRbQlWjsllTxDw4Y8MJ/zPdKHrP2PLXhFMOg1d/UPhy\ncFWs6+BJBymJFt193eVboyS2x0pV/aPemEe/bv6YGS2Iped6uijnQpyzJs/3\ntT1J1l0aQWjCI6pRXnS2yhald8xofSC8357PRGysyqNPeeejZFJZDGbMeoC8\niTZMtYxoRCTSOKUjN7B03lBRjQiTli/VIgtzdosVyU350lFaqp5CTCAADHoK\n+cjEIBeCCwbnCqRkFZmqKiT7AU46Qga9Ik9IO1jNGrXQDZxm2iVnb/64RC0I\naqNx\r\n=rbZB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiDRSwjeB6SguL1LSGkvoA4bsYRifcYbblaO+kp4Ga6AiApyAUfW48t0GhzgWnzkWC45ToF//8ZBM0KeiS1TWuUXQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kcwgd771.0_1595367083225_0.6095793369343672"},"_hasShrinkwrap":false},"2.3.7-canary.kd1392pj.0":{"name":"typedconverter","version":"2.3.7-canary.kd1392pj.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd1392pj.0+3b04621","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3b0462189ced23324018c1d01723940299a6c77c","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd1392pj.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-mwQPbPRqF/dlqaa1DlH9ZPF5tsBjiZRf5gxbmsbXPHHUAX7QG6sCHD+8oteE44J4/frS2qBGL1FXgT0AG6YPXA==","shasum":"5c967fa4ec170dd7701761b4153dd78cc26d6f4d","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd1392pj.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG6WaCRA9TVsSAnZWagAAEu0P+wZifsycNQ1XBgfd7/0z\nQcpHeMxUWqCwPgSrk28WlA25ov1LIG2xRjybSxNxmLnGSYaseyLUtACLYgh+\nvDCtNJUpyGIrLUkh2TJMN8jwI/Xx0hpXMTK/CTsRBeECDDlJhCjWA3w4KKZ8\nKNlpqqDQy69TmwRawQ1/mpeAp22A2q/Y0OMLftIi8zEGosWmFx0xwyMjKw5m\nMSUjHTThbhgpBwAs3mrcSU2vwG6bsWvVG1yeo4IQf8nXcq/6ZkSm7MJsVK2L\nzy9GHWycn1csz19bKD2Ub0FuRiCwJHwyexdZj+8oC6e8UIKC1lpXq3vNmSah\nU9KL7XyjC06dn3fvImtQUUIrMwUlZYDYqgQ48IYc8tTa+SzBo5orJO2eZvUg\nlAKohsVJpyB0adFPUzYtMbVcmcgGKFagdL0VdFX9dQNgZ0cK1LQErlitVIhO\n3tcxBaVObZr5uzRBzJlW/OFrptZbwvRUpve98zpbsRrLqqfYJD0G6iBqJ9BC\nupDuDYTzW3LNNS73x+bEwFlj2tckh5PKHzTZ3f7QFsTQ5V7NKtmGYcaoMpLP\nbIeddqInTf56xKErUfW6vG84nL9Mh54VOzOtXmBI5MBgMSGah+Qn4CzHM6UP\nQR5o63VXB1xOgUU5zdoXdCIZpCJjyP+93FnoAS/RTwwKbV6NErFbdz2jRcQg\nsT9Q\r\n=fLW3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8w40tLKhHwKdhLa+ljkpXT9NC3FGNyWVrVa5HKahafAiBn4kKVAl+zJMUOoy8OWlfwvkU12nyiF9P34fvF7WAC5g=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd1392pj.0_1595647386357_0.5827425846393137"},"_hasShrinkwrap":false},"2.3.7-canary.kd13oe59.0":{"name":"typedconverter","version":"2.3.7-canary.kd13oe59.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd13oe59.0+25feb79","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"25feb797777dbf094590690812eb01976354fefa","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd13oe59.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-4NWG8zprT/qeuHyWn3AQ9kTZGe4iD4MLKTjyetD7ck2YoLsQjctkU4db6FfXVv4a3eIqEORxBk4c39c4CTJQpQ==","shasum":"244110a83cf52dfe018fa9b66eb76d69013529f2","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd13oe59.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG6hlCRA9TVsSAnZWagAAaCYP/3CX5raVy7gwREZ96vFX\nCfJTd39V5ajAKXxU47yYmd+4QwduO+IF8GQo4G7AJyL0UE2vVLtzPIbbtyWl\n9Yo1+iatqJbL8y1o7I8igK1NOSVjxg11V1pmbrPhfTaUbcs0OaF14FZX/gQw\nkmwNEZQ801S1rZPqImGRefntC98T7S710/3Esy6qCNJIhSLuHmKkP2bHmcNU\nEbBsa+bFGr1Eaf9NRSpSp8Zse4b/7SFMLYffoOcr/ArWcEFXY3a1Qe/BOzzn\ngt1KJSOp51lEBnSbBb8dm0ug6R3m0oCVG53DH/MEiaVoeIDtMOXPYOjRHFj8\n/NOjABXkyyFSqAJG1jj7rAqD41jJoajiL79YHqZ1cIl0OzQcReswSG5M4qKb\nqO/xC7dWCrMoA6RaBYoZO4NMZL8/+nBwpjwe8sgfgyp+vPS0kNszXOE+6VmX\nca6cNJC/2V+3IO/Tg466boyZZvPGWA2ibKVz17F5eEVX05KhIuBeaeeAAPTF\n6y4DdPHsmXNM4WmiR9tjUF3eE/TfcmspZpk0iR0615jVvw3b2MYnu1FDKsCM\nUaeH7t9CMJuwHwL3MIPlYJgjnHRUBgLwOKUkHPAbaPuvqhEICmfHcmUd4Bdd\n4+XGsEglbTtKh1SmTkspi255xFxPa5Woyfu5/xJ/zS2fAfG8MuW4cMFYkK8p\n4r6D\r\n=+oSn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpc7IANTzJAg5qQFX2q9dtIzYb1PtRY81SJuLeJ5UZbAIgSnuZUoJdHrbImATMLcsxjorerxKu8pZ1/GRceQyfHRk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd13oe59.0_1595648100742_0.7505390496344766"},"_hasShrinkwrap":false},"2.3.7-canary.kd18a18n.0":{"name":"typedconverter","version":"2.3.7-canary.kd18a18n.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd18a18n.0+10ae92f","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"10ae92fec6d9aca11ad78a96578b7473c8a50af7","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd18a18n.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-nTiiZVk+kRPZ7iGzWwfeQQ48IoyB+6Dtv9dnj5MiRpMg0X4bGNh64YRU3ucHwgT2HapIxMj0KOoRIiQlvF2apw==","shasum":"5ba9335374b0e585e07ecc113f8e82e17e25a2b8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd18a18n.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG8aVCRA9TVsSAnZWagAAAkIP/240mFS95w+OPDKiijIl\nT4y7lR2nJ8gg29jAJEOYzRFEq4VzDE+AqRAs/IMUKd+kVpaxieMpHSsUvIi3\nIrMtbaB4W5KFgq5gmRB+3pFZXAPNK/y6xtbxuKI9kB6onPmfc3Ndx0ht6xIy\nPkwDkU1bBbptYxagtiYJcdE2CLUlFV4uXBmeksKityuKAu12vXm+Pb8F3ynn\nd9HHIz63E08RQz5lsMsXvUibm89bes1Xawgcg56BJDiGYYOAsIiwuV17v/E2\nuwPGOeyJcP/cOCIbnOGzJHJcxwU1bLCJzaZfhhsOiDsFSr7Deobf+DMsIzfx\n4rpyofeWuaHHGznOCpNvr/WMRIv3Utm2l18fxmTl0Lw7+AN8R/clJw2Ymnb8\nyzfbLuhFTqkAMcvYakGByKvEHhTpIIVs4VQ81wDYL2TbD/YDoCRgoieiiwqr\nT2sZCHXVHMmWrBsDTsX6VeQ4R1qHWGUhyqvExDPjlAoWUysxSi2F4lxvKCT8\n7hvioedc58E1uWXABHOWajAxXZl/gb/MG6YVF/Uu0jPXHYhWdnCqJUiDK3r9\nHZwmF+/8SPj+jSSf/HX/OC7AWJ7iJMX87p5EZzHX0gd4eGHucZtNak/LrgQA\nIiElTo8sL/ydQaUjG0J5Xg/sjglsHaka7GjDjQWjnlIdgXDp4fGkBkWa8aEX\nwyA5\r\n=jcGn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+IKdqvp0/8LGjXkGGy/CgiVWrBI716W+eNw92+rY36gIgHJWTpQEJoRFjM03TWL52hwjBj+S9FH5eQer5XsLyV5U="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd18a18n.0_1595655829108_0.42869159458711104"},"_hasShrinkwrap":false},"2.3.7-canary.kd1i13g6.0":{"name":"typedconverter","version":"2.3.7-canary.kd1i13g6.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd1i13g6.0+9140106","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9140106b1b8e5b6a1c586c6fe7280cfabbcf1d7e","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd1i13g6.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-LHIB5Vw1O2COks4kW+7iMPd+1bP1yLoeyXdCIa0VKnAkBprCy1HudDbUrJ6bwrM/1NznXeUR9dc5L3d0wpXQkA==","shasum":"0d7dc7ada7fbcef5187ce6d106fe1b86531b9556","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd1i13g6.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHAaQCRA9TVsSAnZWagAA/RUP/R8ER7ETkwX2LqTkloKG\nFLdJrRBVw/q5sijz8pyiIP96ZgooVseRHQke22C3Ss9VlXoLUV2aSo5le3II\nwDAkHJrQnM1ylQqEK7o8SFFCrDWpYE4w/Wbz3nZlADd7Enx32lXYNwpqMLyl\n/5wygLUNxBZJFVWjshyMAps83kLfK0++WMRhtbYOaDnJjdaFbvztF1/quNXg\nbPAKspc+tYSd9M3WgpOm92pS0L4Qbww15olaPyTpcY33ic/U1anrGMY3IYws\nxnRD6wfp4k9aT+XKK2J43rggymvMhXdthTHBoCOdXgXpwAbJGhFL/OT/1PMg\nox4CmNE0CSRWfVBhFAQdr5oL66t+UMH/Fg1CDt/X+PN/CzhQOtF9kC662RQe\n8+KnHKb+hCDd0OlN8d4D6kDigC51WxKS3eidT/uqfzfq2TSmNs2GSk1C1maE\nNNVBKiyTv4dxtbmxr6GiTiTQAJnXABHciaZIydwmkIX4y09TSCxxKE5BErOk\nYI7EXATZ+vw7ruH4pVymv7XFq0zWA4N6PFXuvfM/eB2t7v4poh0t4NUMtU0S\nHnaV3l2FV4D2k35t3k2p5xuYECqYimHPSZRXPwtRc6j/joBmijgFrMc5zg8A\n1w5PhPEaBQHbAJXGA1MD2yu+MbZRHOYM4Tug7VrKoPTZR38cCYN+dOuanlGY\nXf41\r\n=gk8D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYo/8b6zzW+TN93O1r03wxDXvoGQYt3saWGcrL/YaBHQIgUUlWZ2z81GyHmAPv+72S3Z6tCCjtOb9XLcuQAoj3HBU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd1i13g6.0_1595672208574_0.9417109077436225"},"_hasShrinkwrap":false},"2.3.7-canary.kd2p0nhi.0":{"name":"typedconverter","version":"2.3.7-canary.kd2p0nhi.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd2p0nhi.0+d2b386d","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d2b386d786d56818c61c31939a53f24de7d33906","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd2p0nhi.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-daDSpAKqnS895bShsBz41hPvezP52tg4TmUNuGjRDzP7uuXtH+a/SuFTmOln/bEeUTNY7qEVpfe1LsMGsl3BMQ==","shasum":"4b5788ca3619daf56e1f89a31314531047f738f8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd2p0nhi.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHSCbCRA9TVsSAnZWagAAF0QP/1/MU6AH+12KZi0aZ8Xu\nIYwe4w9NoMsCr/KaN4LyNE5Y/zLs4okI9zACkhV1mqc/rndMdZcUhzbPV9i5\neCwQ1Z6MMm03p78K54ekmNW8TSBK7l2aGo5mGj4WcFMBp3kAKR1YILJ8SQLp\np15Tn+ivq66WUjiVmnj0xHTK10+yczKQlWO2Ca1ujyJWGZW5CqpUBD+V4fQm\nY82du+43BSb4OqewZirqbL4C91zn9/g81OW64xKqJXKH1jy24nDmx871ci7R\nqutPDXKEoNJX7rP4iv2MbNzeweYjy92N7+tLnNOCPKKm12WN6IqWl6iTliuH\ntMyFXFZhYY+jEzToGdkgKyvfrh+vlxMPugZXmbh7rQU8bbmDm7blLM+5Ecny\n8KL83aN8+w9z4YkhowgpVLF4XXqDZrC6q0rBpj2KVWNxoGhxw7s3D5CVZhxL\nhnmDfeqCjEeDOITF9hu8crCnNjU5PpH+++Bn3iXCwfpZh0FjBYZMoyzA41UT\nERyCpF6aNh+bDG3YYGCs8sOZ6NhwY8cK/g3INgAB++W1/pZaQ0loDpo+fou8\nDXpBk7ZNfxpjhbwVBGz1/RNp+3IANweD7RjaYTTUleUr8u55SLNjNNBWrgYa\nMaA16TOfoCRHeZrJRIanPevy8Q/ooaYJaXSIB1yIPg2yV0TnTlRQkuj8yyQ8\ngHNE\r\n=lL0/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQcvPg9OM9GF1ISXBGCyLBJPUV+fEgzVcMlxdE833p7gIgYWrEtulGhlXR0TZ8GKrPIjBzS1ypvYhFgxalYblpU4Q="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd2p0nhi.0_1595744410953_0.1760749424119301"},"_hasShrinkwrap":false},"2.3.7-canary.kd3mpv1u.0":{"name":"typedconverter","version":"2.3.7-canary.kd3mpv1u.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd3mpv1u.0+24bb431","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"24bb431acdcec517c3dafb55812e9b6014134ed8","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd3mpv1u.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-2kp1UIkpiDwmezvTME5ZKbB+8KhRnrVdnzN6gWkJz2ng0xNlQeHFVw4MfkW3r4QwelA3hbjLSwnoNTxveynyKQ==","shasum":"7c36ce49b95792b4fa733b7b07ad9f99093667bc","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd3mpv1u.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHf22CRA9TVsSAnZWagAATasP/RaIF4s4Rdqde3g4zByl\n80u4nDPEBDKcAHH1pP2+LmYc8D0HbOC/c8a15BA63ZYlKtcdTLgh1LocAo02\ne4CMWh1DxGT5eHH0CO9UcO5leKjBr2ewPSX5p8p57+6O0m10qmNcdtM/TF3G\n0ewKISBVgM+0ua+CDVvxbnvwlgSLcPJOZu7RPyvXFFuGG82sUGxmzzPdbrds\nWTQ1umfiV9g6MxACrT5vg8jBauZiQ1aczVt29pH78sC3uR3hQHI/X1iI4xpQ\nWGTHHnELZtrRsecWj5bTWsSiwa6bgzxDkSRmLUFvlhNHtV7rnvMUJ9mRe2Q3\nqvyuvtv58+VsrNtCnIgp82vMPSGUgufW3klweyYavw0Z3FbHibih+XEmdHir\n5OmKHWwyt34cwQgj92M6BMgH8YwVkiahGNJdLDxHaZktXxIyyzr78z961M8R\nbdgBH+jztDg2lycy8g0Sk5F12P3MVQyfZgXSlUDhUItTZODeyz2YxOFOaHT4\n1jwb6t0wnT5jifMC2ni0IJj+ZafXCS4ovQkRLY4fJErsfO20ey0kDOcWeavc\nJxNPyKsuCPfIbw7P6yT/MiGjmzVl1fBAt0IhDErdbNOU4E3A//buxdJFFezf\nx/18P5xA4JQL29ZTLU2LQae787S7P0idg7jP3KVq9NIwHaiCu3WFBc0AM/Dl\neDfY\r\n=R6zP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbhCU+haGQQm8vqxPgUhG5XJgKff1pILlsNkCLTLFBCAiBR0XN16nvaKXXa/KF7GLd8ZjzcTKtuAyTmuDvA8UggYQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd3mpv1u.0_1595801014412_0.18607608033769418"},"_hasShrinkwrap":false},"2.3.7-canary.kd3rqvd4.0":{"name":"typedconverter","version":"2.3.7-canary.kd3rqvd4.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd3rqvd4.0+ae9b8e1","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"ae9b8e103ae6be253ab3cebf401a0e34689da1c8","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd3rqvd4.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-lkLOM2zeBlnLdpPVaQS4NNemrbYeZMAd56qpHrA/s22sjNSLyrVK6qRZ3kJJVa9Z9CvUg+MjpcGlqzvhpySB9A==","shasum":"3562817fc570568257a8923f4c4e0d4ebd06e365","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd3rqvd4.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHh60CRA9TVsSAnZWagAAciYP/RHumg6GCHSVXvJ1aeA5\n+e0WdtrrGQq8MfHFg1kdfKauqid9F2QDwYOZCeLnTGGoVSufQxx4YfpfAcJr\n7epiPIn7mQ1Bs8y434s5ZLLIB7HZW1PgZ29/mESbhauL36Hx85xljqBAH1eW\nxASDz5vHpXj5F+Kwi3eRHXS01HBe3gL3K/Cft+bLbmTlpX6vsUkUviY48P9c\nlv0k5uJNbhmmhoSMphr1NI6ER8VQkDzPeEh9uHG6hXFCr3Q3Qc9icVOdHYea\nunyfYlvfzkHviPT1orZTV1vGBCare80iZIHU0i/u1Y6rS6sMrgti+U3GeOxB\n9UqIl6pK19FhoiwLsU4xoA5c2mDLBz0HPjl6/cI5cj4uNRha/zFp0gLWlYLn\nBBdbMo7Xpdnvh7bs5A+CWZ90SJd9JMEEzAgE6ZagUJalktBrkHEURJ4/PIQy\n7t8DfYulq923C0a3OBuiBrtOXg/U3HzLwbc/5x9+2PvsQ29QwZA2epHxo75j\ntSzXWCir6L/gXgHukd4VNSL2HQ1rOHYir0TbzFOdjf4ZvyKo1sdHNoGUet9P\nEqgnnGM+g196tMSSN0BXqmEjCi98Grx0ElCimC1RoAHE9N4KLGzVXRovneZ5\n+SlFzeG8Fd++bOSjnWP1DVrznnG05uJr2hq8fVePP8t4vRmOPVr3xTVOPl/r\nom8s\r\n=RsBk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID9FElSS6Iw1RcSzLoGAmPZku4uLtMB1OMwWPATDebm0AiBavS5Wc2bzODIRVvNTzZ7MaZn6AWsg3g/FjtGj6H/gzw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd3rqvd4.0_1595809459804_0.29232199376585477"},"_hasShrinkwrap":false},"2.3.7-canary.kd6wewq6.0":{"name":"typedconverter","version":"2.3.7-canary.kd6wewq6.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kd6wewq6.0+3251487","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3251487851196165e3ab62144161d3329811b4de","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kd6wewq6.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.1/node@v12.18.2+x64 (linux)","dist":{"integrity":"sha512-qWS+1nw/YRBbyjIMLmjO7NDmfWA2C7L+t4+3Tw9JTkOz4ENxiew67GZzQbABtw6CYESWUCMrSbyn54DPIEWVmQ==","shasum":"ba088649d516aa225db823b504a9e99859dc8777","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kd6wewq6.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIQHqCRA9TVsSAnZWagAAtzAP/jyQHUxTdMTvbKhDyzVM\nwp7Mx35pJlwDLJMsgU4sGXBlAfjOtk7e9Tb9uAdJjkHeQyuVNL5v+MWIW+l4\nWuEWVk2AHkgxSXci6AsM2Tcg/XUlkhA5zpgW62SuY11xUndvmOTmXyQPVELK\n4t8UCvQGGNZ0F0lADguJ0HsuMlkP4U5LotuoaUuSbdW51DTzN5k9cZFwaSDf\nFbAs+MIpJ6qoj0xMPsGsJZSZd2n0e+YuIErq0VYDcEMaruDOrl+Pi27jA8da\nafJzch2bE2fFcp1eg6ja84jMIzWOmnbLbs8Lk5piNdrOez8IMISMA5Qf69dt\njy5A3EFI8vnmWT6X0KIAmEwP0g4TdH0h9TcwggEj2Ar7q7Yd/+UZIoblXtZK\nZMfPaQfMh0edwHTaQgyfFa0O48JGYJ1n1eROqm+/+50yhLZsh0dwyepocjs1\nYZYsFBNY+EQ3i5dDN8dOOaPhtciSWVOKv57Ojrkjiwh4ALmk+Xq+DvGU4noY\n7xjBgtBK30sqvUJBp/tid3q78e0joL5kEPFxbWUJClL84i3AArA6D54FqlHw\n0rKCsje5uKiQiW6Ecf8R3HYKZ9Rh/ISlLpSTRdJ6yEjBCDcT+swan7k+20sN\nM4mh7Z3jLfzR5bkfFYJsDjVp+/I71eGkl9c4zNtu2ggRsdq7clZj0MpU9Oj8\nNEtm\r\n=m4EY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFxJsX8cbmBxVjCgLy55ISkqbPg0FmmTb45eIjZl3/x6AiB1H3DpSWAIhFvpT/GA4H8Hoo8jRrrDpaI8jbDMeiyQ7A=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kd6wewq6.0_1595998698412_0.3850846453956429"},"_hasShrinkwrap":false},"2.3.7-canary.kdf0lwtn.0":{"name":"typedconverter","version":"2.3.7-canary.kdf0lwtn.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdf0lwtn.0+b159de7","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"b159de7becd3e5b54dd97b796be4cd7715f9d3e7","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdf0lwtn.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-xi9TF8PVHP1MdSZCu2in+M9awLVJg4f6gCc/k+BpBj1Oe2uTPQ//T4hLueyKywR8cM77q0O9FqTKZF35Gq7ffQ==","shasum":"18bf0ad485c5fe652a3bdf06edcc20f8d0b51ac9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdf0lwtn.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKH8BCRA9TVsSAnZWagAAatoQAIY5xdQobFc773IUnqFN\n4eS0203LmaYq33puaCM297oUe/9uAYQrn3TusIIai5WJNbtz5cSoT1pHfSrX\nvBF7/1mao0EFUf/gvYiLjnzI9ePIQQgPv6DWoUAms+CIobmyVtUUqfEv16Za\nZzB/gfDsik3smj1tUfWUF+6Pas9VwgGeU9REI2r2cREuMlsoWg1ydy7KwBW6\ny5ICQRvExhET1ihnRe84looPsy4wNKSlj9mqKo4F/qedoZ7XfN0SwuIWy21H\n4YL16JzGKNVKGQypWvcAku7+cz3NuPiVM82gUSI4UfbmFLmag7y4ub/pMnvS\nZ7USrEzmbmNaZtIdo5FsfKVjhi885rcIm/c1wfVaWycDbSmbfatI6mNdNbRj\noYwRuP0UuAG/Q+LFaJP/FNKWJXa01lFcbl/fl5zSyMXqOdPDVDZ6wl9HPjYT\nPkmo/pVdQ/kMosHHGGlU1W4E+ejDsSjtaq5xzSrqSXgJy1PuAwVkgTxfBaik\nqSTMNzL17V8Ea6akmVmlvJ9zLj6caTYjPbyOW1rFWDdloGwizfLKxrTB2aR/\nhB1lfHttiOBSt6LsAJAl16heUC4v87QTot13lAsv86U+zQM2FCFRvpyQFEtU\nwbPgfOHQxIPWqerPg+43XjT1RZAENqveSVvFoBORYcb7GXfjFaQcAXdN0WDF\nfkIG\r\n=nzjo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnaNhKRZqiHn0kkKZ4jZvlv08Jhwv6VU9m9SIngDiozwIhAP1JeqAC2tJXCk/ZYiDTeyhw/ejq8Nlzj5atI/kEZ1Iq"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdf0lwtn.0_1596489472812_0.5737202062655149"},"_hasShrinkwrap":false},"2.3.7-canary.kdgfdc3a.0":{"name":"typedconverter","version":"2.3.7-canary.kdgfdc3a.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdgfdc3a.0+6bc1254","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"6bc1254bce8dfd78d1803f98e24ae995540c4907","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdgfdc3a.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-7W6gX0NDy/k80ZY2nNx/XxY3HTxpy3GlxuGu0wLbrhYyBZhzAiZ1pxQZlgYosK1wEPGDxTBF0r91OuWzdeJYhA==","shasum":"68653af22ce2e7ff61bd7ccd80afecc40c021119","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdgfdc3a.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKcwRCRA9TVsSAnZWagAAPucP/3Bgf+AqKcvzXUzJtKi9\nGFe6uxXaNUwKKcckBDGLAmChal67kFiKX5PkUCZf2+8+YMzfxp9n1xHpjaqk\nWXqdriPz9x0pPbNoZSsaLBfG2rzKXIXvHk1tH6U+5OjORKnmlDnhzLQ6DCKA\nhvfB7B957e8rnBFvTzzKO0vJQH3zA525n6op1/oE2UTzF1tfrzGqZeMc4Bta\nlS7UAG0slxBp4SSap9hD7M+cSQojAIK6w9DZvyq6rBlzNmBV4LFeF8aLCtUC\n5s7Nnt1Imhua+ME76xLMC/P5dJdM99PRhB8mtnaE5S4HieKYsOMykg2LdARE\nVC8VLXqzlfjVlM0CMeiQeMzs7lrAyHrUj1WeGO4IO0xp4wvjhCl1IYUYu3Eg\nnB2umj6au5mvxODc7ev/uRgG5EjLiriiaKPdcOiwlGZGEyQ49qKpdbcA7lEF\ntq/JTB4JQHWgwqU4iqe0rcqP57Nh9H+I3vanOFZ0ZWVgOqejRJ2laq003GTa\nRzZMTGQQOfzLSEG1UBpqiYAeLqLNUQe70okFWjDGaOFOB884Qjvsa1hMDM5q\nhuYDE9SStX67U+9YckTwNtKsJxCB8+ukxZp4jahsQpv96zclekcqP6yjG9Mu\np5lWr0xevI/e4mV/v2r9oychSqBCmLnZUUfsx4fn2gQAAPOxKmZfPK0hfMiK\nvOv2\r\n=M7Zl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3N5CNFd3QiV6DzLw/Xom6cxCrihWK9H2EDXntar545wIhAL85q8GBRHvHcMa4Nzck5eus8bInCX1AsmzL+9gyhdBO"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdgfdc3a.0_1596574736760_0.29916685834200285"},"_hasShrinkwrap":false},"2.3.7-canary.kdi5mwkd.0":{"name":"typedconverter","version":"2.3.7-canary.kdi5mwkd.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdi5mwkd.0+059fb90","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.5","@types/lodash":"^4.14.157","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.1.0","lodash":"^4.17.19","ts-jest":"^26.1.3","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"059fb90cf50f0674e8bba366fe055f0e8294e477","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdi5mwkd.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-GxF2i9nGIRYh/3XvQbkzgWSspGwxv3Zhh4M1IH22qHvfKo/d6/KLdOxojLf3EeljNYJdS45PoRUiqcVdf1SJzg==","shasum":"62716463afe9c28899218684c0f140c140a92681","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdi5mwkd.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK2SUCRA9TVsSAnZWagAAx3MP/2kV/SgKOn2RaydoeWM8\nLbCfu2D/Jh7iHlD8oq/K8TmzMiy1k+gMfzhtBTG0vhHbUjK9B8/DK+fls5TY\ns1yr6vNuS3J+K9C8FmCaCM0xW4Dj3L4+wzz+XmafVWunPc+1Bk3NgA+yZQbD\n8SlZ8PcDU31uGYOYxTJ0vijBSxZsAzTEyF4HpAwOkHXGqCreZGtMsIsZJDMX\nROknWoqkreurS3g+Xif9dWVB0B8IFQEV7yUuax2VJGFq389qZOeutX0UbOar\nuPlBAB13hyOqwHsh2bYJApYlszXnywgH2O5J1wzzDEnHkma1RVGJNcEOvpFW\nQwTcFxTtJ/Qf4l6nygAP/+BRPQDwKaGS4Wo4VRwoNrtvzkDcpzVDLcyexYSm\n4GELFe2D2li8xZDKUR1dwCSWR/4G7Odzezw7wirU3OIAVCoGlP0saa0YWAS6\nZZxehTPZTTlvis1a1PjpAIpM8m5YcMqPzZhWzYzVuvvypPNnBku2HeIyGqup\n+32vqoorTct0bNmkHB2QUTwoTDlrLVAhtdCJq3FxwuQ1BOkCpdgnWEBY7igw\nzzRUEuca4W26RRwmO4IWGDDUF//ZjtUAOSsP/dFprolzAitzf31rwX+vi0qZ\nP+8TDa2XxdHyzVo2/p3KuKxw+KZJjoBU1CE13hpFv5C3IR1FbpOcu3dKeEmk\nbAkn\r\n=IlTL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwbBlXnx/TrP/xIV1XN2lsbAKSxNgcEAEcQ0+b9o65pQIhAPNypYMSqLVLR436ZdYK5z69FV/sw1/4Y0ltUJWBaSqT"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdi5mwkd.0_1596679315780_0.03108572494731887"},"_hasShrinkwrap":false},"2.3.7-canary.kdi9bq15.0":{"name":"typedconverter","version":"2.3.7-canary.kdi9bq15.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdi9bq15.0+c62c8dc","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"c62c8dc2dda71d63bdb6e80a3d51157b8cbd45a4","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdi9bq15.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-UhlPCdESSHwlz7bUzS+5i9CPCHbuHRc3+eUtuCX1+1em3nYU11FRaMKaurIJwlZ1esQ9t7AADJCJgc6+Wa60jg==","shasum":"70bf46868b2f022c2e208206544b8f94464d9114","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdi9bq15.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK3zKCRA9TVsSAnZWagAA8roQAJCalGKzlfwt7MMmPjuo\nQoopNkXHu9akbMVvFfexJDNKVOAcE1S1r4cKIFdfMvS8Nk4FRH5ibHCYA6pK\na16ITD6fk0OK+eHo6ebanmrcYk3OGAXa+5rwL/QmJdCDByog2VQM66qzbT7j\nSIyYY7qceIhsBnSD8WWoMD1+OQLErl777QLSoCJPKqMxVhFRW6Y77us7u+Ch\nAnl4i5quSmVUrf1oq3Nd/dsFow/cAbwRcg486W81eJk+4agfuNxuccu5DTNN\nNJkx8CslbLtaaXNo0lPkECDV8PNkLqSJEm8jhM6/q1pSegKHNpZf6n3VSEa6\nk4sQmfuvo6kdK/BuwrOCnFy80dk1NGyolinjPGXTWUoXQoZjW2gcAONR3Ca+\nKhtc3wfGNT0q4pjtXNs1vHymTZPh8zj5mhb4hDQyx/Jf8+NjmKbFAv5Xero7\nkLcSnKFXAIvdl+5XsucbwN5fc6pmsqGgnHJHuQTSNGj23rro93GzUFA5kK0y\nU2ZF3T/Zu5YluDO+ugAmTrTxyrY1Hu6iSonvVjOLo2UF2mg8p96+i896NCkU\naEuByJO7SxjTrOYbx+2Uq3zIS8I+jsJs1WYlnbtTiEZRtDzwG0ayh0pXiktY\nybEYIwymquZ7shmQf6pNH5U7VVpByyC/K2fJoY4Pzc8LqVX3Gtx5PY+3GcNO\nqcN+\r\n=5G26\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRk5t7TaIbyRmEsgYkyYtbymm1pm0sN+BhE1LAh7A9aQIgOSr0PUDi91t4rx1O4I2x3zIloL0PvI/f+JDl+MGKc0g="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdi9bq15.0_1596685514405_0.06702327734183444"},"_hasShrinkwrap":false},"2.3.7-canary.kdid6yqc.0":{"name":"typedconverter","version":"2.3.7-canary.kdid6yqc.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdid6yqc.0+1a29374","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"1a2937448a8288fa11bafe68f3368841cf95b16f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdid6yqc.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-xT2BRKD8Gy3oh5FVurPt/8Rj1+fftl6fZPSvh6byJS7F4m+tXNyDLAfG7HDBOOLWvK30MiR/u/qSGKOuzWKO9w==","shasum":"c1c5aeadee8d74e4721b4974b24ac0ec8260f2e3","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdid6yqc.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK5YpCRA9TVsSAnZWagAAWb0P/RSEk1KJgW7IBcBHFphT\nXoohLJp85tpZUFdN0szMFJx5Om6SpzopY0enHVaGNFtHLieQK4I4acOJjcD3\n1BCtS6Yz3p2ZgOjdZ0jll2koDV7riIQDA8q8BCdIglYV8DFaestpgQBmsTmg\nZgzPdh0mNEcZ70vMZ4lNj6d+Nkrunc+g6POFl8PFY+ZVyQm6iwqUxzs3lXWg\n/+LQDZB4RDz0h+xU1ONnNaIIRWUuna//3CYEBF4Sq1eDOz2hvczHhme7p+NO\nvD4blmeyrwT/NNT7jsn5KFgodL9eUQnm+7EK2Eq2esHdRaJPJdibwkzr9Rpw\n/rc/79CHZVKI1szmKfi5TXXR92dvv3ciZWHZQshP0pDGOKm/KwVcTe+ixtt6\nvaoeedeuBB1A+Ir42/y3aKEsm64E6t3sqZT2YOC2YzOIJRaeK2PPsAeUKrFH\ndXH6oVXXab8jaiR2qayv5I6PF2xZCGqxTnbqTIjr5ZUK0LBSAKuOhjiNdyzp\nE37ize/6vxdhNPIpHqS3QRvnP2XkXd+q2+mf4Z0FISmLz92HN8lEWhsuuwMs\naAS+oGr1j61UYzaUkFZ8t7S7b9eLUwAZ6STE5DkEIuCMZQIh5Jlj2nyfj6qW\n6HuK/aYVTbaPYwZz+I7ThPMjyf/EaHSxul3r5mv2M6HDQ3w/xqrCMiENPY3m\ngZ57\r\n=XqBu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBnNqMnTS/Bhxj2yKzwyHCGfelWd6Sx55l6xfTZWef+AiBEP9ouReB/rEwgclpWoDsbH1RWtuR5mg7uOVskhojNBA=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdid6yqc.0_1596692009021_0.20303618329135187"},"_hasShrinkwrap":false},"2.3.7-canary.kdjdfg7t.0":{"name":"typedconverter","version":"2.3.7-canary.kdjdfg7t.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdjdfg7t.0+44b6b52","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"44b6b52be66103214c84ecb1d9966f3f48e3c0f1","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdjdfg7t.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-AEf+oovSG7SFnVTdO7QpyFz/tlYHsvW6svYR245e1+BRoGxjvplXP5x8T65hjk4Prp5tJuamX9PeL4Mf5GwiGg==","shasum":"908902f128cb743d61cb3e8117df851ee8be7f01","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdjdfg7t.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLIPoCRA9TVsSAnZWagAAZpUP/3Lf1Kq3WSi9QZoZfPl0\nYA2nqjoRKI84lklZHg/o126/dMH3cGSRwHXcRaRRJ0UsyN7biLLBxUEOQCLD\nzlgZaoJZkzmE9zGQ4rQZPhhy4SVoPYv0lgBpttDFs8YJuVJRDBXOb+N68/Er\nkGu8TPLXYu8SQddFnkl6IVOL9QYEkYibjHrSQAVo2pZ8hgkJCKbl1m1QdSTg\nVY07zomQLmfBlJ4zXLvd5XZyI9Jyq47tf2mE6tdSLv/GUlJq+KldR5GWSiyM\nWx6eDiLyMrHGutkUAEnCTh11gGo2ckb1yWcD0DFbMsvPClcSaWAn/Kw1v3Fr\nkfhzgI8eiNBXthNF3N4vKsoVro30agZ4Xj/ifax465p+Hr+YEZAJehzZjhHQ\nxMss1snJyusaBWk7E9gFuUV4E/22nVLbza+QM5G4yzrR9sEd2UlWBWvVcSfk\neQ+wKbeSjLSVvC0b762Tq6mChoADwLDNK3vFjRk8Xus/I/tr+wJ5mm6gM7Nu\n0weK18/kI5A1d8GQow0RsnDRUpe66VP3rmiE0cjBQSmnxK52wmwMuDeEfHkd\nRAoECP59YAfwVTuJdbjZSA4JBm1aY1gDsB6f/fYxErNmJza0nMj11JHGnoIm\nzy42NnFir7okJJuy2OB0XlHufg7jNajtntfu//GZKWMVtc209YMuG2Jp4Owp\nnZjI\r\n=36W2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAYaNqhwiESEMhJstB/aIDYQ4wdPRZmkpS+/fzIsNqCiAiAZVmybtSkAIclvm+TnF9zGRS3jw75CEisyYN/IIJ0Plg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdjdfg7t.0_1596752871746_0.261132580032879"},"_hasShrinkwrap":false},"2.3.7-canary.kdjj7hrf.0":{"name":"typedconverter","version":"2.3.7-canary.kdjj7hrf.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdjj7hrf.0+3fccd92","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3fccd923c599e57b5a0efd466d288dcc948c1ef1","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdjj7hrf.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-nEr7Lbjh/fPYpd7YvTdXxzJ5Jd3OpcCWeaGTZi+YTn2dIET/IZjBSXytbtrcZS1FbsSTfxqy2M2b0NY+aTPsYQ==","shasum":"53e9557e5faf3e28479029dd06755d96ac4d3bff","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdjj7hrf.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLKnTCRA9TVsSAnZWagAAlNsP/ibDXOd7G97QF8Ib+2eI\nMHANSZqDE+UNCGjw7UASLB1R4xJC3CkfGmsBafue/CiqTBmBljvEbzJBbHt4\nMmXSLk8UtynxPeSX8r/w2wyFRROBPk2D7WeMMKpoQLzMWL8W+WULp9gaTChe\nQ9o8kYD+89wnZGLnQlMrD76TYvdiuer51+N/mAc3gkUNjTZ8rvobsLnQ8ic9\nkLGI8PEdpviKcjLszMu7/FQx2ClJAyzRfbmHmePEYwkmsZw0wVfBLNT1wwdS\nGf4LT0ntf95sHKJonbBW/90IJo87fKV0FN8vMYv7jg0fAGEcm195M3BPMOKR\n88OhtRXJDEa+yFcQwqpbIl27WxMtxO0IAQ47ofO6zQsECxme5NxJ/EAkc9R+\nsSekAR7p60djp0TzsI1LsD6DJh3HUPL/5GZI63khSCBx/Yoa7l0sFTnwLNNA\nWA73JdoKgFf2fB1PUJlDHtiMdjSnKc/UuQQd7q2kvjpvQjSw3iwBoG1qQAgm\nagmQu2QzWGd85GFbte+WBgsNj7FmaCr0DInigwXcG8mVeVxQkQK5bMeUL6zi\nMu6wHFQRB+QsSbELNJUTgu6o43OHCd0wIQPpYTvt4+x5iNXbv89TjvQAbpuF\n3DvsDgDPDVFk+fcLlf5cxfC0+7WoZp6Wa6+Oc3WR9I01mw/V20vneZA4lpVZ\nweQM\r\n=oZDK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc4aVMEGjIgXOYgnzjXwtweOMGczoxZU17gCn1bYkg3AIgQCD2pXxX/gstcakz9/OcsM3FN8kdcmgEC3sNv4MUCS0="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdjj7hrf.0_1596762579056_0.1562115309918377"},"_hasShrinkwrap":false},"2.3.7-canary.kdkqxkys.0":{"name":"typedconverter","version":"2.3.7-canary.kdkqxkys.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdkqxkys.0+f21c49f","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"f21c49f710f91bca701fd71a736769b90094108b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdkqxkys.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-3UYcProg3rkRyJeMvsY7NuDCFsyjGPD5zi7ORJgID4yQqsvKuH07yuBzGiK9Xt2unyXfyKdOqVkOAeK312T65Q==","shasum":"9343ea18ae3783140438d7149741a2011d6c924a","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdkqxkys.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLcizCRA9TVsSAnZWagAApk0P/2A63LG8ELW4CWwFI6ff\n1/oDJrrebQbUi8SOLMJ6LgL6kSqGaDrd4Z7p0HHoRfRS20NYOs/rA4W3M4fk\nJ+zA7fPtVUKt88G9ltXCQjZI6REWzEzDFIh4NlfrBFEKvbjrhVKcJI8W9nkp\nBUMjagqjsFwAsudo125XEW7zKxqMRU1hStZHOUY3aPshEHCQDr90mz8QlBc1\nBmQHuHK+N9Rlwu3f00KRxAJiR1jpZuCwwthFBjbRxsvszQAEdrAagwV66Ur0\nGNfQ372oZqyLFWgKLZBBGkjbCjdugMsYaL8CSNckAZ2NG+AmNueAItSmywHl\n9MsYq2eYUtJCbTrHbGCkr1cRiPAS13aQe0nq9LS7yNN3YJ+4R3enD8XICIEF\nkZ5CPs372K668oSIRvkcaaBIBaWGqPDlPCHJn18/jwlL8RRQKMo92d1qkyBG\nsuVvspHy7dtpxf+tftKo1PFuhJS5lBLjlFK1nl7jwcMXnfCRMzkhJTi+aOoK\nj3kDUrFAhMjv5GY02tA/nf9ANlk38Z/AfePsUSag45xf849lY5ug/5JsPr8q\nXsp7HHlBIR4GEiEdqLotDJEbHP910Y7uFGT/37P/+YN1L7QLlAL7LROpDh5j\ntTcqMs2QCIsbhcN5tjpaPD7sP8iZcjiNGlb+4u8zYkpq3YiqqS/8FR93T0SX\nPGOh\r\n=k73I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGb31+EH5h69XlsOq9Ri5tIy0NhYOBIwWlVgMO1s6/kQIhAODYv+OgqXkJX1hQ5XIAp9IOayc6fK26OF4t5Uay/igt"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdkqxkys.0_1596836018576_0.9957112221810358"},"_hasShrinkwrap":false},"2.3.7-canary.kdqpr7yp.0":{"name":"typedconverter","version":"2.3.7-canary.kdqpr7yp.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdqpr7yp.0+7907229","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"790722952d9fb62b0cc63c8f987cfec27f59b677","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdqpr7yp.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-b8Ao28osrDbBOPPHpnsyBDiRBEZGX8kvP50auAWQf/+QYzwej9TqKKYh9U+F/G3krDSxnAMjuSyZLeuzBhYcdw==","shasum":"7b398b6d33d9d916f82968f66ebdfadf1114bb59","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdqpr7yp.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfM0onCRA9TVsSAnZWagAA03wP/Ro9Uq3a+B2pHVR3MM1P\naIa7XvqPMsarra5ClFmqu21v9pxV13l6TY8pKRijfpbsf3qLdqqkdEzXzxZ/\nYz1t36oUGafd7WtlJxT7+sA24u0AYmCxcMb2p2rjMJ+gwLSeXfwmu1Sy6Nja\noW0qnmBle9j1+b9rBGDeip9BUdHZL/Q0K6Y98dpbJEJvm/U5it1DUIs+HfAm\nbRX7eAOnihmMo5V4BUn3AfxCmmZP0qLnoyvA39NGiopo1Wazljb2Gyspd5iv\nawkTQY8Gy/UBhyx60p5eCXK3eEGpH39K9ToJ4eC4JmCQ9XmnAfvRxhItuREl\nE2+9/Ob82dMp8l8CzaHthr+LT2L2r1FdJLW9Rvg0h6/9CSRwtbCon3LjC8MB\n2nwXAMXL3s3NnKNazKacj1AGT4iKVLiLLg69KaPMhbCQLl2rUBdsXsBk4Azc\nZYyDITu43AKQ+umiQW1GztnbfrrJFwJhsPuf8n4jxL+bQHgNDU0RYLrdFtc3\naBLgI/sfM2B71yMJbVKqzci4TgYfjW7YVr0SgIRx5gTOiMejXVPYrn79ceMS\nA7Yr09DvhH04dO8JvISkhOavT4p7sXsMpBM7uHirGlEExrQdVSQQhL21E0Dr\nYX+RYs8V3QJCQdSYJSFDgwzAdxF/7jKz5CXpLSup72mFzZZK9laJfGRw1Lro\nEkRb\r\n=smQl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZLiqUcHiHVrIgfBsSmJw3GibO1NdbvwPkiQwSR0k8ygIhALDGOxSiLdKfzeHBcUi/CG1rRfwTGE79b920YfLC56k0"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdqpr7yp.0_1597196839082_0.34920958858213824"},"_hasShrinkwrap":false},"2.3.7-canary.kdtej428.0":{"name":"typedconverter","version":"2.3.7-canary.kdtej428.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdtej428.0+5e8868a","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5e8868a92147d2ae5ed53e4c7f47965db5b23fe5","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdtej428.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-WrFMIwhGg+cKb2Uq6PkLoIW+xsOuHwLTHa2BCtHVJPes/jUl1FKqJzE1qGt6rW8Ly1due+BzNt5QPOX5lXMiiA==","shasum":"8716639b28ad233eda0f21a4464d671d66c1bde8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdtej428.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNcUXCRA9TVsSAnZWagAAHN8P/Rxt1TP+ngNAvJCPTnOQ\nt7RZl7Bk6xUp+eu/+Vgk+HodV+Z/BGW/w7zvqdP600VPZTWW63VaXUHl0Kws\nKNuN3yt0rB4n9BnaMqyOB34I8f7LR7JPngF0KsuBo5/jSJSYX8p41VBNodnE\nggNLUFQyjPo/NQg7Tsnc/hdmI/dC50ENZ+Tqwt+olUFm57MLjcsRTUY4CzXU\nUuGYoPZDcsy9CToE0RJY+mLsT9BkKvGAPn0+WY8Bw+NXwywOBZf3iAmCdBAy\nsE6EQJo7sT/E95T6ESEMdSJ0aFKv396vwDQi7alzWDPs1sm7u5vAPIsnBfnN\nacfs6aJAmejrofl83+i1QH5t/aes7A5Ie4o//B9tMRvU/m71GNsd45BWOADx\nE4i3Xe92A3fgpQc2aq0nTv6jhx8XPgDLuszDhGRkyccN7DnROgy8QaYzlOM0\nlcX54sI7HJvjlGZOF1RX55W5pxSMHl2Ds2PBxs4lxaCe5MXzP2at0t3YMOB4\n3iC6yDjSY8ozi3qIE2/KSZ9HzvbWcNiSlptfNUXZoWrklYuj231c9n1+XOFd\n2VG9ghftw9OozbKhkKwtINSO2NkhxdqRWcTqG4XrMoFVGmEUDkzgCAVyNByB\nDPIMOPMDKZ6skdq1cruEzAEsZiGFPKkWNi5uH5M+ko3uQtRUR1H9cM9Pq00y\nFI+i\r\n=+MZk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8Eiab7+FobMZoDhZzeDp/IBl/G1acgKiEV3Uhxopp9gIgRxM+8A9WpaHiW32geBUUb9B4gh+xak0BKqBiKJZG91o="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdtej428.0_1597359383421_0.23202983198655125"},"_hasShrinkwrap":false},"2.3.7-canary.kdtibqoo.0":{"name":"typedconverter","version":"2.3.7-canary.kdtibqoo.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdtibqoo.0+14d35dc","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"14d35dcc5ad081bc853124a3cfdcecfb924b7973","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdtibqoo.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-EY9fVBD4e+7THo7ktihbJcSKfW8YSDE6WDabqKkl6pWisvjV8QbQTu/LsuOJB3myjoGjJKG7VuI5eJYihz8Y/w==","shasum":"74cdc270d76a4ff9d441473af7dbde6b307cade9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdtibqoo.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfNd3+CRA9TVsSAnZWagAA5B0P/jcprLgOr6hx4lyl7imD\nt+iQC1QTDs+6ewwD9JGSFPuwMn1P4UB5EOAZ7l8UO09NIlsSuIuvNGg1LZis\n4peHAkdgMcVgo4dC93YdJYJWWfbVijP2POneoh+Q6lNQWkvDPM19Bar3d11S\nMPb6v6KaQqvItvVuuY6tpEvvIRwPvaQyCEsq4CEYJk6UWWWSX/elaLH0Q9CO\nUM5m6booqUlYWE/0UiUGsM34Ige5FmqDLXnIrIJdOMjtUhXEMj8eF5GmXbdH\nVsItG3ZecNGlk1bDxFkzs9QsujZl9lFpenblGdHB/kdt2I7wP8wShbkao441\nyBv5dbpltoSOveZS3eM1NBrBthPp8GMt9U2jw+fiWA4FV+4R7ytSRFuMFyIC\nJIwncs4CZU2mVWLTaPV2QU82c+cYRxZ59k3M9QPLet/eqQt4UXYZ/s629wjs\ns009ufJlZw+TWhoMMgGLky3i+yhCd0cVB0JyKZSEvA+l6AHNpBMOE8d6VrF3\n8uEG0OMTucfb7YFfyRXfzg+k9OsmjkjLSFdDtNMShFW0MaMvlyiOvtWNPqb1\nOQq2tkRTXWHN+hEWLwRN17TjPVq5K64q8hKFEznlWFXVnFTmhEMKpP3m//gP\n0JF6rj5D3HZ9EXI+Mgls8QtPkQtxdgvYH1H8neNVXFrNOPce4BC6mOeS05Hg\nXyY8\r\n=MgPs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEilNmgJJTI23CRpO5KRySjsw+Mws20J310YraPiiVIuAiA0+ZcG+SnLFrRuFqL59Ibjc+LKK2F2YHGIIDIeMWS3Sw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdtibqoo.0_1597365757988_0.5390988120664741"},"_hasShrinkwrap":false},"2.3.7-canary.kdvw2za0.0":{"name":"typedconverter","version":"2.3.7-canary.kdvw2za0.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kdvw2za0.0+3ffadbc","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3ffadbc90a8f7b14a6127874df90c13237778480","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kdvw2za0.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-evQWzC2G5cnT+3IONDJQKtASEMSofe+iz6LMr9DgZ+T1D3kl5bLlqvWtRx8W92APzHSm7wlvV3Q7aZ1Z0YNrVg==","shasum":"e42dc55fe530971d1c2367e33083dbb89e9f4ec6","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kdvw2za0.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfOBClCRA9TVsSAnZWagAAiyMP/3pFI+W/cH7wHuH3Z1uC\n2VpUNMJy9hd6F9wFJuoategv1GAnzDnCSMbL3b1eathDeUoUvIe3vUwnyhPg\nxiaAYMLNxeJUf+AGKPwVQZG/SP4a7wpfCgADteRVJLz2UElA0zSZ/15/2EAq\nbFx++hZu0FIGB4hdBM3+eQ6y+ng1JUBlDoGytUwoIiVNrSLYzK8O+rM9DtmW\nXLEkmiVOgI1iYgceG18PU/YK9LtwS7z+FtBVKREPQR8f8ATv2TdoIByZCh1a\nvnLc/6/8hJU3mX6kDFDYugk8Aw6kRy3RHQv955Bcko5lGC610tb/MGgEFFOb\nnTfcR6t+KHIP5czNlVd2vAr2WDFtchRAOEbN41vldw7aCwEIqxZoHTJaXllC\nTfe3BffuSqT9RJ6oWqqeOC7dKHNTnKoDtGj3+7t+vzf6vIlvGkVKlJOfz1D9\n4EfsMzFqO5Hil9q1Dna9G96j1CeyOHktahShEIsouWRBIO7A8ailxGaqg4uY\nmmk0BfePq5kqAHJv4i8dRHOK7hJPKWPK0s1X+KvK68QE4NkXrYP126ZmLkQk\nKRXt9UUpAiVOL89ajI0aNqpLiVPio4JCYUf0L5Atm2OktuIE3EaBG5JsarQ3\nzqK9PT6qsL34/n5RxqWDk2gMxzVVVsWV9K88jxAJ0u/gXmuAr7MJ7q+M7Q7U\nqxF2\r\n=luLL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDiQcsmt+S0djxR1krBLF6qmAxcBP1v+f7ixVRmKvvk7AiBhi7nPpXUzoMS4UsSEY4mLVa96PQjBWoJpneE2yD4zsw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kdvw2za0.0_1597509796627_0.009620673868050655"},"_hasShrinkwrap":false},"2.3.7-canary.ke8zqwdv.0":{"name":"typedconverter","version":"2.3.7-canary.ke8zqwdv.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ke8zqwdv.0+adc4afb","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"adc4afba59c808b862403bc0325063302cb05b3b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ke8zqwdv.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-G+vCcQcYwyu8IR/y2RjJSW87JWXcy7DxraRuFnGxyBUs/Y/bvax/3upK100YUNXwgGqdxMJJpddaLEOSsU7plg==","shasum":"8a0afa3c780de44196c6bef3ee9b1022f08a7a3e","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ke8zqwdv.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRCc9CRA9TVsSAnZWagAAMQ4P/0pf/OOMptw67Y7ApkfZ\nDnNJi3P1/yK95C8HXiYHUIuvNjqMp0CnqjSGzSCSYGTF5MdNGNcVghsCjQMF\nSIvJ+AMxqOgv5Wl5+mjcGGpG8tyi0G5b8/bgPMRnFOmTDvICtuex55oq7zj7\npn9IUV0m4A/5EGjLD/GydMuAm60zGhbIXgUQeWeaPHsK3yQZRIIXQbQcrBGs\nUL6RY71zBIKTS7oddjZ+MgFlchRL6CedxoXefVx2SGVT8bBijFMwl4JWGuyl\npJ+uHO6L60WnendXFIXrazsS4UvFykxJS1qc7tp1i+P22k04h2skKTZQjZfW\nPtsu3Bg9/fHekhmUjiHGrNT+s36hDJvTJKZYvoy+o60HUy7npzz+rAhtFuX4\n6EaL6ORny6dxMRB7IJTlltahVgztscr5fZBICQAEk4t3x90IaFfDgBC19PHS\nDkC00kh6sO1PFf5g0LNY/gtvmGKaH2H+Vrj/945s9KLZ2FrN98bnAUhhT+Bt\nRW2N1dJK4tcx0seleG10syS4AcP3EeJiMAOvYQaunoYMQauy9XBWJduf0yd3\nHAdhJTp2OY/Kk5JwLpfu2qYhRmbN/HUbDPoK8AOJAznc2jg6ZDdh9VekW30h\nz+XxCBY7Ep6M4T09xuIR4aDt2bE+2fjt8nR2RCrn44FkFNTmuHj1MfW2bWPV\npRmq\r\n=BvWg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiBjfls0xajhzqTTcvhVIcLIXtNnD9EYQo0IwdGgQ0GQIgSD4KhQJMpV5Y3sje1r5lGS7w2pjy3fJhfGGjUsvBrXE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ke8zqwdv.0_1598302012583_0.27777798585017455"},"_hasShrinkwrap":false},"2.3.7-canary.ke91wrl1.0":{"name":"typedconverter","version":"2.3.7-canary.ke91wrl1.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ke91wrl1.0+e2c6cbd","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"e2c6cbd83b5c0ded22f2795b1b8dc0876c9b7941","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ke91wrl1.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-NwsCfruGZEMa6EtDc3dd6mtNRi4cKysB3ituS2AafT73OxkNjLWsA021tcdYjt4OsoHLOgrQA7R1UwxNrPOJRg==","shasum":"46d8d26356751d46ad67758ad31dbab05b005f46","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ke91wrl1.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRDVvCRA9TVsSAnZWagAA1DsP/iVn2StfF8kumzZr8rwQ\nRcYQBaYRaSy5onIsEqrJ8X/s8C7XEMPRg/p4n3ZFzlPCK0AkLCQIfYUTK9Nt\n83Wr3wN+JwS/LhOTOTEBvc2pzklSQC3emR8g9I/IIfEIQQKuRpyLNv2FruZB\nFlZZ6H+kZ7FMzdUyY7gda8eBHF+tVdrHchMFWdrrX7hDr0hNDdPA8g0SJbff\nyGsXKQ15xKk3DnXe/z/PlEO4Z0qOZxHmoRss2S1GJSTjCcXTXBM936h+CbLZ\n0HKufYWn3awaE3vviA7XmtLJSxPeZqqFQAX9Ox00Xt5zqiAuoOvXtHktKBVU\neMPhB7epXHKTEmNHHQgQcgyIXHvL/KMepskHQrc53+7je6QNYUmY/0lzSY52\nSlWpWeBr8on+zgvbawxFvPP9s1s7olvAakPnWwsPktMY5pnJp7kwYnS33AXI\n/OnYA/WNeXNXjgnbyKUyfkHWvo+ZshHBStIERux7T43Tt1VrI1FSJpXGmchx\nhs7Z+MRz1CnZSofnBXjWWDg5kSJWoKbDJr9EBPSMDdSXpa5YVDYkSP+kV1fU\nmprRa6VSYXGwOb277ZixpKmLc9dR1LDjTlGiyzNcgzluuGjWjrp/3qylXuTw\nzUDYPlbsg2VfVkaJzxshTuwgETdgBds22nL+h2gV3LGKXBymdxV0S6Y9Zjgk\nlaPv\r\n=Y01E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEykpW6VrRHMtq3HLrN9XfYd+ej7ur4LbxIfgFFsx4ysAiBD/W9uYvuWx5r256h4VhebYTFFeOPFic/gkYt7sXJTog=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ke91wrl1.0_1598305646670_0.5864478049718089"},"_hasShrinkwrap":false},"2.3.7-canary.ke93q61k.0":{"name":"typedconverter","version":"2.3.7-canary.ke93q61k.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ke93q61k.0+15b2cf6","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"15b2cf636a45111107cf6c2579e1d72cd105b4ed","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ke93q61k.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-Gj5/cfSAf9rFAVpgZWw3K42MvBQQx1+DbFURhuxKx/6gcIuyJBUpgFP7iSe42ZOtQci3JpfIMt1PeC7hn6/ePg==","shasum":"002b4b5d1ea9d3fe11a0fdccfa21e7a5fb2aa0ce","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ke93q61k.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfREFZCRA9TVsSAnZWagAA6vUP/RwIPiZpLU2RVbeldINg\nBocag2FrgQx35BAVaM2pqzvs3iUgsMETi8IJzQqYJawhQgztQHyxaPg5POzm\nPQh5zo5Ifkv3a+k63qhj/3A3AtdAaYIN9OEjbsZsR1UdtEZ+1Jgct2RKzoPd\ndnFtqqETWdaoU5qpPKTOu/GBvbGgJxNf1Y1I/z7dDpIMthbn0sKe/aqtftu5\nQkbisBlcisge3k3jhxmyFmBglhvQ8+E8+syPrDbPKOve+I30Md1UnRIDZKwi\nMsAbPPtwy+rGcttichWlehyCzSyLtRvN2JxtUybfJLwT/U2/wW9x31gC9C2e\nHD7Pv0KwunsW4lIC514eEpjxxCUzA7xEf8sed84q8S+0vgxWmBGrn3AjUh2O\nyLgwYpBpVVQltOODi7fXF3iz5HW5EOKpKvVq7N3R/KPtDlNI+cwGmRd4FSac\n95w26UQf5qRH85AwdugyKQCtQf3EMFjQjJqRi5ZkfHW1L9YDmz6MfGVtyzsD\noOWSWJffJmWhpskfGdUrGhA9LpiOl6oke5Y8GgcuKXKCV1azHjKJzkxyTriG\nnhXanMVfDg4/WDWF1jjcni+TNhnjrBrb47vFMIz+loLfSCamtS/O6+kf4Sf1\nz/lR1Cqh3w2kI9PF+xYKfOvKe5hRSMPzxQhW/JfvKR0E3jW/2rB/hexNrICr\n2km2\r\n=uDfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/84syAr8nbduXYPU11unXJ07syvY9HKnWoiIYghvtGAiBc99u0QxEA5g2YajfvRJ/4SNJfu9OhpQd04IhlU8TxMQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ke93q61k.0_1598308696597_0.8991876834698809"},"_hasShrinkwrap":false},"2.3.7-canary.keao8m4o.0":{"name":"typedconverter","version":"2.3.7-canary.keao8m4o.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keao8m4o.0+7a9b68b","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"7a9b68b6b6f55cab312754dabf0d2ac52d8acf50","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keao8m4o.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-f38H72h2fWRI/U0sTOFkmELrPbPyCDzNaIwwedCKZYXkUtRy0spLTUDse4ApYEaecVL8dNGG6RLpq7qU1of3zw==","shasum":"e4a746fa64f47acb759d1e130d3e2eca4ae74a64","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keao8m4o.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRbQfCRA9TVsSAnZWagAAAroP/3GbGQ+bs0oE6MpMDBR6\nETJ1P1PdRG753ElB7P5xwv4KrdzosxGKmYAP5xZkkswjdLLgDQI3pMp79PcD\n3pePL/ZjUcZ9WC6nmZj2FDSvg5MKPHOOviQMfP8RZXCQClbcXcJ3i9KmXdRu\n2yaBEyTfFEexHQT3W7lDBmlqClPTUTrDRKL/td5IXmlOlEiqhsS7qH202d+w\nKzRFRHeIGiIpRt0GCzKX91xy4HEoRReudm+Bil7rbGCttL7TDv63AoB7xNlj\nTT7gfxfovZLwiUiiZU7VJDdYCJZEQoHUrTMu+JpRwY19IkrFF1t83hYJTd0u\nNkdQXJSzZPDY4xmbRgg86uXpYBNVTK4LJ9yuP5wOGNp+OrSZQzgBj0SJL7qJ\nMk4V7vlIMopMaowfRnwfBtt0I2cyYGhj1eTuuEG0jXBV1dSZo2W+p8adbwey\nyT96pnf7b2HYc/1k0i2pZ5HM2q+99UCVVQ4pHNgd67yCPA0hnzTiuwdbbOr6\nNrlwIRJhHwvn31XCz1CXVtjiqiAhJR/X30UwCMIQ88emsbVQH9fI0/8Tfnro\npdz8bcpNQ6ob3RBsiobx/Y8yQYluQATsujU60y2sb/KfGN8ZOhpfT0njZBv4\nuN1qZ0meQtRGC/Hu6rL54Wwq3EuhAk7XJM2TT2Je6A7orKbWZjf2mxGfDADr\nQB7L\r\n=wpj5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYrDiZuZT8Na1Kps2+xfZ0ZTso59bgoqqorPAV+LaCAgIgWNi8ZDk4Nmyu4zGpT4r9Gaxmt/Z5VKPxRsKatgmI71M="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keao8m4o.0_1598403614745_0.48650140973775025"},"_hasShrinkwrap":false},"2.3.7-canary.keaththw.0":{"name":"typedconverter","version":"2.3.7-canary.keaththw.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keaththw.0+194d725","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"194d725bab3a2f0096610bb9cce506fd2116ecce","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keaththw.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-SAl7fdfaZx+oYfotCwb9EsDH1mzyEhUItuOMKxx14Daotu2IdAxgCN9SdAVqxvblwyPZD6/5IF5ssHvibW5CPw==","shasum":"019d012c6b98c8720da34ac3a05d60c8323c6e0c","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keaththw.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRdabCRA9TVsSAnZWagAAqcwP/0L2Cp5oJib0qnv31jmj\nZZYroHQQ7URg/DXCCxzJpxrDetL1fglewKtfxVFC5MQ0t9/ZCxtV+tajISXS\ncH3ceCbD1sZdDWzsFl1UXg1KkM5kJhDN83+mIf3VrCc0f1uOOtteE0pqarx6\n8VFqZBS3AbnWmIQG7Os93tPu/J+/5vFMgasJHYpR1TOYP7sYQjIN3g+NEDlD\n+Oxn7vRKL5thxgMi1htRX8vjSc1hAqD0p4DoWZh1Vg8e4LDy42Yif+E4CZfM\nMMEUVg3QvMVBioixekjGjyU+EPS3BC6sEeos5S55EFe33MNlIAn39+UMrG2X\n6klrDc3LD9uvDjuJxT2IhEQdM3VUzZA50/dqjA5n4Sl0yVXc0jr8nDPa89Yi\nT1LbkexsSJ6vLAfAPLmqnHuj3UUpkrjhOwXojmcq0QdGqEDdqIZV/X+/00lm\nD75MPN7l5LFn0C/M5xoKbtnD9r32lLXVBmRs5p49A9xoQT00RtKWymZF+34Z\n5wRpmPJtppK00cg6Hv6FE44gJlCmlV/LNM4Ezo5SosC0d5q5VbfXBc85Jh6W\ng9nBvmvJbpaVXpxV1k4kDX+PUeB3A6k/bfvcnt5AwaIotuG1ZyxRbDryCrbw\npesspWa/JIEoH27cvUG6Aj0KDCtTqBDhpqENXMZGGdtV0rCoYS8wNOr5F0Dd\nKqdf\r\n=LMqb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFP+LRaeRorVA2iyMfli2rLjmdAmXLDVTK8tYpP8+OADAiEAkIrXP5pUYTrCASI1WIShIWwOnE2WA9J7B1mG+NR+mvY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keaththw.0_1598412443098_0.7133610827800447"},"_hasShrinkwrap":false},"2.3.7-canary.kebz3sj5.0":{"name":"typedconverter","version":"2.3.7-canary.kebz3sj5.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kebz3sj5.0+60e26b5","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"60e26b5a715ee021412ed3c2a6d1620932877091","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kebz3sj5.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-gLHNWgvhcT52N37HkezLj4WcrGsDf1l9fJgIIVFkUCjs8ct4nHdMbYuamQZhZDs2X9suEcn9P5yNF6/0yPNZdQ==","shasum":"d48b29a255bff9638fa4b919714dd39a08a2b1eb","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kebz3sj5.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRuecCRA9TVsSAnZWagAAbrUP/iBVyowG5PPcc5aE/T7C\nJpuEThFSOBrkmM4RpX/CXMEnPoaigmlbOBuIJQlBhdUHWiGB409jGiO312xG\n9vPE4UpBATA0AqVQ2mGKXSDUdN9RWefJ69hMvIIgA/fGusiJKCa5ahyg3RYV\nen9i1/ZA63jY3rF8UNGtu3hihSKa1sczMIfw5QfCzczGJG48GYoZY5pL/CMC\nMUTqmLPGbsRkjSs7k1awemyL8v10qwbaL5A1BrwmLG54LBdxtvjRzxqrH7E8\nv6209sXkN9u59twtRp8E06jnhY8N4k+9k63wXCluXFE0wNNJkdw1axoV36JB\nJ4iZuAWuTbfhxXERHIbhRwTN1WPIJF45bTsFlgWdF7TisRYHWejNrLAQDNFe\nZNgkKJg1DlAMepEi19wXLAxgkswlNZXkLMPw3x6LSoTkH6XkQ78plxUHk27G\nPw11FMskSzl4Rt3Ttx9p09AUaVxlYG5iJJrb1OsHuD/S2+zFgek17HPWgP3H\nDHyYUniSmwk5JdLfaJURhCGFB+6PeYK0UeZpJZGEkqzRl3Q3WgnY7zdbt0QD\naFxY5fZe9YpxSjHWYpR4F4BdXtQrryjln2C28MyD6PN7te90w0rr9zsfnayy\nDvfY4Wv8+k3rfXRz+LAL3VnI8z4OgUF2azNU6MCPxWojEkmtonG1cbMxGuYL\nXrx4\r\n=l5EQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnT28HGNRKL6wnpmanUHnkQXeT5GdbhY2URgZbdEeuKgIgbFk+bVVeBDdlAziR7qKqbl4tBeI7qug8zFtu8wlbqK8="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kebz3sj5.0_1598482331957_0.07389258919154762"},"_hasShrinkwrap":false},"2.3.7-canary.kedxkqhh.0":{"name":"typedconverter","version":"2.3.7-canary.kedxkqhh.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kedxkqhh.0+fb78126","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fb78126d2a9243dd16903d18d7583d36e3a7cc7f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kedxkqhh.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-C2Ms4g5S+q9o4eC2wcNX/Uz4n6KXrOMmFJeY1DZoPsnBJ6kdx5beD7SlbTNrr+15CorTV/6+AMD7ch3W7OolYQ==","shasum":"789c506db22a271791fa340e030ea31ff60e39df","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kedxkqhh.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSLX5CRA9TVsSAnZWagAAL+0P/AzYXtw+23aNwjz5ZMKR\nj0mDdye80YXp0PAXclnCapR9FNSuu9tkoVlVa+miCfJmv6/+JvCLI078ohYE\ngbhRDvlx2cqrAmn9Ka5ZDQVePfM76Yjh/qStmpUB/7GZpzp98YvqW7X6lH19\n/T2JahcGVJiFAmyN3YYxE3mmlVivM+YOo579H7T7/S9eNn6NrUTlbfQ0fn1H\nQwo60Hu8KbMOUwgFmnY4GJrdyeGY8nih0RdDb1RIdPiY+XFzdG49hddkfMKu\nCa/M0OvitYPx2g0Z0tLeUuNnDGB69Y4On64DHTzTJfc4LVURbm+jGWniq7nw\nRm8rNgr/TWpZCT8HAFz9kB9WalwCyWaZKh6KdkklWErCqM4cv6ZvxVzSBTcv\nKThaAkk54hKqbkaMyvEkno/Y51V3AiPb0t5xI/E02iWzr4OjsoE3KaGQ8sU9\nUSDSOV8iyWOaTaHOU3Q9N9Rwl0PbR7dmrr4c/jXvYJDQhmXaFWj8tEXg9tJY\n9aVEyBZmih7SEBK7Q2Ows2SMU9wN20axmtFbJx4le5XkVch3eLvazfA767GV\nXJpyzib8hxT8dqtqwI8jRFm8Yn7YnzwKTdkmvbDapPMWUwsZnksWxOyObPaz\n7PLI5BftbA/MF8DxLWelz5mMj3nHC68uBddhs8SnKmxaglPoeWSg7YKHMBkz\nk5GC\r\n=7G3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHW7cLYM17X9H9jY1pkGeWgNGp6qXHpzSCRu1UZKpYiaAiEArUHAtEejrpygnjKf5WOpMKUEk0f6C5XZ2JK+M7wRMpY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kedxkqhh.0_1598600696585_0.21037005706971867"},"_hasShrinkwrap":false},"2.3.7-canary.keeqwum9.0":{"name":"typedconverter","version":"2.3.7-canary.keeqwum9.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keeqwum9.0+045aa51","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"045aa514dc4a632e41224220ce089e25a3c78da2","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keeqwum9.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-+hIXLTHxGyYm7Zk3b4jd1uIdbWFrIFqyrjYYom2+Qe6L6hg6ofJMbDb6MwEorRKAsX9SQZL6PvtAAlKkeIvMlQ==","shasum":"8d311b92a076ee0ed9aa566d2a96d2c7350a64b4","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keeqwum9.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSXZ2CRA9TVsSAnZWagAAqu0P/RrCvJG4zeicc3kpR4GZ\nU2xUkPS427s0ktnvF+7uQtayZFQzxgrc0WiZWWtbLov4X6F9t0n2eOUxeSTp\nTNVERwk1cCKhHxHrdOiu74LCwzdV4zvjJiCouha3r8ZhH5I1EW9J0Xm1Pp6r\n5c9j97LIaw8O56JunkSVWEyYtAZ0e+kRLK43eBgLv0VKqtXbEIMiR/3j9kRj\nyTSb9sqDUPDPqQmAUXVOEJIjVK568lyBaOOy978o8Oo+JkxxlIgy9fGcdzzo\nViNiTWumVaYny61YtXF9Bm+z/PeOtLQqIf4VC0CVLmlqrIxVAoY0RRYKJue8\nYNPFaeeXxtNmiywJYvOmpgzM/224doRN4IdMfEMkt3QvlqjwBFuMlksaN9w0\nlmD3pWjhA7cL5rizi/wFQyZT2B02E9yCOJcikSx8ERg9GxXsrkEfH69c+zpx\n99zdyFja/u/oiqyx2ih0/OAg/cry8vcPLFCqJJaz0H2pucfQKTE1O6fge8zv\niBUygppT7+YucxjGPVnObn6lTptf4ShouOLFmPBkZsS8c/B99N/iyPGzSn5a\nSMS8z+5zC7cGmJptvtMkr45zWQQPotmBsJA0S0/K5MZLxqEq/764d6Fe7tD2\nKUG9dP9dBZZzlIxHXnuoX9sOaYT3QwkxMidav0JMSPiCGgwIv4YU6YB2c6YX\n5soV\r\n=hi2o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCA26SrKMDAGfyNFsq8lvCgmupAyem064tZ+BxbffuljAIhALct7QEzzdI1+pImJiV6EXejUIC5G52ISA4tz8L6hIGq"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keeqwum9.0_1598649973979_0.5019160626940469"},"_hasShrinkwrap":false},"2.3.7-canary.keexw8ts.0":{"name":"typedconverter","version":"2.3.7-canary.keexw8ts.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keexw8ts.0+2a3ba80","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"2a3ba8009ae6fa7633a126d65bd4749acac36015","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keexw8ts.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-fnGEVCzP5y8ZOS4LIcyBuzoafXJ2FhPZNbFBUXMwRvPQbNPIn+ilDSKDz9j21Sq6yDynyYUy6Yg3tAF/BjrLww==","shasum":"6343ef609edff6d58cab9c7ae161efb263ec2dbd","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keexw8ts.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSaRDCRA9TVsSAnZWagAA8Y8P/Am/YKd8UGZ3YscS+ieD\nscm3FdykN9gWKOcObfmM9Iv6oCGOGtiG8/39GeuyEcVEFCyH5Cg0sez6Tvzf\nme8f/6NTPlsPcypkTFniYAjyExL1DBJgfSi54xJd6YfQhgJoFGORniSSYzvo\nXlkcJRsxV7ixsp786OvP8jKnUI5S1Rew4uz+G20JQkdhymgoR+SCIzuvrmzL\nRjmo0+CSrfGQNTlMipcTNCCFQLKGTwhbrqaMu8wRZT8nVe5MfK55TxBkxdlz\nE/zPFOH+OGgDTl14SeLEwFSiwJvFFehqb5gFQ/ssmuGf8QGk7BcsO+wXXy9N\n/9z0jyiFcvH9vTq4qS251ah2hwSlwcFtje6LWFhCZn6U8jbdaVTB3iEtM4uC\nrSA61Lu/8wCazhU4Kw+0YV/ScXcU065alIt8BmEgc5dBTJIUh88LeRApGLQi\nQIG8lgRIDxTAZOYFXEghGVEeZuF/5xbW5kgq5qG5FQ9TTriuwpOQTVD27loN\n9C01sZ5pdAOysY3k5OqOUTsQ1mEjk6R/olAM74KPwsoR2LrfuSjTzdaScwV3\nSVuWhu8eMLVPnD8XWpB4Il3Zh6blwIDDa4ygbKGVtwu3l5jdFFd/kzgNsZ6j\nDjjxN71yuwlMz4pFvqfNLqYV/ZqpvU1Pzy/mmw4P/Q9Gv8ffzmo9tARqlcKG\nu9L/\r\n=GpX6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIyDfshmswXwLvsTIQkMoGgm/B0LNKyuezQrXm29IG5AiEArMxnR21Ww51ahXeqz0dBV1UwlEQl8tjo+a39Sj3mnio="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keexw8ts.0_1598661698881_0.699245053322882"},"_hasShrinkwrap":false},"2.3.7-canary.kef2e3lg.0":{"name":"typedconverter","version":"2.3.7-canary.kef2e3lg.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kef2e3lg.0+10eba12","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"10eba1274e8e553ef3cfe19f131ae213ac9f752e","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kef2e3lg.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-UNBk9nI4CMbMN6lnx73Jw5Vc6GZX/HEZPPrduu8EVLQWHUseOHi2zt1eDClXs7OveYG1mgQvuFHW0lI72s/MEQ==","shasum":"4c2337f098ca4a6e10d85eab334429bf206ccb4f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kef2e3lg.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfScHDCRA9TVsSAnZWagAASu0P/18yFjGCOSawbHbWhRIL\nPPvx6H6H18cdqA5b7GHbbCVuM+mM9DGerJSuCkLu7UeBQCOfgXkXzhrVBwQ0\nQ3wusnkcnMh/KJjD7voRocG5IsieX2Y3evPerbhHxMd34QZuYAwq1XBpElzp\nqF8P1VIOdDF8NgAQSwvMbNHFO4106/ZQ/zpi1LEjEAn7knvHXJO2STWV9cVO\nFB2LznRjgOMbs1bF4H05/88s6HoSNKTCQ74rQ/jfaGXgtVygJ8EUdcruc2CN\nayOegRwdSAZLy9+Da4v2fGBLavbb3glExYuoxq2CXlVYvsXKpfovrcYSb+Zs\noEpBACCz4OdhWHfnHA53eSEgo55F/IxmwkFPYBkReSu6o/jBgv2SrYdx09db\nmvx3KvbL7XajqsRHcaA1K+qUOFKftSanrajBKoppJmMv6CIMrj2HvxTHTIt9\nanGfknupwM8DkwZR4/47zzLB7vgrssVN5yuMOket6f8IBqjwqOcKJy87Xajq\nh8jje0prluMhaSckJBAmBXPoB6MfR9FRD5jpwvBOA7WPpSjugayIOHbphMhZ\n4EIA+o5K6bxkYvDB2XcPkon+fx9i9BVPU4pI8preFRd7rQ1N7pQrzQs+IDYf\nlw40VN1uwA7I+Ezxc/gHZmVAtxQqf2oNzcJIXRFJv6/ugfTLMHTqQ4O0mKS6\nEDMB\r\n=mtMz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3Slp9oMn1FkaYWGHRI5c8vUriY5/heul8PtxqqtPgqgIhAMdbj9psCrzmNjQQi3srHbbglv2XBgyGgFkrxFWjJYN2"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kef2e3lg.0_1598669250687_0.9491957914173814"},"_hasShrinkwrap":false},"2.3.7-canary.kef5312a.0":{"name":"typedconverter","version":"2.3.7-canary.kef5312a.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kef5312a.0+fe66d98","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fe66d981d48900752b10ee5d052ad62b37a455af","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kef5312a.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-X8HFXerfgpW/AEJIHkbMBVzRbbJ1ve16CpNFh5ieCLzMsNnzkSUIBShuLqIqNsFDhQ+VxEinyqeK6s73JdN+fA==","shasum":"db7d2bef2d94da7367fbb5dc80a9742aa83bf1e6","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kef5312a.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSdNsCRA9TVsSAnZWagAAyzMQAJTMKGO3nq2xQ6bGd2W/\nsAmV6BmcYylZRwJnfXGuB0GLlkWwBdEqJG0x6bmDmFdD3kWw1k/tZSoK4XIx\n/1KPqK5olXebQQgi+9NQ8ZHerlg65F+7Bm7Hlfn+wCYR9iZSaMf0lIIi9tn4\nCr14n3cVBAyukNzjdvjlqfx/A0SOw7iNIjhpjznSbty78+HJPBT3V+nEjNLd\nEKowglAdiTs+fkJPQ0qiJJKn+IMuay81+b6vOCupxhgH2dE/La/7fBJXIPJH\n9TvPA2I2dQwh9ijt0GWUq1alO8adk/oK76EcJHBd6VokSC8i5Ap712fm/yaT\nAUb1nAJ4ly66YrdCU6uitOvPE6wgOTde3YBRSvJd6fT2/hK6t/8zmJpRfFwa\nwCSAtvGVRjZ45tyjMG7Qk54C/I+h4olg8z1guRBtB/7XAmkZATaWuwoPk17s\n4FDKP+CjifFyrEkDdXgjQrPPgggaCMMmtMpGNvPNlSArq/iwhor4PiwZARCc\nn7a9KLok/ODZc9vZdf0FiT4omQYKOAD8Dvpia3iGJWYMCNBQ74jGM8iq3SwI\nesL0fCFAwX3Ge9jqWSMkbcN4FPMnjnFYw+49G36UJwUKrUOaq/ytF6KvgQ2P\nahf9SN3Mymb4WNzCK7yz10l9bxgM0ziwjhjCjUG6jpYeVg1V4tDanNDaEz+d\n7cJJ\r\n=ntsS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcMvThEMt24Q7VIe+3NYBxvBDCDaqhSc91Mujzeke07AIgC269bn7hczcatgv18Qs11XjQBDK6FzXBhLaccqIyBNU="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kef5312a.0_1598673772503_0.8533863306074774"},"_hasShrinkwrap":false},"2.3.7-canary.kefh7qik.0":{"name":"typedconverter","version":"2.3.7-canary.kefh7qik.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kefh7qik.0+a769d42","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"a769d424261128adfe9a66360104b83e9dd44277","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kefh7qik.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-WjqnGnNiEvNwwcEG8/W0DWvMFn56Q3a/dDRY0y5gYY6DSsc9VL+V5nFosxWgFfcPqv4lodjn+51ii6/XsSv1Kw==","shasum":"1a61e8df0350b09d7f76734c9e76b673b588a042","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kefh7qik.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSiMECRA9TVsSAnZWagAAxJYQAJG2EmCvf/JukVNg0pTZ\nBeUVUZdSd0HAlPElXXWtAU36KKbo8xrEMDCBWCbnG81uRzhnOlcDEeOOnh/N\nzbi7e4VjWLtjYaTY83M8NwTtr5azFizEwXXd6XLdv0TfTgEi2d4q1tGaWDkq\nfJRmj4J9j1F2pMEXChufPHDyq0LNL5A1Udn3MWA/Snl9IOJLOVDRgbNgZRrc\nW5inRwGCBCvM4uTp4Fv06DunRfeiluKg5g+ehSBd5buE3Xft0ZTqEqVqWtuh\nzG6fvjU1fQc3NjyrUpq5DBPOhVfVt8z/L5NYQepvIQbLW9T4ANwyTyNkYqPs\npj2UFMGm1DEO1YU/4i+RD7UFPeYEYy+ZyMcq8XlmwSuIBVAzekQJhfyB08pf\ncOxTRZW4SIt2lC/1k4n/797CjA6Q5WZjJElPad00FAtbbs7Gra1eTvqOTKwC\nWJpSarjqY+F/5yO81SzNwLD6R/6nOHdNL9jFzZQxb8Gv48pDom5/dXzdwfVh\nNHC4J59U/UiJkobNleD1El72mA2CpE6xB4CDmqmhtq/6BgPGO4l7e8QtPjYm\nMSgLsCjwA/+diYAKZSCk4/KLa1yanl3d+EAwDvdyHp8hQJXmVYPzeYnG2SVO\nQsz/9JGvDf+6gt/m9WJbqAtbKEtCrvtlT8CWnIItZNHXpW3ES0iADbsByVxO\nOuej\r\n=redB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7QbgJvTDBn0tAQWp00j9QCv5fAhvFxzgqwh/xeytexwIgbVg0NtOlKjtPC0b8l9atSKOJZDg3rE7RaOEIRgSsCZY="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kefh7qik.0_1598694147749_0.8998438643093574"},"_hasShrinkwrap":false},"2.3.7-canary.kejh0j48.0":{"name":"typedconverter","version":"2.3.7-canary.kejh0j48.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kejh0j48.0+b8fcf00","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"b8fcf00deb21acb8713074efb1b84414d992a97f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kejh0j48.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-igGqRzD1SxzGvoECJj79hcYmy/RYjlTo7aptUmWaSxfW1zk93azsYBjHypwFRxL13I9dVaqEPEdvZ6dT3AaUUg==","shasum":"ba89f52830a3b74686da0eda18ef1aac3fa9a613","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kejh0j48.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTdJ8CRA9TVsSAnZWagAAPcwP/0ydhhng/TVRlh9llm63\nXYUCCEXoM6BPLwilcx4B7f7eOle3txaxHp/e1y1xEqWVFDoOA2YcxEVI9uu5\nDUgiGCav/nu9m9f7KjZ5oy5SqHavGCwyA8nQzhjCLF45FZxq8EoWyJD06pLe\nvN23ed9DD4sgb1UiqJ2yC03Fh28xY60wdPVreVrFamz7FsWnfAjQOfe0hZJg\nwB4RBquZ4cqMjUpswOJJk8mjkRq8eaYxcxYmZ9C1xntiJMVp3lnNFyTGcufB\nsCFC20uemBEyKJa/aB2ZaqJyaepyo19SgAL7Wn9LioAdYif7pHnJ+NRrT4Z/\nPrVlta1aHMV8VQ8jqYLEludj29jVyT6HoVknnRvpx6OSwsVM9BVwybx77i9q\nOijYBwNXpWP2b26cKFlpQB99SHt2/Y1MEt4rEZE2Qh6x18kzqBztgDXRzmt1\nBZaVJXCcFDjxeWFmxx+ve8IS+YM+FadXuo2ojvUTrGxEih+8XiKAr48Z+n2Y\ncJv0brIAVvluYgCh97SmdshqQB/Rdi374kYF2OfiD6LPXu5KZlbpsdpxWa6l\n/mPicRH5Y6zjVdSUR1PJvI8gn8P44HFnZAU7xNiKQDxx5tByquajS4LnN6KX\nqAwi0QxMePWoq/qExG9vvSfSxkZm3ARsqknewGFznqPcxJYgfIYYPcS2ndhv\ncnSO\r\n=N78H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKH3+yNK09vJ5Q/16PbeE3MnDCkUJ8Zy/IHCIxvHePvAIgBzTkMv2zfGSXjwA0Cs0in2Yepo48gJ/hy8kVJXr+iPA="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kejh0j48.0_1598935676141_0.9212123283606699"},"_hasShrinkwrap":false},"2.3.7-canary.kel7fsyz.0":{"name":"typedconverter","version":"2.3.7-canary.kel7fsyz.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kel7fsyz.0+0c1ba79","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"0c1ba796324d9de0fac8b8a9ae055fde7308aa74","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kel7fsyz.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-IOnWIitXjbNZskEN7Si1p5KepKLsCEbtZM5+HvYxQp2zU8WygZraHofpeTxGDLjCIdq/RS+L5P14CB5qqoNNVA==","shasum":"80b6a2a1cffd4b168471601359deb5fc4fc2de83","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kel7fsyz.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT2wNCRA9TVsSAnZWagAAn2IP/3sEFFAgM+pNA0JDf3OI\nL22a59XeqBskw6vrm7FvTNo42BYfMLWy3BCzrtm276t9NxrZCja+8pQXATS0\nNMDKqSFnJCf+RNuNZWxRVkVb5HhdFLmaU9mEiQhcteWqlfRlquSO9VWgvZbs\nKHxJmVRbADV7dKGuNsVhXY/WXrJCAczvKAzF7WIOTo0hlQ1vOILLW+mGOJSb\nOc578SU8M6+UgnNcatQceI31OPbGKDT443WFUG4hNSSUHRyP1e/6AakcR3kq\na6XOdA9tD7EjHDmNP8DM4kDeua/RCP2I+hIH9/JRJuyXQh2FxttowCqMUb9O\nVEOaLCKr4stPBUYSEJRtaIqkAJ5lChByuO+HntB4Kk6dWU+QA/1Akc06qV8r\ndtnJRPSf18dXy2mvkPZFmqix7V+GNGB5yuFFWewHgXVZPrgidfz42X57kTw8\nIJsRvurDFnaNEn4bC8UAs3EcNUmM4mu7MVykNbwzMUPQXMyY6HfnJ0ganibp\nAY2o/UrC4nxGXCAqHJScMIoM+Z1Am13kl8n+HhfY3JLKFj6RZrh6p7w9BLnd\nJ0bhND/A+3s9rkJ1SMB3lBd7hIE9ebKtge+GRT9X/XOTW3tKtI06uUaHG2nX\nDB+htQ7Ya5iIUPqpw4zp9yVtxa3cvZP04+5Mp+qucHXqGC6abK6NU0sx7J1Z\nq0+l\r\n=Rclt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDaSuC5TBeYD3efmcK2lHSZXsGzHYfphCoTz69Eu2YaxAiBDx+xS6LSa17so1XFUMYihlfCO3eRKE+vszVs7KzbAlw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kel7fsyz.0_1599040524713_0.550914719224729"},"_hasShrinkwrap":false},"2.3.7-canary.kela2rem.0":{"name":"typedconverter","version":"2.3.7-canary.kela2rem.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kela2rem.0+6fbee48","tslib":"^2.0.0","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.9","@types/lodash":"^4.14.159","coveralls":"^3.1.0","ejs":"^3.1.3","jest":"^26.2.2","lodash":"^4.17.19","ts-jest":"^26.1.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"6fbee487ad1bc9a90a297ea4049ead025aca6a21","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kela2rem.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-1D5kPZotcQ++G67fJHQWEMgvWCBac+OSihVe4Bl+4L4PrRpAsnNMU5bfkb2+wZX1uQqKHj83t0V367rzl4eu1A==","shasum":"5501bc960579b85e2603730a8d9bd6cfa583e951","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kela2rem.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT31bCRA9TVsSAnZWagAAnDIP/A49UCsrnAqRiLQeGFvs\n4or+Tav1VTFyt7Rssk7lSCwZDClTPURt7hnAX/Ws3UE2NoZJIFNHgfVYD+5C\nrTTvN3eITYxy6tJt63IwkXomwPl6sTTj8THYpxDs21pcFTeaHECMXMOR34kV\nCm5mQ0BSisjoAsSFs9AM1FxhW/wxLvgXGJQnAZSLu5FRUgaat2YzdSBJG3oD\n47wCwQ4/N1V5Hb1F406kJ5e63yZvAwQpycOcorayRz8paNUHgS/NxYrzcUPB\naFi3Ce61he4zHaQN/QXRB4NhrxtI4dR6EXrIg35lQI/guGSEV9vi4KZGIWzK\nHcytxlsdZTssSfNa4KauywiOGfc7f6OiaYj6uLFvGRTzzX+YLM5jg0V1/Lg2\nuxAA2tqwxuQ3GuAaj+WJJRbs4SM8+Fd3BvNaWS/pYaA7S4qaiQVuXsRqGADS\nMB2+A2aFezKyl6bT8YR2RBkLnPkfHehv353Mxfj9g333RwWLHE6PbZonBBnV\nk5akdxciHYr5V4IemKikAliO8Jm95F9p0q4QGBFYCyIBUxvzQ7IHp11A23rx\nsoy+456o+CL7aNflSQ2Q6++mgShvIp7OYEDFvEmoJaPsVdoiLvlKAOsKvYnt\nPp21HUGhGsQiS3YRf3WMsQJcD7QKGFiG3Eapv6hU5cTIVnS2kOjV888Jl2cd\nZcn/\r\n=WUEq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEXDkEK+xwn/1uFFrotwZYQNQDCgOhkwLwdeo15MUDgkAiEA61G0bwlMuYfe3Ny8s2lqU/edytAfgpzn9WnG6576mwE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kela2rem.0_1599044954991_0.4759145355255896"},"_hasShrinkwrap":false},"2.3.7-canary.kenou8nl.0":{"name":"typedconverter","version":"2.3.7-canary.kenou8nl.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kenou8nl.0+aa90073","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"aa90073420085a8f055370aeb09815c6083d8b86","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kenou8nl.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-hxKNEJAxaG2F9O6vupUjU1WLh7ATNpdTbLdtiXk16h2P0lYNrDbiCu0q/7Mquk19sAI+M7Gs2uVZxcCMv0tk9w==","shasum":"be6049445152254487b6ea10b116a6542ef68423","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kenou8nl.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUbaeCRA9TVsSAnZWagAAEYAP/AxSXtbOiF905s5wFE2y\nOaCyhzjKLUwzdtkk1EYv4S8hqu3o6NG1vB/IwsXGeDZb+x4N6iExJn+8+eGR\naUJ+NWRWGf14qbsswLHz0M98aeRhUn7yKMgNkLnud1Np+4XgZ192pDb53G2z\n17HQxSYL5/qj8C9AVB9JT4HNe9Ar6v363vbzmFX9UFrDfPU2I9rrO1npcYRW\nn2sUghzKh1DikZPnAz0SzOKe1iOjCZ8OrgQOKQ1hgz+t0mRgORkhTJXuiBO5\nDm233NodLFMjDHekrRZ6o5b6b5Q/BeofKAdaxqPLONO1zW786pHfQD2ZVjD1\nsqHOV6IcpEAbMIeX199eurqtQ0imB7PTYAu3PlXui36D/8sxrSwHV59aIUsf\nVgNEzq3WJ7jNdoDRlcqjIdkkTiQUhtpV1xWzNmNvVUSv5eJEB/q+trAEu6NN\niojv2GTS6OWlRDcMPVacvkVK2BqsddXyFtCZOk1sfcaZPC0nUHaRUnPXet2+\nopDgwrb+YBKSuqnbGInvU3UB+fiQB9qKctXv16eLalT7rBA1m/DtHySHBX82\n+0vPOivMDDagOTq1ZETYO2zsXXiuwEtWVYIR9YyTjmkfVPp+Vtw9/KWnNx7U\nuRvOynVNWTV0Z0LJfhaI++qgJN/oj0NqNUhxX20Qxngj95231mONPuqhqVVG\nm+wj\r\n=1g5Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDM41Trj+HpQDifaokJhvaNRFe44SlYPF5cI6z2xyimDAiBu/x6BtlW4Y5nyiYwtHUaG5bk3f3p+IhDO1GxoC3zSqw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kenou8nl.0_1599190686063_0.31037178628328776"},"_hasShrinkwrap":false},"2.3.7-canary.keoswy6l.0":{"name":"typedconverter","version":"2.3.7-canary.keoswy6l.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keoswy6l.0+99f1de1","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"99f1de1bc01750c4470f356ad5994ba5baddb6ff","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keoswy6l.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-IQDOVW4VKExJqOtWpQpSuBgmxUvZDeuIQeSiw0kYnU7SV6uWjQ9E87g8sYF/xbwl2JZ7aM2MQ88aZkxBNHdPaA==","shasum":"cef56b256d97b99941f7746dcb684bbfb18c86a8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keoswy6l.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUr2LCRA9TVsSAnZWagAA7XkP/3Gk0LGYYYqF/YLqsbUJ\nP0O49V/Y0R8Hj0qQHN5h3aGDq9m6zdnuzeKEUqm9qBHRsgXuwVbu5Ri0T/YB\nj7HxwDX9J0tExnUqDmkrKVrRsPF04PgSQBpOs322Cmm3AA7aBCf+hoa5QekO\n7nsjGD84RTjHqSH55c4mSMz+iJA0B1StFOP8eosXhOWx3gn1Y3irk/WJm4TB\npKvBEfzKAlubPLDWrexhwLeaSNFcQih+aHO+sMc5ETljvg2mrQj1kn7hS1JF\nY+DfIR2qTbvcrVmCIzpLuBwjRf/IESmWDXn0dFE212yALsD/WwfKM0GK/MIY\noxaiP0O09OJZ2mipmRv7unbZ0GZhx78IgzbGZi3u7R8TQ30ctoUHM7UaOO1L\nw4p8Ln6JgLtI35nNJ6dos9hqYsOe9cenqRCKPT53PzHHCotCQ/Rwx9XLg6TE\nbvC3LuuNSdF1VcA/uxSklbNLY8ej46HA75KurUcAbEAg+vM1kge9iBL1gtpe\ne0+Nh7J8uuKjxc2qSFrNxwGg3OUdQwYu52IkPginp9+sInsU+EcIrXt3L7tO\nH5qu5w9TIORMGiOZqvB+A/SwQXnCOYKxNrcHY27SxaIdJMD2+5K2VZdoZjOk\nnrQRQ80835bviqqjVYaHsi133vcFlWIFDU2EkWcT6OieeH7RXkPNcY7X1wBC\n43J3\r\n=oY3y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICH7tIB3YdNbbqsmQvY2KMt46FPjr3jjXb1U2cL40S/NAiEA4Qc22QK2R7yTqZWDVjjgydO6xNDd66p8E7L+tGxKLDE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keoswy6l.0_1599257995459_0.2207071469080184"},"_hasShrinkwrap":false},"2.3.7-canary.kepjwxp9.0":{"name":"typedconverter","version":"2.3.7-canary.kepjwxp9.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kepjwxp9.0+d3bb046","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d3bb046a67fa3eb0fe43976b1a2272f081293720","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kepjwxp9.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-tROCa+4KmiIGYVwogcM2PNirMt1dp89/lkpwzxHguOIz0k1VYBt8z9Htakjq7H9PjSIo9xdT3p/fVrlPYVyprA==","shasum":"2bad41b6add339f6e3c40bca294fdbc204c68c3d","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kepjwxp9.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfU26wCRA9TVsSAnZWagAAaZUP+wa57PzlVRxX5cQeEjql\nr3zzg02/Q1/6ljmrWekNRWXhAoaNxRkRYJQiA3U7V5yyIO7gBg6vjA+BE+ON\nvfh8l6W7DaZHJNur64Tzwx34jM/D26st/XtGN2aeZoQwT67PAxJeH7o6XWk6\niL5QI3YzH6LXU99v+GK/NHV/ekqxzuv1ogwaKnziz0UsR5eh/KjHVrwHD+cw\niQMIQEqI0A10y33NMFsYYIvCtHNuyFtWjHEHwzJzYri3X8a01Oc/EyqMsP3X\nSPOiYuvBl6sh+OWymCQLXNvMTMvDxWsAivgBDS59wRXflwCXFzxwt6fPxigc\na+4xtwyMAJYui5RTSM1Zgvxo/WdICHZ15kx03Kzt2MOOvG6hFzWEUQl5EYIk\nzP9SwHT7mpDIO/HyCmhZTDCCeQTLM6ovKAsOLCaEnwRGUCXq0dCwDlQKVsxu\nxjXgPEbOgyvrTQMjQtK6ZnjxeGV1FR9o9nDLvEfwKcU2TlcPskNFCTGblHsc\nzN+bWcFI9lW3XeykPh4h0+bvcFCUqnpCKN7NJOqUbyvD7XRd9y6abkGsUFyM\nU1pGahvzqoKo4J85r9xWTlkaeuBaXYb03X9pVi/iIqNK52KDvzGptzJkbt7U\nFVaU6T41sfmQknlFIOeFBvJYclxzGdQ1gJ10NXFcfUVGO3Eilw6mFy/eS1Vr\ndcEl\r\n=ol1G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKtmhiF9GEiwaOFlmep8VmoFgJjOIMDpyUj37iiIQMywIgcUXDqbrNscwsgxdYqIIVQX0vEXnCgKTnzV2H6arWkcE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kepjwxp9.0_1599303344093_0.30545356448572014"},"_hasShrinkwrap":false},"2.3.7-canary.keqn8ee3.0":{"name":"typedconverter","version":"2.3.7-canary.keqn8ee3.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keqn8ee3.0+5749a77","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5749a773d86fa866817a79390cc5e6972151a97a","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keqn8ee3.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-yI5sr+MxVc6YH5iYRD5EjmeRZywqRWF776ruFhqUdihvtmDSfIIX1CfySkNP+fIlmJHJxLB+/f15qnttiiUcSA==","shasum":"64f0fac316e84f998413a5ed4f735e2ebf806de1","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keqn8ee3.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVHCoCRA9TVsSAnZWagAAXcoP/3knvEFCpnEhEyn7ZAAH\nlPoU090LUgfw0EjD/Wy9R4fKOiwfQRsviq9jEAdPrQsyXRHpMyZSkZf7jnKF\nBMUWyXjx0A5NRIeqv+TL/mEQnDQ9hIN6scEfWj2ndgd+pE/Lw/zMLHO7cJaK\nOsyBn+jmnazgnU7XD5CdjiypD7wE6B/okSUmNI79ULtFsPh9sw8sjeRg4Scl\nISjOciRxKi5wlLTgAYYgeDL8xXjLt3So2Xe67kgE063NPbX7ubAGDYGYa9ci\nAzUl/0wnjnqyrtGcF9nGNp/5OZJ7lHId7Js+DMni3U4A1wqo6CPj+scvF9aI\n620h8AdflGbgQq7n3pfSYX9j/DVimcaUBjERHM74/wL4Hql2iWcIKfVWY847\nE7q1q6+vGVnybJBoV2AG4iEMYai07tSfoS5VZG96/o9Hyqw5Et0kZHsSY7Km\n5oOquQ3yAArLn/+oy4lkjpszpvEDmMGUextWixWqNGWMpgOZ4rYeMPt8CLs7\nl5M0WEKJJOdaUbBEi+0GkNEXDJCKD9lRJEyxcXU7VccqpGZqaa/3kVLzWFOR\nu4h9Ugy5G7jKjhmFRPzgrWvgzYl+24jsfArlmcgUfUN3/IOXqYKSpmqIAVbD\nZa2mqkc7xdDZB6930FDMkAVdbed7lRxoHGZI6yULZ1M5NRqRCRntoIzTS+gv\nX8Mr\r\n=brCB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDyK2hKGtzNr/0NGzDCYxi30QsXEem7HUMYebnQNpWU1AiBH5cFkO5AUbk/posutZnhx2i0etvjC/rt6jd3ds+IJQw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keqn8ee3.0_1599369384006_0.8716622314302167"},"_hasShrinkwrap":false},"2.3.7-canary.kerx6yap.0":{"name":"typedconverter","version":"2.3.7-canary.kerx6yap.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kerx6yap.0+dec0c5a","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"dec0c5a7ad06cd6f42cefb6799bacbed4cf97095","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kerx6yap.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-CRJcW7QiZNymbPUOZrUFWOLABOmBrTggbYj3dnxmRTLHEm7OiOuGdzSUxHhHgkwMq02Ptg01I1Nyn0ZLw9O+5w==","shasum":"23587e8ced354d0140061da4a46b5030665398c2","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kerx6yap.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVZ4zCRA9TVsSAnZWagAAz3QP/26kc+ws6aCeHPbwofjG\nhofs0/kC7oXBGHell8xr6JZYXY7c4Gw++5zxZ1f+UUkbLnxSLSp8JA7Ya09F\n/H87ZJUvpOkKwXYG83xQXKng7iDROnjRaIAWY1MyEdqY9hMRyY9wASNtechi\nF4jS7plfBd0dPZuMqtPvXFBr6d3HURfX5DU2UkuUBJRa5ToK1hfn1Q/Q3g18\ne+1N8T3Gj9GIluxwiCi89NmloLRW9I7j+BtDLRuvDblXSFAGjGt8A6a1qryN\npDVjIPz88S9XIgQvgw2aryuk2dxUK1MzrkraYCLdhjiKuiriacSrcEOHQa9N\nqull6/+mAc84OwtuzCHgjfQP2EgyZ/geNYM+j804RqI8hCKbR2nV7jeZK9+d\nudGicGAT3vpMrm5BkW/6hPRsySbluNJZmNSGpwADQLMTAE3WBfO7fQr2fygT\n8Tv9m/PSIRSyX39XVmZmRh8n+GzMP4sfgoB4nJVniCN1vgQ2bui09uJx7TwH\npMV12204P9aL1nU1SISagHa1ZSErEbT2LTXCGpX4H/YQCh1V7Oz8TG6pzl6U\ngV85bW7Fz01h4AJ5VBlOmJxAIVvVs8v+NqPGEckWuJKsqYJRHDZ5lCoiRPXo\nApmCmNiWdaTZKKmo03wfaPVw6oz4k+K3TMZ1igCq70mCfYbkQPDhoPRlRHII\n1zhd\r\n=gaXx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGd7QAFYU93KYmNnKJ4uTQESFng1DzNC2+HEO01C+anlAiBe+/RCN3dUD/VHy4t+cvT7K06wBC7TW2t34frQdMiO2A=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kerx6yap.0_1599446579261_0.6581762865342202"},"_hasShrinkwrap":false},"2.3.7-canary.key2i6eu.0":{"name":"typedconverter","version":"2.3.7-canary.key2i6eu.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.key2i6eu.0+81359dd","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"81359dd00f41443a1772929ce7b73e9ff85bae9a","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.key2i6eu.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-x3mrhVjWjqj6VGN3JOi2ThGnLjzLNKBeP0i5KT4axED8Rk3rT+Bq08flNPr5KpsGl9oSJxh1FhmiZETIag90Bg==","shasum":"d43c3e8beb7f782dc46a974546581fd63d909a6b","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.key2i6eu.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW0o8CRA9TVsSAnZWagAAYAQP/AzAgsxFfHc2d9uyCYYr\ngtfV18PnHzZ9DiNTjZlNdBn32R3BGY2dqpsE2PTFwaQo2otC3Z/WFpaQsh26\nkX8x1O98DoTdWZdZVmQuuQprBsWofjzoQxps4fcAgLdy6AnQkM6i6gX9vK2o\nE18VtYblTjZos1rv74Z8lAdlvo6zDSmvlZBy10OIj9yBagTNPuYJU/ZJJ3xc\nJwOrqneNm1iIDe9Hmj/KIUCepfvnC4TqrvEhH6rV6UPGPulg1y60oVWvmiwk\nZP8BPejHDhSPjtlVvXEe5cTR124nHOnCewkv3jbHHPWTKu7PtLcr0I03wq5c\n1IYvyoL2T0GjiBqnG/d32QpkK7B8G8tcvDoqfeDLrR4Ww8X0dcC9nJ7OP0oE\n8uQZTtKg0xD3nM3jmzgqNlKJ/HG19fOtMZGZSbgSYc4R1b8PTojlWZq3H7zL\noh1FIOrlPkk1Qah5m8GAFLepq8CL88fGe7SeJMtpzJ4jhGuYYu5fCxNt9ilt\n+0Z/EgdkE3A0qGomNlo4TWqtFPRuO0xEIMd1lm3oarTyP6SyESeIuRXO8YVN\nVijJDCbGqc8luafFqnNZxZrHK6rYrA8L5RXcZF2APdUESuczqTWoMtrbU0sZ\nARMbC271WJVqKpK9iTlUdlB2EJQoYUAC5Wvdm0Alr10UrQquhbeLB2W6XbFr\ny8xn\r\n=k2zG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoqWJ8TlKUD9YtydIRaVBnLwzihYu4Lfl4JVerQsW5iQIgfCK/AyZHoDeO22YeBO6b38jeQ+H9Ms8xKHQpFaA1g0w="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.key2i6eu.0_1599818299564_0.15120840160752613"},"_hasShrinkwrap":false},"2.3.7-canary.keyz518l.0":{"name":"typedconverter","version":"2.3.7-canary.keyz518l.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.keyz518l.0+a6712d2","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"a6712d2ff49cd1ce4893ae2e2e72ce386f4d7af0","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.keyz518l.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-eTBM6+SDb6KL8mGTUxGdMJu8C/7ue8l4JpAqBwIx3imSw8pM+QFiakKAl2/hDJdTtXoI7fGOewchgIGRarX52A==","shasum":"5735894dedeb141f15fdbfd8cc59cf5b700f2d95","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.keyz518l.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXCBZCRA9TVsSAnZWagAA1+gP/00TmphM4zREFHfpUedP\n8HvglZBgmn0YNNJdLelOgtd488WfSWqWt1wF4Q4RbOHCdqyq9SIFelu7Qpm4\nBYqtS9U3MEKvbp7gTS6L7a2peCVZyccN+R3fHXLouXAlpxHl26XWNgnjPyuY\noQQqmczyi1fHaot1Fc+nsoUHgRaeWdZo24l4T9AuT5mvf9DVdtsN4CUvMBzK\n7XRQNfSkU+Kps3WCf9L6JKTto36D9AzNv3LAq3isWv0iU2Z3MHzS+QLA0CMR\nFEAfyYjPegNvIB+IBFJUqDRsGjc+RQKMA4xi18rIsd54g8dnMzhISFSBnE7F\nTxm1kVHdjx6LOmCsuV7H/DaaoSuMlL+AiNTLdMtELaOWOTdTcM0cAJxpuN49\nD+cuStoAvwJzZmVCQrnIXAzHKS+pHuvH/e/1QFo978S3CDJFmkoJVyDWsP5D\nf979CdS0xyo4z94VH/+EnYgnsnQSUi23cfz/dR/nCggxrz5zGkbk1j69oeWm\nLcHKtLK7eu31dDCc8Z0QDN5q8JlLWTpLG05XtRqkK8Rq6wJny32+Tmoqkw9f\nZl35VelvkCKCYkQOOD7wJWy1Fn+ZEWsQvLb5WZpagzREeZLe9Z4Gqmw4toR9\nl+JHB1unA9/8M0e+YoND4pH4GEW8GC1UteUSen4OoNo3i/Sjh5gErTmJ4qf2\nqfyc\r\n=GB8D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGIfXgT6nEbtZalvdzICrOvbRGewgf/asuNYkCaPP2fgIhANzFXDYeUV/J5/P3CO4dS+1YxIJnx5d41gp/wfvMM+eC"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.keyz518l.0_1599873113210_0.45831873424960734"},"_hasShrinkwrap":false},"2.3.7-canary.kezbpkd4.0":{"name":"typedconverter","version":"2.3.7-canary.kezbpkd4.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kezbpkd4.0+e02e6c6","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"e02e6c64767a66656edd8fb13d9a687a9f757a0f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kezbpkd4.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-66Nrh3PZW+cViaKVe6/0VLXj7ljz0TmeGaX+2A8RPEWL0oFd2q9pmmIh7oYNn9claCs/FgFHeh2CLIvSf0uAtg==","shasum":"e8f19a567d7dad6269928b56cf191e721fbd92b6","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kezbpkd4.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXHLRCRA9TVsSAnZWagAA+ZIP/3w4oAu+Jl7E/GH4WMsy\n2oBwzKsD1bDFqO5OtevXx03nJIkjAN0bS6u76F8tHqQdOEa2Eyb3h9S6Wua5\no0qqZhi9hN/1pItewZhNWrnXuKvXqYX6tEnIkV8Eh0hMqmf2Hwg00a9t8idy\nGAsDV/wZrzafjd2y32Wmm6Qc4GD1bHzMXtkScpiHkccNEMggEbvsxTB4dPVK\n1/l5+HVfWrr8vsjRJ1E3yrL7ATZKp15iwgQDLrkhvxgCH2xZf0gYw+LSisXp\nFyfIdSjYY8Xwlifrem9yEFbCoTetbfDyDu1TbpjRTefz+BNcTNi18WF5NpMN\nWQMQEVvBXleQBCpJ5/dPQ5Mhj4Lbh8V2Uh8ol2IYRiVLfBf4pDflDfIIroeG\ndWBj+nK/LAjVxOmETB60KBGHhSLG3F3y4tiSnJwqTXrdUTuPYV4aTV3RSv3A\n6ATBIur2yc0yv4KHggX4C0sceaV5msslZZeT3LmS0lHHkdtARXvCLTW+PvwR\n0rxlW4Cw90yESphwSoVIXQMYPySf/5IA0Vqfo9p34ZpIfjydB9Rk7l0+c05R\nfE+AaPv24v6Z+qrteBdsDs6O0bSLsbqz4Ipo8o3I3WhhbVBToAahv1ZXz3Y/\nX5B4LcVtIOzH1QHcEa1ic198iEIb/mdPMSWTq/uCGlB6vn1Tl29c/deZjfPR\nUdl8\r\n=Z0G+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiWZZft9egQowgwty85hZWp7SSyn1y/qKMCCaOD9IkRAiA8vtPblmjV8A69C7Sqag0KXlIOw6DgQo8Lb/sxsR4Wtg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kezbpkd4.0_1599894225332_0.7158166232046974"},"_hasShrinkwrap":false},"2.3.7-canary.kezj7wpq.0":{"name":"typedconverter","version":"2.3.7-canary.kezj7wpq.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kezj7wpq.0+23eb464","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"23eb46463fa91516e3dc94383ad1076d56dc6cd5","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kezj7wpq.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-ykF49HLfW7y0YP5RbFBtBKv+HqfZmlhcgt4l0yWEWk0r3F2XGSkrzclecQ4wgp3x5XVzoclmHRaOAig8HYYf5A==","shasum":"336c5caba98d8af8aec855d7cf8dbbbf0bb32af0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kezj7wpq.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXKQXCRA9TVsSAnZWagAA81IP/RUWjQEMli/jSBTflQbM\naNRO5X52r73mfEP5Kmlkh9APtR693QUP5tBOmWf2/rl/IVYm2nZncaBSUlL1\nZrnYG94O7MZlV1gceNGDsoYn4sJgOUCT72tMdXVtuMn+uQNUdEebQLm//qrC\n4K8M8vpsAB1nbofuO6kVXuYlwqYzHecU+A8OcB2f3vRJFhx6XBEeM3OPeaAF\nWeA2F4JU2eRDGScX1CmpAJ/5TFHYcgM0wEKvbu692NghuipR9XZnZfhVxLW9\neRcX+0T44WbMtqC6NOus6vWyUNSjmMcH/JYQSW+LMXHc1gu4HUCz85sTQ+kd\nT8k2Bmun6n8QBf2g3dQHEP9WujW52mbyh1ihJl0l8/CTlYO8Twf0Fs5IIM0C\nVzMnG1ZwcrmYKNuYMnKXd9CzwTniycGIX+kngAvPHiz3OrVnN3+p8w1ETajW\nyUHxoYw13MgvvbR7tVkabWDYcY4YYEOrnuBG9QX5MopRAAuRjYylVyZAHvW1\nIP3alJEmigqF2jXtrC4XqRWwuZ699m+rURbUuB94dQK0XC0GCg0sedHGfZHB\nBuaU952Sz1GwE0lvi6Dxxagzo15tcsXCelG+fpE2INCfgiVfLZntLMQd/hQb\nSgeIJB5zuRPwcdgds6qTBC2A4p3P5q430NzBfbo4ptrKAg5gTk7jTzYbabDg\nw4Lk\r\n=t5u+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb60p3Cv1urOyR4F3KzYeQH/lxQ4r+iDs0prGG6XhllAIgPFBzUyAIYS4JooyRCshTQc9Cvhm2ujhmGf93oyvOU7w="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kezj7wpq.0_1599906838803_0.9663212405815542"},"_hasShrinkwrap":false},"2.3.7-canary.kf1ngfd8.0":{"name":"typedconverter","version":"2.3.7-canary.kf1ngfd8.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf1ngfd8.0+27fbaeb","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"27fbaeb8471fb1ea8009bb02a9248cd13416f58d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf1ngfd8.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-1FEd8sAuNXJsWTpKwuhMolPffxgcYjmWv/q5inuFfwvhKAXQEfvuiiRYTQik8bZb7MaT/YSGzPKnmhaXUKBVUA==","shasum":"7e54e5532e39ea8112fe0f64d4cc8af478adebde","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf1ngfd8.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfXphICRA9TVsSAnZWagAAo0gQAITHOXSeNynScPV14NvJ\nADuOH+uMBb+AN83kGA1/yeN+OJm9chnseHF1JTcRvymlIv9V6WhJrTVDJcv/\nlSKInP8jnY5F+TUdpPstMz3g9kY4GFVysD+OvBo1uSrFTGZ2uX11YJvmcsvq\nhbYwdX5IsbB5WtOFR1U4SWLJphNuXbgvMJcnMnVL9AERulqlCv9HOmQN/yc+\n9DTDZ0xeQLzDghA9imRSfYJ/iebC/qV5Dv90FdtdVYYNnpV94MPIm9EwQDlv\nGhbkIv+BeDYmidRHkAe2AbvdZdPxHxFfu6YpIKlgcdM6t696zw36lrMx+Zkl\n+acTFc1vYQLfy2DQ5GVXdsYvvjgEW7tRBx2NSDMkYhoHfR0LGuuqJkmnkVy4\nXZ4XrYus7sAZGwt+AqyvONeZswyIUp8HqFsrdn9OBb+Ng1fs9Qf6cOdr0Q5d\n/TSscURUu6zkDbyGVB4J7PeP9mXtLKU4IA8GzrdRiGeXG4aTmskdyByNtG3F\nKKoKs7MZavAGSUtWFbmDIjk/oc+EkolR0K8Ddk64Xw2Xmkx93tZgRkZhaVEz\n3XMo743WWXXYkkgTvMg+y+JgfgJ46FemjRsXdGYZ56ciknm5+4CJ+/Y/Opc/\nNTmGn5kB0+/a7aZYRXfeUo9KOiEzHdXBrEormlqdGRw9T6NQLuSEbkW4WB1x\nQTjp\r\n=LZbH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbZIn2jagv2NhVQ06qRiQt7C5urt7ztPwk0S+aXVaJHAiEA4IgBLVgFp7Hi0wHkANd9J+Mc/rEqrNUF8lbQx5jIk8Q="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf1ngfd8.0_1600034888340_0.637693199066123"},"_hasShrinkwrap":false},"2.3.7-canary.kf32nfdw.0":{"name":"typedconverter","version":"2.3.7-canary.kf32nfdw.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf32nfdw.0+cf3025d","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"cf3025d29ae34818da55dfafd81f4d1290aa8379","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf32nfdw.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-hkSwDliE0FohCohZNo39RtrsOlxC2vCMmxMxOAmNwhkkIe6iGpkphdZdP+YUQIhpClmuOoF4MwtXStpMWeeXEQ==","shasum":"0d28a1b4a632907de6de37e8c319dca8ca1bf96c","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf32nfdw.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfX+grCRA9TVsSAnZWagAAD2kP/i3LWpYJtSiIXP1yDC57\nkqGfvKxNlhfD/jvqmC8mRtZW4Y3LA09rBe7lN7nQ9UAXZqYtFgJYcPG8BjEu\nMZXNyaLHbGlDjnk7MC90V8jS9ad6IyRjHQ92MTj7uyXfwWoaLLxUf+1AwNnR\nEWmexc10JvCWtv1jGO6M0hfJa3Qdg/s0HMrN+3qd+mxylAXVHBrlLzMEwic5\nBCGiq7Byp8at5LwTcY/eaxYdmBq6i8HqqVE8CjqqiirdmLdu/HYk8VtybYww\n90VYYhpUj8TT3sNc4OMP/ZHoiEsQF0UPRy5YFRuuScO8Q/uAzQSEVQjVBQc6\nCvKVM9QDxTj7ORD2b7amiVl+YcZMxjwOestbSJA78bod/qbx6GQj3ApoLbU+\nTkdEDXswO7DTTcQIYQbrEoJDuQJnf4ODCD046+6KsDtx20EXoztTS4ghFm3K\nQDHOvIPhEUDMFdbBmODuZ7B7ySB3f2B0J6utxJFsi6ZtchMEriVeVbkFj5ZK\nK8vkBgfl0x2UisVbrOA+M4SsmWLm/FWh4dICVwDpMeidwKjcZTAP2igUMPhp\nVMuY0EEaMaC2z85tcWijZE0DWh8HaXIE5KBO6D9BU4mrLXbY/Zr6qUBCGjeH\nLeQxNeZ+vgMBlGBkn494ZAwkdLOgASmjjE8P3T37GSg4hdSKE/fJcpBX3kYS\nhjBu\r\n=FMQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfv5IjwPasTqElQnvDtgBWs5rP8PbhVs8YvkagVZXVeQIhAJolDhtXcL7wIh8YOnm7OpGfQFG08zRs9znXCsZP9uu2"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf32nfdw.0_1600120875136_0.8606605765435715"},"_hasShrinkwrap":false},"2.3.7-canary.kf3gt31v.0":{"name":"typedconverter","version":"2.3.7-canary.kf3gt31v.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf3gt31v.0+ec6bede","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"ec6bedea41b8078b31f16157ae1d909390979029","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf3gt31v.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-hhtMUnddYSndflw4OsWl4grTIk+t08henhWqwAkeIpMKqppzTzfBuKmdGTP9m0P0w23R/NfbGsp9bJC7MsjvAQ==","shasum":"986392e41d2f1e84c24bff96e13245ffe4108482","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf3gt31v.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYEUMCRA9TVsSAnZWagAATeIP/iIH2kvxcBDeZy+PokeP\nerGnLsrxwskE5JbhnMlNP2FdgKG3coUgfiTBVsXP81XujFCCrwRt26Vde2Ow\nmjkR27FYtRH3dI6gvTix70UJF+twAu/ISIAE1s/aKuNJio/UYCxe+/DGdgV0\nWSfOePUybDIqVU4vQ3V6KGEEdOsLcedatCyjMGOB386eUh8Queb0kqRt5S2Y\nALunRFRUgMPCZsbdCx4u1Y2gbk37HOjJq8+xr308iBVdt1MpCLUTcf4U90gQ\nQ6qnNa08W8DrkphyMcUghH9Fl+Z41TiYQSu4ZDntYEKVrFbnhUmOAPzWPzAS\namvAO0TTkrKpL4MYyjT2R/P4gMYuA0VbCqyjG6KRDGGsDiuwNF2Ue3lS8zkS\nB/46CjAxoNpMpDI8IuVYGimFTz6QQJFeHLEhC3BhIu84BT5GdFFOi0uI1rFH\nJUwuUky9cUzsoz0UNvNL7YdP4W+qyq0C861o3XWC2c/66DPFL2KJcxlHm959\nLUuxtcywunV9F5OaBN7SikzABDYDoQpokcOFmEec5W1TPudHLaFtzz1G6t0a\ncz3i96pJ/24oTpFgFvW6CgL3Ylr/R4GZYbNSqQhBdcX/m4fFT18jUcWV3zeo\nzz/7W7NE5m4Tg/9qlalRSYkuc8ufUFy7RyPHByPm6LLXpEFMsXhnX+TT+817\ngiKI\r\n=J8sj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFpVEmDb0i34/Diqm1zDkDkykk8oetlv71WbhygYWWrgIhAL2E66OGimYaGd1OYkwhYOkDUk0vlaaDo5XzULzhslS9"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf3gt31v.0_1600144652183_0.7851166213486553"},"_hasShrinkwrap":false},"2.3.7-canary.kf6gpx8m.0":{"name":"typedconverter","version":"2.3.7-canary.kf6gpx8m.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf6gpx8m.0+9bd4c79","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9bd4c79ae6c47ce2aafc2015d95a1cbb7e4b0ffd","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf6gpx8m.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-PUPitAc1RQvcHS0Xqzy+GvQeghFCWSmrgtGlNAsNhHulpblN2u1b7Ey8v0JgKPfjYfMSm9o+XagOKCZnOVUpxw==","shasum":"5cc14de3957e8fcbb40bab0523c0438da4ce6762","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf6gpx8m.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYwkSCRA9TVsSAnZWagAA9wkP+wSFB6FW2gLbroWASevG\neQwfUaXfAohUNFPTLvJeT3YnuEcYtHSL9LK2Msp4dwOb+xK/UqeGMi9yzD5T\n9fzsKgry8oUgJoo+bun/IL6I50srFvyKmfQQO4Z28udBg4Cbxx/MoHcYup0E\nK+ejaaPTpPpeF5qZUe3y3MC3CrAO2EzrAFZ4eoN+BIJpd2OEMHsyXS3qUL1E\nJZYHsE1xtQs3S5oTKqPBxh1evHCf+gKXWWuv5LJ/JXx3/lPg4Xhcxpfwj5rg\naziiB4l7EUyEYiWMOgll/9hBDI4d7vYdVDsnnkJRhTh93ouGG8XNWMODNpYD\n4qMpgvKIJ9geSPe2hQjfxoAAFWZn780fZ877E0R24CViz8bVHZ1cLP8elBrg\nGLP7/s2/8E5CSAjFYaBUwpbDlaV/MCvnrsyeZ5yPbOBYm3a0uRUYQ1l9X73N\nVc1IuAmLirlVIsKhhroGPV3KPl1pQrSEb1TAi6U7Zws2Ot6+Dtg/VncQo+BI\nyI3D3sW28CgvACRc60hO//qFYnnV2TStZ4Xvs8JOd4OctQWeYG7XCql1xmav\nMPChb+ODAWjkeiGOLReSXaJRbUmdQvdvOdqfhHcBW2W1fZ4O1Ejtdj10cRjF\nR5M0wsaQpcWaurdofbWPyrKc2u7/0TlHVUpdKaZVHbr7qm1rFzKupMYx/Uqa\ncaP/\r\n=qq23\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHNOo0Qz6zE4aSwS3ISmWyZat6Ck0VtQTfvIFoNm9ccgIgQvyWw58jwuI8d5DVNOUzwN3xCg03xvsXMw8MasY2ZVM="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf6gpx8m.0_1600325906368_0.04643165316298159"},"_hasShrinkwrap":false},"2.3.7-canary.kf6lwncy.0":{"name":"typedconverter","version":"2.3.7-canary.kf6lwncy.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf6lwncy.0+51fb238","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"51fb2384c3abffe1de4104e776e49400c8b287af","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf6lwncy.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-cpqwYECGavX6j462Qg9yVsnx9l396He/h6wSy2rIK+JngNMTjq+O1FFUzC18NbI6jxwTK3rOcsdWW9cBdlSEqA==","shasum":"6b3e11016a71f2915ce8ca5b07a53a9c19d9c156","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf6lwncy.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYysXCRA9TVsSAnZWagAA0qYP/3extJrk/vUbQeTa+sWL\nBN52ivIeoP/Zf2gtdI8nEgo5igy4vkEf/bx2m/gJacfTcmv7/Vd9dvRRbf/C\nKKVvujpUA44TuJK2biyxJA+ZQTyxja8rlcOVSuTXxMmCdmPIbtvxH1gDeomL\nYxhPiZtYYCMTtOdMNvPEKkrt9bntlYjBCaK2s2GzZLx8KQFWpItss8KA46MU\nY6rmL5gk/8vQ8zNmdZM8862b3sa7zDpd3MFh+tMHj9iJLTCWbAAhtyBI6wgI\nLFng0JSR8P/l/EOn0udvkOan6oByAFcpQdSChHExCzun0+zYceo7kwFmIddU\n2ah5cTFHXzDfiNxQMX1WLyOry8P6bNpq1IAkXNMWIeSC5ImDzJ/aGHCb6J7W\nlj5J4I1y4zw225Q/Iv46v3Dk+UoXa0ieQ7rPoIL69SCIPLrgMJMdcjvOTAJG\nKohEdRTPGaBEDNDSAPA4bQBD5rjKWQvhWuPNdxAXJ5SeQz8yqK7xkyWF1LtT\nz/AEA7XNuHfRD9cS1rdw4ZQTpYiOhm372w7Ipp5sTJTphDbFH1dQWKflxZfY\n1GjHFcBDQMcbJRN7qjVbEqwrQPHlvTAfA8YE2G3aT93RyCNNGSuwwG6TG8Q7\nikV2tYCz4B/45a//LmMTuKLJTQr061zb6azHMGjmlNAKgiWaQYFyrVhdyyEX\nnUoK\r\n=hBV/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQPP2213yP9IwwFA/4/u5oRPqaFMBTyGXLq3UxVU+u4wIhAP53v9BmP+5Sbtar7HCFJ/7Qcwo628My6m0EtrRYf5Lz"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf6lwncy.0_1600334615123_0.328218560684725"},"_hasShrinkwrap":false},"2.3.7-canary.kf6ox8zq.0":{"name":"typedconverter","version":"2.3.7-canary.kf6ox8zq.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf6ox8zq.0+9230abb","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9230abb52eb0a4000eadabc0160a513ac17f67ab","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf6ox8zq.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-7LWmzUU/cbSrXMKG/EQsxG8WJACfEmiT+sb6w34AyXASyQjT4UF8NchacZKsKQJDUQkss1q25Pa18+odBzo4vQ==","shasum":"1cb867470db213dbefa840ae4d66adb9c0c519b7","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf6ox8zq.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYz7jCRA9TVsSAnZWagAApV8QAKDs5+7bBR2wOhRVABjm\nuggozZSxQC3PcfLP0RJ4dRS1EXPpW/63iMdJqTyTmDnSHPmwUU221G0v7o2t\n0Ivk+o1oNP7ExdKRHAHrDtgYgPDdJwREp0+XNnlSoRpwHgaeEbVNAETb5hFt\nxAytBnG5PiRBePsnMUCXtoPJz9jsO9METEc0br/mASnhXnCLpS7TE69VRIFo\nqZOYyETX31xw1bidRnatGFO4lbnHo2YLVnNVLzfoK2C39KEWsdwPPhUECpeE\nhGjpdWBs8dqPvUNcismFctzzfoIEQryOkofzBGsBtf12HtkomPrl61gXgcbv\ntNfnQmjcnH8N5LRWjEYCUO3HxEsZp80APy+LkecjNsW6pxA+wMVvyFo3X2ZC\njwUyRaKmMO3GIo/jLQU6Bpz7PTC1KFXGcRSe0CHoltGd6VowXeWm9uOMNbRY\nSYpoMN0PCCsNIQuHLaMZUrMb1rv9Zgx74HtPXb/l9vyIpuLR5y0fxJjIKrFr\n3fTZOrZ9K046fRmCDI5xebNq6zv690oPPu38yGD58XLRFrI185spNH+nDZxk\nbf0xL1VxGU3+oHqODvyAqAToSR8AVt2g8HVaWIu+fexmNEHwEnnkOP/K8Dhf\nFCA+v/dyIYYNgk8JrHD1MAAkcFfoaDP4BJ4GVhLsK0O7FsRQqC0A5LWXIJAF\n7Fj5\r\n=QrZY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJd3ilUumlobSM4PXynFIoMGqpIs3VSrjaVQ3xkVp87wIhAJ79nZTCSXjHKoLAE39T/m6QrrtoINEy7umVsjtEHt20"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf6ox8zq.0_1600339683237_0.4096927245842512"},"_hasShrinkwrap":false},"2.3.7-canary.kf83flsl.0":{"name":"typedconverter","version":"2.3.7-canary.kf83flsl.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf83flsl.0+07c2c89","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"07c2c89cbb0cd55577359e45a3d3aad20eec1827","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf83flsl.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-Bv9e7kDrAx2qxUztDWStuFu0919Ijdy41m8DkIZkdLVMp5dCYCraSHnMBxAnn2/bl3uW5Vehlu4TkKFpnLA9+g==","shasum":"5e39a61230d6e3d0881be8ce3bb1a2bc735ba3e8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf83flsl.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZIpICRA9TVsSAnZWagAAFBcP/RrC7/NZW6N6h3fb53kh\n6Fc7waPp5CVBScm8OOJ/DaPxjW9Gh/iDLBeH0qQqSf9p7uK6BXY+R7SwkBR3\n/DAm52fT8gEW9QLcLPq1uH2LuLGhlg3n51pL46VVnnsjbWkaWV59nv83R5Fu\nWPIKCvJC48H9aTNm43WMxCH2kf0CyQEz/xfgLD7aTK2kUQ5QYQwqZ+iWauIf\nr/22fJjYlqsjlq7c+XTFz1KETjv1q3IZaNcAooJXc19rrrUlLKI19fJE/wTh\nWj81HvuVM/qBcA2vrxwWhU+sGdEa3p9FgMHdujKtw/Z1aUypJqv2ZfZNzIyL\nbkuWbsnHDLe0/7ydq8Inj2KoFedwWVO9v9Qd0jD6jKfAjhu8z7tKJPiZ1wW4\nfxqM3JsgtX5KSqU36NoR6kxrencAhxSZTs9TrrV0hLe6NeJHXCnJcF7cI2Yu\ni1zBEtzWGqzT1qO7eFqVckpc2fx3EpeKDOUBjiM0GN+rjOm+XDh6ucc3BRrE\neTzm+RwrAa1+cbY8ClvTf7jEOCJ1UPDKoCmaMA8yptql0NAKHpMVVUhKkSC2\nvm8r4OmSWXlsR4oJUcqZMm68g2MKAbxuC206jBh4R/5Yig63ax5ynXgMpJ6r\nWPKkA9RJinddf0ZSrgI6BNwq3rVZSMhs2RWbFMrX3FdaEgxQ5dVjO02mhZea\n7B8M\r\n=UUX6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzevAJhKuj9DpR3XmLPohMu5YEND6ytiC3klnw4lgPtwIgflaisBkJGsVbvl8wSxSPRQSsQUhPCOg/pf6x/ewnA1w="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf83flsl.0_1600424520207_0.39854892931702923"},"_hasShrinkwrap":false},"2.3.7-canary.kf8yuiqx.0":{"name":"typedconverter","version":"2.3.7-canary.kf8yuiqx.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf8yuiqx.0+01dd8c0","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"01dd8c01eb466efcfa3cc3db5b8ccfbd863c947b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf8yuiqx.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-ODLQ5oR6OsuthWmw2TjpzuOQTO49YFa5czUjc8ZI4tKU8Fe8RoUott3u35D2KuLAyHMygorMhEAWAOgCXNUFiw==","shasum":"c651303f0b0c68e1ac5dcebe8042efc9f08f1be8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf8yuiqx.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZVhjCRA9TVsSAnZWagAAtqoP/R+Zpdb9jbzy2XfqZdmm\ne7yS/BqRbotko3KhBkt4a0fTPassKq4oAlZ0kqs4lYzSXTsQEyBywdGXUO/k\njveAwk1nZFTHjD2rMdHgUIr7JM3ixtuQ6cDBkkO3Yb8McmPZKW7mWWBnQcL+\n/i1xyR/vOdTKFSW15NIP6/8kAom2j6FjxrhQFipySRGdbuQKCq92eE7kLixQ\nE7GodG8jpG8X9aNxmI2Q3RVI4ziNHBI3K/n3fBMR7v77ipZskNgJtzu9AUNq\n3SYDc/FpG5VYVrSFNvoH8XqMVl5LXDm13Jb+OR7XK7iLM0jCvOE90t1OJSnP\nkB7ucoirFeX0/V7oDcMtRh9Vtis90+B4dIcbD2EV8DQe74CbQpaVHRorMWsH\neNPUW/ubfnN6t3zdfp1mr5u+OeTNftWjeSIFTC927SxYds18o7PHVl9DszSK\n9kMpviSA7QeA20HOQ8P5BcO2kTdg0/iqMoTmu5ldpqAcUIK+TzDY6pQM4Xvx\nIoK1/GV+LsKnqeSTP6D+o12K0A6y5/p6YBYu8IezD9MikTgl716Puta80N6V\nAMUoOjhM+cZUHkdawBY3HkcGX3bqeNaGEGbdMd4AkGudgaz5CHImWGjT2A5C\nEbMj5GSBvRvmSIFiQ2nvacIQuEa5qviAbSpGB+A0gUitStSO3L5xVQqtm4qJ\nvCVE\r\n=fdMx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtLRk3537m0WnHgyENVieVfctNb6lAzha+zV0PFDuwUAIhAOwd0OPjYEu91Jj/IFoaG8rb6oDs9eFZ6r+Iog+EtDiE"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf8yuiqx.0_1600477283253_0.6191448467239977"},"_hasShrinkwrap":false},"2.3.7-canary.kf9he5u8.0":{"name":"typedconverter","version":"2.3.7-canary.kf9he5u8.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kf9he5u8.0+c84a00f","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"c84a00f979910fffc06931b2d5c54917f302742f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kf9he5u8.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-ylLXyp2ENSdVB/c9thiFDJs1rGSJs2s0EMj+rnLhtoI9gj9TOF4wqb46VCd9/d4kYCjjiB3+a43wnP3DYrbe5Q==","shasum":"2cf1e619ea6ffee36e2178a91c60c8ca4a1127c7","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kf9he5u8.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZdIRCRA9TVsSAnZWagAAe7wP/iFGttM3MIQ7ZaujijqZ\nEo7yuHI/TOLZnN7jBZ1SviQbQ3XOUD//h5XV/Lgv4iewYokYjapzSX9/345p\nANFcgL+DDK86Iyd+N1d199w+aoiBe7Z4TXKiOlwXBzzXHWs6YNRrMQmVtxtJ\n8lVzOLMwThi0TLVhHGAVVzo7m4Q23n3l1K59ZCgBuj2YfNX2gszMoe2DplPA\nYti3DLDfLi5P2OS7NKTnzLWR4gMWdomTNrJFCp8NRM0uWNzrsPgPkFk8z17k\nhjfsvvRWDcgsmaHXFpvqx5qUb6lzYsqTIPj/WfRZ/s+IQqFleUpNASV2J03n\ndPwGGimhL5QhBhem0W72+bxoUS4bQtGfnSL1XUwaTyK/K2gHj/5z/BfabPQT\nueHUhZLfevHJ8h4LJ/C03DKtH7LclsXiRHppn4CMfYBL1/Sp0w19+6lygx5M\nQPZyFFVTV1ktUy3KAUSJh4824rznkPgei+VT3pb4XRJiLtdRMdkmaCnbGyEK\nl+7nEo/3j9mRTMVo9+jLCdbNsK9T+LFnXjze5bgFmrIXNhwT/f+CUlw0Z/kD\nnU/QTKr96x4S/qwLC83edLpcDBC78Mkds3juOJhXBrPXhd/tYm8jqg3oZRQ2\nzRu7AllrCbukKZCAPNUkxA7uU5Etu1QsA9z/A9deKMn+C/wgShc8SUpN/AEU\nkkR3\r\n=KAwu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLKFqDcDL6erMe1SR64hGPzLzMYt3zTNEWt379Sq2x6QIgWLyQ0MUpfQrbyYCq+r3l0MjqB/d/Vkb50A4ho6YBMdk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kf9he5u8.0_1600508432603_0.4436099997334142"},"_hasShrinkwrap":false},"2.3.7-canary.kfdk5pvu.0":{"name":"typedconverter","version":"2.3.7-canary.kfdk5pvu.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfdk5pvu.0+aafe89d","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"aafe89d8a496ae6c09c5d950645b9cc3bf05b8fb","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfdk5pvu.0","_nodeVersion":"12.18.3","_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (linux)","dist":{"integrity":"sha512-EHt54G5l/FWGLiesFp+a2ua6cbpf7I1EnaWpHEnpnznaBeNph0g7F3k60wo18HnpITB7CuJqtKiB5TQ9nLV93w==","shasum":"6c0f93322412cb3f1754569dedccc414f7e1bff9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfdk5pvu.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaZT/CRA9TVsSAnZWagAAQysQAIW9tMYeWRQlgUuorcyb\nawC/AKSjVKzgzIoc5kQnG5FyFUon0zPsOQ5VZ45P3oay25ybcw4P/4Aoea9V\nga/a68FlH7XWoxVORzlrsNTW290REbXZ17MMzI5TR//PZfUDu0tlsWxZtwpy\nnMf975QHERDMvx9JgcYewcXkhWYOCgnCGRDGgbvwWVlwDPUgTsW4V1133on2\nt4OWMV8YsTt6TliizR1T/MvKeW01/5zLCHMK9fXo3vnztau/eR4af1nremho\ngh4EJwKQansAnxzmRxi0vsRIuCF1PpVwZhDmWjP6RdPv90CGFDkiNPMqRTEp\n8A78kr7O06yn4hT60Eeixe5TTuN6bK8HihTJ6NwMQ1fIR5mo7Kw76zMNOtDL\noOjUape09AJhT4sNJe7wf8UJ6Nj7gQmyKYO9TugWqm7cQwdFw6tWy2/mco/R\n2ezELvji2apCVLY+qYNX4RMo/tO0HHRK1TAK+3NSyIvXOgE1DPQP3ovQ2+iU\neGu2/cIXFOLKuZEdwJDu0TQSvqXmDOfVUhO0Ku0l01BdRPuSfjldSkZzUP7M\n+/7xR6sxOKoV01OQ0IkqzBa7fIhkcRSArdeUyjwgq1Ncy+B9CyoOKcTMp5Ex\nDXrvK/9YK67D9VhpCtxDxHsCwdCrpL9eK4EcqhkS3WNKKHG843fAMFLE7/ZO\nI65N\r\n=NuS5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEE81divCXbyRzdEpE5vtS99SwU6zwDbFEs1uaip/7RqAiBaB9kP2PHjYiIr76zWPJ9pgsORNP3jnopBNqJjr43SLg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfdk5pvu.0_1600754942770_0.7694197002839447"},"_hasShrinkwrap":false},"2.3.7-canary.kfg7x8ie.0":{"name":"typedconverter","version":"2.3.7-canary.kfg7x8ie.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfg7x8ie.0+4f8af9b","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4f8af9b20b3a850cd7aa7e8453faa7519978e1bc","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfg7x8ie.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-ho71Np0OExA4jgskBcpiQHzj5wib2fFABo/9gqOTTcHFPz6cHI/6rUR4gDiDTPEmSUrdSHULR9XcvhXPMYzemQ==","shasum":"a7993825ba5d8fe9760ebed3f1d0fc72489da7c4","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfg7x8ie.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbAlOCRA9TVsSAnZWagAAcw8P/1KHnZ7q0iL5FG4RBMQr\ndH52ChWZMRFhaymrc4USTCBox3mLoDSb2iek6ZqANiX9hu3wPFNDyWmnQPtc\nn1wVtTuwYu4qfAH879ugnYg34fh5VSi0EZ9dGXDVN99UCFvdND/eHYif7Kf/\nC+oRMxzNTL5KGT3E2PK/TlZxzIi3ffOdGt7liFJZ5AsiDAaXgZJ2o+pmejet\nlV3twfVDGedyk45XI4kBWmnunWv4eoOLxGKuy2eQ87j58h1RY+vjExBjpR1X\nqyW+FcxZChTf9gCUTV1BvZRLQUVKjqo0IuS3B1d1zkPbnNJAHDrbcYH4WzAG\nz2R7TLpnom/mOMOWTsNf/zfSI3n1O9hT72on25LH2az8sYtYPh87vlr8cwt7\n+tuFZ5maRUKtlU0qGlsBvb6br32ZxI1j1qAdYQkcZx9qZUJuc7R+OQZTQQbE\nBvBJwbFKUbweDvNKujsP0bs2ZjBYjzhATTg8gmPwbIlsWkj/KNlYIyhu5nJI\nzjRsRew8P2+hPbuQVyuk89hqRTv2UaFChHQ6dp2E/wy3LXh74YjCnsx+s+fc\nqcABlyOb6KA4mEfcNzf/ldqlZRfWeqPPFfVcwXKmhPHgq9jswMSIOjXwUQLD\nHcz6EuGZwdWg7MVEjctdcIL3O8//1fG0/kwHg926hLQnmO7XoQlMYlbEA6c/\nPwlR\r\n=rf4B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1aJk3lxklGbtoHnixv4dKptJ0CtaVO9a+vzHsuenZvAiEAjAYxyBaSnxTQxm4nt8xgL4RBGoX0dZ9kWEkGn2cHr74="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfg7x8ie.0_1600915789599_0.03134916471857241"},"_hasShrinkwrap":false},"2.3.7-canary.kfku9xyl.0":{"name":"typedconverter","version":"2.3.7-canary.kfku9xyl.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfku9xyl.0+4a1b1e8","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4a1b1e8599873b1f24c7f30ef0efb9e5d2294afc","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfku9xyl.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-9UwlvcQFh/9KYgyuw5XIHl3jSx+LXG0jWq/C2+yLiOMBr/UmdLxuqW29bIgTujnNL/U8A0o5D2RXTDInJXLdzQ==","shasum":"dbc7e55d43f225ab7a45db9750fbe60fbe3b0fb2","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfku9xyl.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcEzDCRA9TVsSAnZWagAAgzIP/jIQ17z3dE91G+mwXLz0\nk89wFo2pjDG39Ch9VOM2NsOxCHdVORzJYbbC7C4kgT/wezdL4c+yAgUM0HxT\nkzslwEX3IsTl8zVDilUhZizTDxAPyEWplmGLqpDadKTaeV7/GMubzicH7fCW\nFfOV8c1QRQN85jsNClxwR3ZjIBIVoG0qyRmkblklamlDPAH+pBDYX8Jke6zK\ndKXBYwnelPY0E37Mr0wex74z0x9aWBMU3hSFfgU6ATiLwafvG/y0jZnmmRSp\nT3E2JnhF4iN2lz+JDcoLdZvCe3B55R55mwUXnM0SeCl/6f1BdMqbt6Bjgw/P\nBqLJB9O20qZ7NkmdUSI1lzIKhbJk3h4AIbAxfk4BP4VHPbRTAD6Bo8mCsCAF\nQTzdfElnZ3mWuxma39/0BoXDO0HkbNrghoipzQNZSeb1mGWdtd32KvMvW8pK\n+fsHLJoVFNsAlbaD48SPS8gzQyVDX81WDPCbmWCZZt61bcrxgoYPI67yhUB8\nm48HrxXPgPdmxjnzdGf3dCy9JYtjL3RqUBkzusGakfM8uJPdlQNJXYuWaYJD\nNj5xGoJE/YbivpzLVu7my6DncXXHbLlmgxLJ59TyB/2twLsghor9DVocr3fO\nUZCNxjRSPTrEWoy1AFFJLRlluIXTFNbJxXX5/QNZzLw3GTgP/M6/FhbTzHVr\nHhWO\r\n=jCra\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwCoV/4Gduksox2+4/pniEKcLw5RZ8q7+mXAWALl9inAIgdl6sutYDU3zHkuKfQdiCfF9adDxUCgSuGUzOtRYZJm8="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfku9xyl.0_1601195202932_0.5928622872691718"},"_hasShrinkwrap":false},"2.3.7-canary.kflwpa3o.0":{"name":"typedconverter","version":"2.3.7-canary.kflwpa3o.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kflwpa3o.0+4a9a5d3","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4a9a5d33f35a426f2e44c0f2b1dc2006bc61b0dd","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kflwpa3o.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-PS2BBxVmc7utgwXIPmwjkm8+x4JZqMhQr0RMEzxu8gAB3m1hjM67tUfLJ/vimYqOOzebXK2KyhyXzLyX7W5ANQ==","shasum":"47ae94c12f62a666c0550518eac19ea37f48554d","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kflwpa3o.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcUjcCRA9TVsSAnZWagAAkpQP/jYbdLHCxmZ2nUmIczeH\nXw/is0CTp9r6BmgQMZdruYt3QTZwpVOKDA0rpOSlb3NLgmiWuccF2TuuhL8Z\n/rrtNHUE0fjcfwSxkJFbuZpKENoYB8kSmYfs3r3Hlp2ysppXObp5ob97/iha\nDbg9tYftRTMv3uyR6iiOEjgfZMDdjqrlEjwgD2bFZ9q/zbPX5V2hpBxSKs2X\nCZ4hDNhb7Nyr0Ox8TBzksyTVC2JbKirdtnU5hoqM6uQ0u49q87WbIiUdDL30\nGFOBSw2wFIddtp32ZHKMCwT1hSMgK6AH3UUdRZT+rTty3FytFhpLZpijGdD8\nTGeLhwxPpCyZEkzDBNffGsoFX5KAyH7LhjIbL/5oGNHXNi6/BTvsopH0NpWn\nOZe2XxDoXF10OXtxDJ50h1iC10Pgqa+Z6+dkv2XwZ70iiSS0pKWiuzpRfggs\nG86fx9PqK7ioqKdTD5TlvBBAPRmiDrxnQ/PM4Q3ez8udRqx20ledSwsMCtOu\np7kqMaudxn+Gys44Rz2KS4XfB8GLM1YW4ErVn5dyN5cy6Q+bqVp6bCGzPaXL\nvi4gvugRp0bCegANuSFUQQRoOOXLXKEOSFVJoTmPDID6MgG3va+bMs1FOtb8\noQj0sEtLTE2Y4fSdMYQno4h07qw7z2sHySA/yQnP+SYzVkQMJWsqV9u8qSDK\npU+c\r\n=H9WG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBUmeZgCupHXhAnx2lfbKbykONviCFBIcvN/lG1R5DHQIhAIKXyDMUVxcf7/BNsn0XlK9AexU8eBvTxAIVT/fhWlma"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kflwpa3o.0_1601259740160_0.39576430874704815"},"_hasShrinkwrap":false},"2.3.7-canary.kfm9pqez.0":{"name":"typedconverter","version":"2.3.7-canary.kfm9pqez.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfm9pqez.0+6767528","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"6767528b01ef9de421b5390049cd0b3125f812cb","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfm9pqez.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-g5AlY0lcKgNxpVT+MhzzZFd0vZKTMbAI9styslkw90WAupQwxfzY3fOLAJN/W1ndYL3Hilhhv6sTw6b0V67gUw==","shasum":"c5463d838c926dc6bdb8c2321d5f735ba1c16aef","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfm9pqez.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcZ48CRA9TVsSAnZWagAAXpQQAJa9T5K2O8G8qxEJFrKJ\neTx0yIiK7X2yYrB3UYbCsCcD4OHesOpEnXi81LOFcsJudibwtaRIZa3aofgz\nCkzOPfYOShzGu+ElPZEIph8bKbwq7qXAsuhjmK14ChwiGdwpaYYxNc89oCE/\nOHu9w/UbNiTlvoakVOnvo0MTq9BPqrLtz+Yy9BtSJRIQcTu1V3fIpOOODJVV\nf63Lfh9n/zrFElK37Fh9Oe4P+KYDrLe33uR8t+ezr1/UmjsUNV+4ryouVKlN\nEwGiZG7KicsERPeFNFWeLvyArIWt4qamt8K+xL1t1pkSARSzi+SbAafBohfa\nn7iCjhvyj2r0KThouO3dupLHz1Ke6HCFDGXS6Jj0ovn2uGEh6JNODk/A9nFt\ni/c6pvNAPcI05B7yAIu/XrXAjQhgynrHc7OUNsSagXoZF1RfsXhYd5cmfEQP\nAmd4NmTSNyS9SoSc63ZyOpjyx2EIe1BHTuGAQVjtWP962136AlMDqFMPfmsB\n3NkK97WAIkwKILJhHViDcSMTYd7FzjNYIY0bdVyEEtrZs6qaoAYnjsVt2lPJ\nS2arM+SNXotVhOk6ci68as/gTVG55c2jajeHCiR2nqf9PU7HKy2S1S+r7KJE\nxQDbXJkzcghk3VAfNmZex90rg/td5z4KOk7j2A7l5vEtjiqFZ21cPWSIqpZF\nlul3\r\n=eSkh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBb5rUgvL9RlFYxCizyVBnR+qQUgBLPDqTS7tio/kODuAiEAvdwwBuaGGSM8Hqxwf/qcsf/HhjUgL4pv9kxQjeM/Dsc="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfm9pqez.0_1601281596029_0.8148134675851046"},"_hasShrinkwrap":false},"2.3.7-canary.kfnbyb01.0":{"name":"typedconverter","version":"2.3.7-canary.kfnbyb01.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfnbyb01.0+f902a9d","tslib":"^2.0.1","validator":"^13.1.1"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.4","@types/jest":"^26.0.13","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.3.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"f902a9d0f305d5ab3569f38d5f5c9ee05cf29da1","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfnbyb01.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-X7mnAP/A87omPkUh0mRuyq6NkOtiCoNgN2+fv+ey/rznQAS+lHMwVG+vnk/0Pp/3Caj12amqURrfbSvRjK6CiA==","shasum":"9fb2bb8a833a67ffe03bb2adfb2024a4e1ed9bc6","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfnbyb01.0.tgz","fileCount":26,"unpackedSize":45343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcpkeCRA9TVsSAnZWagAAOYIP/2S2Z5VDA+JZjXuQNVHX\nXKzq95SRVl3fJcFxbrpqFznqho/AA+a+FJElJJzanXDpQT+uv0RN7dWoCCew\nDaPAevKdnrja4UkYhCGxb2SbqSSPWX4szVUc253OT3GQGZpAeMMOXT03dtYm\nBZIP/R/sWHyEX9wBnO2exuk9ZpnZ0m9LwMEC99lxD+SgDCPSqn2xx02JJHvT\n3vlA/i+lnL5ZCG183zMpvW6ZH+aCarRHbrdu38JY3TdwF2Z9w7Jkmd1hZHZl\nU+uMISlVp4kdADP+FcYOamKMEcMvtmldaVgGffzQVVdDe4m0ftvo56UxVhZt\nKFp3GAJldRPnC0GNpYYYOnR579gUXZyuNV//+k3/V/wWj12YMH5tURbHYRt2\nGsalkMwS6GQbav8DzOvUsdh2GipogJo6zrS9ZhfklCFILPk6ZQ/Fxq0P5Ll9\nv6gqj9j8S4q3gupIDUQFKOSFb1v2QcZblyrZc/SIu8lLiBsZlqi2wUQHDRHL\nlEzz54ymr7nYi4TqFo1sguGSOPaT0t69KtGn8ScmzhDpv/wIdgCt8r2JqN0o\nlsuPUdPbP9NpW8ePJ50NMqO4CkQOJ7NymERlr0hMMorOF9P4M5nMVNhtle3l\nCVRN/yDTLMQ/KK/XyFEkXYn4jHE3lw3dKKaq0N/+0yBW5eHJYEGnkWQzxBja\nNpvE\r\n=+iya\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHefQhcfUOHHMLlJ6wxd2wrdbl50q9jH6dG6NWWNtV+cAiAOJSXFN7ZEH/kSXizdxa7YmYxygRbTxY7hD5ENybsqWw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfnbyb01.0_1601345821953_0.391925947764616"},"_hasShrinkwrap":false},"2.3.7-canary.kfndaw7c.0":{"name":"typedconverter","version":"2.3.7-canary.kfndaw7c.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfndaw7c.0+28c72a5","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"28c72a5feda16a8eb65a3a7416b03e28ca95db8d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfndaw7c.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-/ZwPcr2SOJjZ8P3Volb04kOuCD+M5IJa6hi7DbZnZTcwUasn0OLaca9pVsfsCyFy31rqB0AtxwBGOCxfDLE2RA==","shasum":"da979085304f47109eddc0b1aea00e0ad8974e72","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfndaw7c.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcqH6CRA9TVsSAnZWagAAnf8P/00f7CFAI4Jrk1uvI77I\n+8FhNGxql1t78k6hQAnLSikayiWUjBFVbZc+AV5JX/7nPdnNAvNi3swbHPKE\nM4HR9Xue+mZwEf8idKlfBbq5Wld+7+6sFMJaIskfLVf8Qb+mbY8Tg5Z16ov4\n1L3ZS5x2o2MfpptxG2v293v6y1tqsXm83ehWRFDVXENXFba2Ee9dz4LAmeo0\nUUNzRJut8/57qY306k1JfOkRq7wB78gYcIlihCZlU5nF+Kn0lr2F1hCp7jO1\ntyLUZyTGM6BZXacarV0sh1J1iGFwiiKCGhQSWSF9+o+RqYVI+4z9XUAQ0Rn/\ngFrJNP0yLWEDnadlUj2mUXCq6nruavqg4nWrwF2GqgvoE7q5rkhsrq15oFIe\naYxYNSmeR/i0zBBjtC90caagbzdGHq4Sr9pRk59sz9OGFljD5nL0vsfRsA3k\nJ23XUm/NJGMkaI9mU/RdZ9qBZYd59CWtJH/grBzbTWOT47eQOhuDYB4Q3G5L\nWuQwOX9BDBK8yo1BtZlgEXrlrja2pK95M0JzCFqgqud9i9SUYxVXyOSL6fLM\nwzyPtDbb7drpf3SDoXUBP9GaD5K+v1kraSGI94ERrkaWf/OmLQcES6GGBHnB\neIOSeUmc+KAXlCrAXR+BJWTmkybVF08/bDZOXgevSxFodZmZP/yq/Izw3CBG\nQUGO\r\n=ZO6S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvYu4RDLKxT+bI8KQfIrX49iNle/V2W2bRDKklqR3VAAiEAq/Li11Im3UP9kTAe4HW805LsjD6X6smRXMkmbxqLZRI="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfndaw7c.0_1601348089825_0.5925253396175605"},"_hasShrinkwrap":false},"2.3.7-canary.kfok0ubn.0":{"name":"typedconverter","version":"2.3.7-canary.kfok0ubn.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kfok0ubn.0+3dc7032","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"3dc703277c8514fd632501716b20cef2b2db67e9","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kfok0ubn.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-257ZcgeHY0/aSauDn86CYCUKvqNUXN1DdeDRQiO3Ed3mWAPaAcEvm+rIFpn6z4BLIn/feo/fL8hqcifKSHOkjQ==","shasum":"585f0598a8e8b1a52596eaaba4f83eee95a05163","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kfok0ubn.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc7pDCRA9TVsSAnZWagAAX1IP/3xagZ+42wq+036Entbh\nq7sOjvN38GF4O5TqQx5Dn569Yr9L9ncKoxJLT10dUTzLgQr4wBQAz0XCetk6\n2DRzRQUvudbHFPe4/OuGoziCv/Vt9xuacgsUEqmXGup/yCgkiezeVjH5ipWI\n0HhA9LtLH0O0PplCsWj0JMOmLNT+uku+PmOyx0BNKDYenuhP5Sw4Tke35tZ4\nQIK4RUofmAxwBaLA6dcS8koDoQ0SmMMsV/BSPBe0dnJHb/t0aNRumM0b7qcF\nHPbzdwXf7vI1VCbkbvbSOb+K2s1wdTVRmEXa0fLekfkfdXyDQqvJIc6pBwmo\nwB+j3Ua7TLGRvJtxos9pOMiErTY2RE6q1oNB9IHOg42MKiHRll7SfFsiBWR6\nmvhQiyLkp+7nRiJR2xB0Ta46nw8laqVC7R5qdjV3DHsinP3BihBEG1jTrxK2\ntH5+oOixgbyqOcT5oh9schdOdnyYksdJlmWiITAf9W25IVsLHiVZ5k2kO6wl\nq6ovwI1LWgKJhDCoq1CNS9QmC9LkiWFPeNsULr2gSWPUNsBhAGEUbJw15t13\nZaHjcv0VmE9B//7HKOof4svwxs0ZZWWdTH0evJqJPFf6h/cDRAaHmGmIA4Lk\nICVCYPKiSNUuFl411ZlIRovRMBPjABIGXYD7hNNz0Q3J7nemJw8ZGiZJ4eUS\ni5CN\r\n=sCPg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClYwMoluOMD3tHL77m0iNGJl8Md3S/TU/asTHI+J0tvAIgQhgBfFN5vjOmQZhoiia6wt6rRl82Tn8iWNEahm4savE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kfok0ubn.0_1601419843123_0.7655427782647299"},"_hasShrinkwrap":false},"2.3.7-canary.kg3h9ub9.0":{"name":"typedconverter","version":"2.3.7-canary.kg3h9ub9.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg3h9ub9.0+157a87c","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"157a87cf9a09d2ddaa868ac63256f3b7fe9cc82e","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg3h9ub9.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-trais1HDoHXhm5Bnjsekj/Kek/1nMyPQLCfnGKSNvDfpZks4ZhW/TFTYyAoxZu946omL/a8y+Bon9bUG2S+ORg==","shasum":"dfb52bbc565cdab56423343e595ae2d2b589282d","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg3h9ub9.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgX8pCRA9TVsSAnZWagAAdqIP/jl9EaXIXYLh+h7w0g8i\n18DPyrw/AIA2w+GPtXb4tilTK9Mdh4RnhjzoN3qJr1aDxJzWI9Nsojakrkh0\neSlInppmq3ETQbipfn/XgJQHLNNOaJvOfvE7hixvba2l4+ODv5W21ZGqUr6P\nHyfNakuBhoI1ahFWbYZ3cZ6bDLnQcno05SaK/EPJUgkdFQW+5V9WKgZyHhWS\nOa6rWKl7VDUz3uWwOfBMP8tOSq5xZegUsi7UXyvtfvDkPpFu7wMq/SMp3XGk\nZyvYf0kbPv5LdXC5T3VOyzLmWZgFuwbEIm9kr5qkvP6GVcm/p8Z8Ah5JnkTx\nN8BVHuGzYhy6k/w6EgHtqiZHOppceughHp8Bk2oDrJo1JBRYTallfQ6D+Gw9\np7Vyp6df1H/A8wYdxc+uY/u8bmukKfRMVqxm56leip1agvhFgMFy3nXQ/7Yc\nq9NIWjp7d3C/h6KZNX5zBKm0Mz6bmebQHDUg5+WIYGmmX3OIkTekwlVuZ84T\nRaTG1BFl0k9MDKeVEZfsvoqH7l5O8+slVcIav3cTSB6InObMHDvBi6cEDBsz\nCG9XG2V2TFfQtfz1ZioiMcGRd6+CwYZFhHCi/SrP9S9ETdrTW21pZZ/w1gxS\ngy0z+3oDmx8xFAK1Mglyq+44tubHqtYNfNbncKQ9JLO14h+Etmkd0g4J0dQ8\n2NkC\r\n=+7yk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXKEnUVVikiCzHgsLLPp6fonYf2k0G3ZkRkBRWXfKtwAiEAubdVFDEr62nXdwbIgtFzKDujrMW8LKsmhRbWpnelHj4="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg3h9ub9.0_1602322216593_0.8153708872320176"},"_hasShrinkwrap":false},"2.3.7-canary.kg3j85u4.0":{"name":"typedconverter","version":"2.3.7-canary.kg3j85u4.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg3j85u4.0+8f056ce","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8f056ceb2b697c65f3d9b56477544088323e3618","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg3j85u4.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-VhFnJmYvKeT3uKx1cmfWuqHxjM/qYnfsOOh6F5g6jjI+03c99FR9UOnV+50r9deRqypiG33X89TPVhf4UtJb3Q==","shasum":"8834b1221827d2d476cb73f77d1f19c39b913f37","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg3j85u4.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgYv5CRA9TVsSAnZWagAA/xQP/jEkhQZ+cAALc+FWk3Pq\n8Bn9lfdElrJYQFkTUXolFzc9z1wefy2KQjGHyI8byNOzlDPkCbufgai181cN\nhsG+yd1xjDR0EgmdAKH4gAN5iIhKcM4gNbt1Qdb9/Kpl1AnZayeg3Nc4eCuF\ny2XNuqfqzOwNSF8mCrJ/fdwtQWyOl6lc2cSdarZY44BhylIazCf+7ZqdtlL8\naQYFWK33KFlCP6xKoBjD4As9Ak9oC9blDreAKixS3wuvg6c8qvpkh0e3kolm\nec91tACGXpObbznxlnL+33svuSg4RryhM57UMP/lwA8W9EjPyxCbGXkqbiaW\nzU8sh92BJv3UmxbjZ0i1ARB1r7RnhQBv2I/MlcWZRuqP+r3mEVQERp9nKsls\nv4KylUNlCCra7MG7GHlNXMQEzz6IXG3LTOJJn4mKpVy3R1sJMmEiebGKa780\ngBzEK7kMGvP871IVcHb7ALRUWvvCUW4YocYVY6FEjmgIPXElaoOsNayaoMoL\n81W1LOTaPFY96MIz/ecu19pFU29vb7xrIa6YdcBIcXPYeB/ud1eGqxcwzDJy\npqTF/8phsOOhkiykgQ6+9LrYi5M4wutqitif4tgNhPTGQNdSVE/fYPo5nk+N\n78KRQmw4e8phOEdokIYI1j5s2jJe/3mb+pCb8Ebam3x863EHDu0buApI3WS0\nAamJ\r\n=m/Kq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiLm1XTm0PyxIit+icSB/nz5XiFNzy5OIWB/F9Iig0yAIgcpKnekCBqR/KWN34qESnx0MCCrvSHwRGp2WfNxfO0wA="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg3j85u4.0_1602325497342_0.9786924088700641"},"_hasShrinkwrap":false},"2.3.7-canary.kg45m6uw.0":{"name":"typedconverter","version":"2.3.7-canary.kg45m6uw.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg45m6uw.0+bb14deb","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"bb14deb88524bd847bc57a13c5fa5dc58ca590f8","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg45m6uw.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-VqcXAR2UDeiFdQ04xCAyB3i35h8gBuBGbmalgsulMn27hIZ6eQXlNl/SqxDmAY6ZkDxCnKo2lZ0vrlyuNG7tMw==","shasum":"3b6b6c6977944c8ae9a2fb7c20f3e60c034d0086","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg45m6uw.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgh7fCRA9TVsSAnZWagAA40oQAKPbASyz+ff7n/O5HMci\nJvtbUvA+jVQWc6nM4pWnxeAjM3anHOnqISSThkHNC+1Ua66V8M3qHQRlB5L3\nAsi076FbLk/6mKhoEN8eIC3XW+deQqNHxKtiUNprvQoPimKuQ+9VrQ5YKCDi\n4M0dNlueAbiUdYUgEB/C4epSkJvR1pyCDnI9i6nRbG0U2wO1HPEhCLo3B3qP\ntkLBstoWMACw2DOIW76mo7/j/PxmxBGMBghSuX39hsVdspqu+tii6tiuIazj\ndpSElmMl9Ra1FtljA2+m07Ked+ly3wABaQhzMJjcz/513AZYSLwdtkVaRDP+\n1qVTY6f+Tar+uqGn6agoIFp4FOvc4n0Ojuzif+A1K7g7Qh7wewyDiLEBI2Xp\nSEa81p6PkUqUXSScrXo/Tb5SXjetGf8mYcYrIzP+58p8nps1Nj99C0IrFUXT\nJVlqp+4CAOiexxv2Egcswwn6xhItlhJAHLJk85rLhhzQFrbi9W88zq2Xfryp\n/lXhKGbQt+4Bs5BL8OnAzEbUK/zp4KRK5KJBcUsmmKX3g8AQ/KH17cZGzOJy\nnxxZmGdz6KcbXHgKNAS4/iytz4PTr7bl7GoklpVODVS34TPLyt8aBekjV4KA\npjUSQAZHSopAdu0nHRjAiEwt668nC+M/l320nIOyOvYirlvtbWErnd+RldUp\n5bNt\r\n=LJfq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZuZMmqREfKFGU0kWUUB6zZe6Q1U798YY9ZNRFESsIWQIgWP71nZo/tHLhmuTd4xnIQCLtA65RUdzVDeWnroK+/ps="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg45m6uw.0_1602363103402_0.6015074441033081"},"_hasShrinkwrap":false},"2.3.7-canary.kg4vj92q.0":{"name":"typedconverter","version":"2.3.7-canary.kg4vj92q.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg4vj92q.0+7822968","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"78229684158ca745ff625183465494fd13dced2d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg4vj92q.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-eE2rgAuCZa4w2hVHcgnaoUmJgIyEyinLrAtWAwm/vKQtnOm2AT9osrx0R4q/EdSudw1Z2PZ7w3AI8DljFWxAzQ==","shasum":"c16dedd6597ad0b2f746682f7f7d88fd684d6798","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg4vj92q.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgsjsCRA9TVsSAnZWagAATpUP/1NkxvdSWx3XT4SfkQTk\nekXUboqadSQnUxU13+Td+vQw0s+RW3aMZjEQDiYgCywYRFUcjo5RksRXXFTP\nYpQ2neYgNy/hou/x/U3w+1a97baMpbK/JRiKf24TIDThZCzbbsAOZXoVWU/p\n4gvIEe37wjxmqXblCRdoEhY0HW81GxA7/UE7jXvpGqTcAA/ktGcuEVGbfz3T\nRv07pw8KGplg+5FTqxoTjIuN55c1/+QJTQS0Kb58xkftjKihEaY6WtFzckBu\nbm3YqHU/74tWwo1aPjrUh4OxHIsILZq+eqDDDyOJKKqTq8U15jlpuBEqzkUt\nB/Vvlve3E8A7IAujApzzqhMY+qRwdzltM5fXUCgzpqm5I4YgwVsGAUL8WYzo\n/Wut6+hZ/e3UQRG1fSS9R7ArCVdqdwzAkhmHisDsDgbEpN+imGjTEjSg7VPl\nhe7aaite+2raPqeCqFaWtZZ9nDnOmF/olHei9mfK37KKnSThJrND5Z3Wglfo\nfuHqP0mLNnZYxO5Qj04GqIE3iiibSu6KePQ7i1AH8I5adufDOBzRh9F8cneA\nHvzk4y7zrurjYAjpXoYGoSPvFVlo4hvakImyGeUroXQ8YBfRQt8YxbT6RFBi\nY1PSYVC8PzU+xY1GW1SyFHiacOJfGCSLDQh9hCPB1SRyrG6BpOF7U/T76uFX\n6WGB\r\n=1eGb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2/WWhWqQd4AQW+6oLQHdz6m1SKJQA1JltYqO8eS1/zgIgLhmJNDxgRPLm2Iekfq1WhEZJE85GEqeQwL7R48Bmr68="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg4vj92q.0_1602406636127_0.16142542500126833"},"_hasShrinkwrap":false},"2.3.7-canary.kg68uhyf.0":{"name":"typedconverter","version":"2.3.7-canary.kg68uhyf.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg68uhyf.0+de5850d","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"de5850d5f868bc934531d942a0972fa4a1e1f445","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg68uhyf.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-ySSgINKYthzorK4g8BbEsLv5AjmVOK39R7yJD3O4zp4X83ioLMovqFk0/IeOMSdZIY4lXRvUZaG6KYBNuf44ag==","shasum":"5b042ddc7eaf5428dce9b9a0abc88d8d80b115f7","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg68uhyf.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhAx2CRA9TVsSAnZWagAAMCkP/1dpPeJh/1AzJG3cnS6T\nN++YJxP1q6110G2IWqmWg84hzsVvaVZfTR+KZhnSgiXdmVDh20JH0R9uubMm\n5A1gyHsmE6YHH6DvKngHMbG44Yv0bZCDsjC6FNNEvUYkncX8qpaoFeWObhiG\neov0vNaCTRWvlPmmHKfowgP4hHOIk2uLN6FePfRNFtPnOZcLP4JRLBt0LJe2\nD3/napU7qdPyeyDIZcSvml2gkzuSzRr1a4Fi6URjoRDUojj9joPsuIY0GAeS\nq5GMlKzYALBVDCnxuwljoi6zqCOg1KbdwHTdbS7l5+tD/lf367Dp79n+XuEW\nXQUgFmtM8cx2D92FaKKcjXYAr329xqwuetmip2+uLJ1SpBiHgdlQi4Ui/nli\n+7UQMnWurJblr39H7qjEsv4dkLyVtHa+Hp8u/GKJn5YUYmjGewY4MQBgL60O\nIjIBiPvWsqqxAuQCvSXUjqQY7vsQvXKlHZfOCI0GJxDvdF/rBmlw6aVPREEw\nFKv1JrZCRMAzBIYRE5vtCLJ7Nk8ANhW/trZKevtlXi+ra6eBpkTBEmXCOT6E\nTehw3GQtZDYD8Qv32aat44tgJ9GfryML2AQMRcRS8Ua0KkKhcTmJOvIKwUwE\nxPgwLcAeSTVV6BtMkPQG7jPErRjSkd+0QTjgomR09lyGsr6/TvHpSIKyOWfg\nvI1H\r\n=9rNe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDcpJi+IEk786IOFQ5HCW0Rv7lG/hGazOHCam2ZQstxbAiEAjkVKklPLgoUlUhesAV1skZd+06UTTocYTEI+uj7BWXE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg68uhyf.0_1602489462316_0.49667965254080926"},"_hasShrinkwrap":false},"2.3.7-canary.kg6g8g5u.0":{"name":"typedconverter","version":"2.3.7-canary.kg6g8g5u.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg6g8g5u.0+f036b60","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"f036b6002d1e6be78ed717bc328045f2df92c821","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg6g8g5u.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-NKxng+UZBgd4ftnm8Uzq+Ngb8VEgBBzX1OxHNhoNxvdBlzcKV2BxIuLkKl0nclZBEuSdlqiPAUD9uYMeetb/pQ==","shasum":"7282d975cd6260097adc8de53bce2d0bdf317124","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg6g8g5u.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhDz1CRA9TVsSAnZWagAA5c8P/RQH2blZGu4zhu+28+sm\nlAL2n3hxKVQtuBEDXtrkLwg0tzbv5/Vr4FUQ8pyDujj0K7ooQAYXF3+c1Cl2\nosHVIrfptmg+YKaXJvTbzg+XAsOI3ed6GJ4steVkm0WY4kKho2K14+PCEyvI\nAVKdyO3+PY8MHV/STA4n9uRPbi6tkZ/j/rCjL7U7pjn49mjdlba4AboEopKy\ns8+RI8m/7ZRGGEthWQKL7jXk0nnAi0DjpSs5Gh1N4qwF7gCbV9MBfsfE9MTC\nPWhOGnvAoxrqdvhRcN+DaZKurVdjtqgnSVxxXfkZ0e904KUCvHLCR1nY4ik1\n6wNoRjqMjVAetjeF2mhbCUcLmCiiNwS5YB3EqSzQGPvICsMGS17iIBZD2wlH\nzRNS8yUDVdkNwESbUuL1xx4GK5HRTLLxGmSvWJLsKnjfQfg4TelYnRVEn9c+\neVUWIzHR3E2Dg1SDMb7BTqW6Ax49jWmIPmQ1U+nQbQx2Bl14xRDqSjF/rpXR\n9jBx2HwMd5G3Wvk7ch7KpE8Nb2ieKny5gBERbha3uO5aXqNJ19oNpiN7RpYE\n0ppWbcbWbQLUYwU0TNhAFJrPMqiYVHBl1Bt3a1/kUnl0yQeQUsNO2dCvwwH8\nU8GmVAOqFtHw5PrYnYJZjzE2JdVw3nU1O03+gasXujAxJVICIggE/ZU2TpVS\n/cW2\r\n=zQri\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChdWq4v07ufBR8cyZGh8+oEeWsTtr8sa5Y2Zd+qgO3rAiAekhzGYppkaUK2ygoJQ+/LUd34Ji0OC49lwhKEuxeflQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg6g8g5u.0_1602501877008_0.693150453568325"},"_hasShrinkwrap":false},"2.3.7-canary.kg736xd2.0":{"name":"typedconverter","version":"2.3.7-canary.kg736xd2.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg736xd2.0+cc3f7d8","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"cc3f7d85532c68b98b1ffbf5757c8bae2acb6115","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg736xd2.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-VoU9EkcIaXo0LKwHrN1xwjwmobCMoIT56GR2U1Rc7F6LaVyIR8tiQQS7UWMAn3JCvkS5+/kurpu9Ts5wKDv7Jw==","shasum":"ff31ff8fec028030682fc7d1d117ea796f6bc317","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg736xd2.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhNOPCRA9TVsSAnZWagAAm4oP+QHBhL1sSiF2ggZCdOGd\n2Wh4/A40aVGLeOcfECr1qLZ3ZDMXh9UwVDZj9tMSFaCGdYTn7eIr/HtbUZrA\n926H3G/jaTClts7o6j6GNn/QHFSeybD8l8JPD0CQmken7lGrGbtq0jPCjq/c\nweAUxSRiCFt6vPsnIYoWjbInW6mWGciFk+w8qSNMlpIMuSTH6az85sk3E0+l\nDscxuwGOGrbQ+UcQhTx1quIsfnyU5eFSaApNxBtO/9a9Lbj0pXYChRigbeST\njMCkMv5ksIOzW+nv0IIurl5Ae2XwPI4YQ2KUHWbvb5aaasOK0miR5xStpEWF\nKs7SrdsggD/dWRizPBfBU1Ft3MIrkJRPz8TRjzTkqtSzEhbZi1isgWc7+/UK\nVrVMUFrjHcht5PcZ8ovwf3mqdyvA9cDSuXWb5BsBaw9d/eSB7dS0bZKlw4UV\nDoqdftMqbti1COK5GNkjKm+r0TqRJpfg3+BaAEabAgg8/67XsZlxT46DHx0o\nf1d//SSmRV2So257fts+PuEiu4XJ3TzeNdH+BR/1dJp4Wa55p8ElbtxkXw0Z\ngEOHiMGdd5HdkY5daNdGP45vTaVvzqHUF1rjirbuhxdvHtTLGQONMx3rj794\niK42bBMCPML8NPY4ZpuBWhL2xClkKFe16KkFwFY117Q1HjuE7dKBYkGId9XG\nHson\r\n=XDYj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRBfhWdnAgPdTTbp+KbquB3Gdw1K2FLt26bLFnqlhDtAIgYIpUquzMQ1GapL1YsaAabbun2fuEFq0zUclHs7TmDxE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg736xd2.0_1602540430886_0.8100167228167432"},"_hasShrinkwrap":false},"2.3.7-canary.kg8ugq0v.0":{"name":"typedconverter","version":"2.3.7-canary.kg8ugq0v.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg8ugq0v.0+46ba1ef","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"46ba1efa9aae70684307289d23f79feff595d553","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg8ugq0v.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-FkQcHySRqlpouFBhNSYJ3KEw5ZkQPNXRy5zBYmKP166bhXbLw9IoGlPj4/+opi788caal6eTUaz67GLGPx2nSQ==","shasum":"03562c09800f68ff0baaab00ccd672d0aa0329ac","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg8ugq0v.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhnKvCRA9TVsSAnZWagAAKnwP/1eB+pfnh8jkxl3ue3Rm\nxAVEmj/G3gOQWCN8NQc+9t4n9eqXtdNV565BMcHGoOgVHL0Rq20tD0Wx/N1s\njWKdzfBHvjHISx+8TF5tC9DgLgIY494izrYCFPD4/uFKNu5qTCtgPAkbzECp\n0RmUczwHFXOyqTjxYCkACrdCOVAEJV4d+8H2Q+slgjJnZhaiIwmlNDgA7rKM\nlIwNBlKsQE8KLaHxQRzfhZAj24oNKWfHTRJE3dBKmftGeGgg6SUBCtxgoWBS\n/7DwX6IhFxWPbdg4dLbFlPqfNgOCD0bVac75TdUHeTGlrafiYVBZ8uChqcRX\nbLZHfdAhGbTSaVdAg0rH7Xd3joEVIB7LkxVznFW4LjgXI7pXPcTMHtWxB2x2\nWqPTOzeV2sek7pabDnzU2OelHzC0Ejz3aaZz/nHNDoyM0i7/s3TZpnz7LU8V\navogSflJYCjyabzgayqxEWYLcSvGEUQYuAk9lkWGmf68kChT05tgqledkW2y\ntKSrkptwNV2sTYKInjyq2actzfOTA9Bau9zgr2K7OnnoJUapvi3sHr6spO12\nnorNoKw7/ZmRConM+ooWxZkdyR7IrjUbJqQa//1QQRqvGI/ylaxY/eUenkBb\nfMe2jOGcDR4BwnTVsaLxf17R9e6Ar7SHKUAdvZj5JBnuBeMYLb1H1F5uXR19\ngWEi\r\n=77jx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID0xXzFvF9a24JjiaP9yZSN0EdO3aBkor5qL8nYnwd+pAiAdk8rGdABUbQlEyhD3ByZ0P2Lmi8BLnrlVGnqvuDQw/g=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg8ugq0v.0_1602646703464_0.26439251020782684"},"_hasShrinkwrap":false},"2.3.7-canary.kg9x6kqr.0":{"name":"typedconverter","version":"2.3.7-canary.kg9x6kqr.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kg9x6kqr.0+08df864","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"08df8648788e5ae4113f0294d27f9e33fccda37b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kg9x6kqr.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-voUtSXnfSgCk04lSJRWm3xTG/NEsuVoeVE+jrEBdARk9PvVTF81lKUEMl9GQNgvSefTNdeXYkEWv6/8ZLtC0dQ==","shasum":"b1fbbf42e04cdd4c97cb39e93493fb74fa893201","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kg9x6kqr.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfh3C3CRA9TVsSAnZWagAAbKQP/R8Qbc0/qqEcD4dOiWC0\nhyuRlK/N+SSq6/tnQ+Md7XLG3i2iAoDaoyF1yQ/DNRqH4J4/tnaPzUOD7RHH\ncKqF5J4f7L3WLjRwpfYMlVirF8qxlnZJosIdEOfXmNiU4LqIeXByTokBMUps\n+N2aiCQv5Ty8Jv5ej1PWNimDUzNYTOWgZjqBX6+bDP1eylTlHre6+OZcRLM9\nD1NJ5X6iqKpq1i1/CifgmTn9y28AV3IDy9a/LozFNCwacpbM83ntP29MYgWr\nhCzgSjzhafNWq1YWrP/us6dcqqAM0Fyie+iqLEnNGmslEhsnIGrOni66EwVd\n5g8SWd64D9qmi3tZCE+RIA6ZpEh+yjVDLFmSu0gkfeQHgpAJnZuECSTxoNFM\n2xRNBn+qbUnKN/S/xnPEyHKUTOrY9Xexjfc3seiB1hj+954WGWli+LWBbL0D\nTd9y+CcEz+dckKJzgliGY3DSo4nw+wQ+njYagw0rXtzcCI2ta5QfQoZ363S+\n37RgxQQkHa03qIVQt4hByiKOhfQ2shZdooTnU2oiKUuxU3r+dNLcXnShVeEw\nGZQkOEre79CR/UtIDlZViRONlPvXOEyIPSviy6unn7uKgv+iCcz52+dvrWLy\nooLVVu1e1zgkMbJgLKydp/93O9bz4bU+MxtTBmO0+z2lpVM/Cfs1UwCw2oDL\nK7IN\r\n=UqmV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIALR5S8Vh/l6Hf1VaV/waVonTgQutzwW3HEgr0LQZ95BAiEA5NpPoNJEII0Tame3fcq3IX5OCb6HFhq37iwvPUNALgo="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kg9x6kqr.0_1602711735037_0.3799020832292108"},"_hasShrinkwrap":false},"2.3.7-canary.kgbtqzo0.0":{"name":"typedconverter","version":"2.3.7-canary.kgbtqzo0.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgbtqzo0.0+debc056","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"debc056cc43e23ba9f37f80a7e84efa268ff5440","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgbtqzo0.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-noN/NHJoYgwtpAv8jD2huMlXra38ef9Czc3tuRVT7M+ApYDQ4WOuaqiivPmX/1wxIeKQv0ymbTLJP+qvaLbOIQ==","shasum":"988c116638614c098ef2108ca23b028508946bae","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgbtqzo0.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiTKWCRA9TVsSAnZWagAAyHUP/2PqygQkHoqjepTtbQzw\nasJAae/SFrpxrXfXiud5ZOMs5NAYwPw+gQ2b91AUDHcmyaGQWCCG7pXqV0fD\nLbtlpJYgWY8dCf/3NSYRtzG2NMslLEohq3SaO66rZ5nRcOZRVuKX7cj/Vn0D\n2Ky1xMuwCEQrXRapcjabCkhPQktXg1pCkDa95kfULdwMe9B/t4Oavmbh6mXT\ndY3vQj1VZruTytmIUhFWDVDREqce7mDxuEteeqB6j6S7FePGXEq8HyvLFkzo\n15cbEU57sQft6my0ZI6fSmYuAJEMWKjiGPRWm+zyA4RXVOmPCGWFxBMFapAO\nQTCYPbaMsTUeG6IH+vqBlHRYmXmppcNm7yf+bHDDXzCdbXdw6lQHNI5cer6Q\n+nA2iPKhQyZN2a3iT6XSvE8tZznnrhghIbmlvBDx/QsjgC204tLJBc80l5vK\nroCkcccStwDcmCVKXujireoPw5XKOmjv5+c7eg76XF/6W7SAdBH6OwpUm360\nBoTu18RnUoCNtivEajWtZ6w83wXPi8NyIWQId5ScKrFh7xCEXIlIdWih+8DB\n9LE8JfHIW3J5EQ/SCUqgZMVUnKsTbBrBlTt1eJiQykCsW68Z/dccjtKjTEQr\nvCy0pustSJYwhC0HV/ibh0SoZ+hcHsPpnhngWLB2gMrIEWuY0jxZvlPXBrPz\n2l5y\r\n=7rAc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYrTGEWr/S4uvu7gp3nWfPtvSM6lKHx3Yrx1wF7YJqtAIhALtpfgsBQDUEnEnTUOJzWq9Zko2nzYrqF6WfKEdLnhRK"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgbtqzo0.0_1602826901659_0.5377998949658696"},"_hasShrinkwrap":false},"2.3.7-canary.kgc219pd.0":{"name":"typedconverter","version":"2.3.7-canary.kgc219pd.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgc219pd.0+6619528","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"661952884ca1d89be1d1227c7b3a71ebcd5bd1e3","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgc219pd.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-8qaXsZjR5zRVQtqluJuuyGsPGAQmI9fFPXpSJJ3knz8ugPuhJI30APCHlTTgFpUbiBZHxonpy3mKlL13h/8UmQ==","shasum":"64462cb214ac9af8f6b3c6e8b850d41581461e43","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgc219pd.0.tgz","fileCount":26,"unpackedSize":45344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfiWjzCRA9TVsSAnZWagAA2EoP/R/G8iegxbh7oNfIJOeQ\nHlof34DgR/NUl5PjSfz+J1zVIGbC+f4HFo37CPRGrOBoHf+HM74+LjTbRNRg\n1YZ1iQtqzU++hNzd+kmmT12bysFGJn6itBFQ1txdhlKwVJDuFnjATAwzexwR\n3yfB8JbCsyHB+iXKB4cKV2ZCTmF3foIwAw9fMzKuAeGHcG4VxjxbR1A9dkU1\n2NS/ccKrt9oHN9Flgfw8oEBpBiH+Rg5d+tcAYQe4i0z/GyDnJXeW0vtwysuY\nYSiSdE91U4fnT+fizuERAlqmY92aDzmK6TPgRyA+hbRGI98YKld0hkt0UfcG\nwpM+UN63/HX2RBdvJ98yMXm6LPohStLhDk4CstdZU8zuceeUGoll2DNVyTUo\np3fhDwo7g0y7iyLvzcyi79F3ZKqi5hfAdOh1RPgdJHZXTGZVPtpiItOUOu/q\nUTRw91usDrW2fU0kqVqiaRMDCqMHnxDs0/VEuAIqSCp4TGjfb7joyLHP86ca\nDNeQavpjqteK8PVvZN1a/JuNm2Yzc6t/70T0Iv5LZ3XddkKq/kn9cVncFPVW\n4Tr4JrO2i3IrhHawa2FeTGUh1Af1mO+KUprGRRs5d/bMHMI/xdr1oW7HxiKS\nK59WER4MLiuJFXZTGHEU+bbqF8anMnrCKIuo7BIqCPNrSrE9ew76BuV0nWgI\ny0aB\r\n=+IXp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAO0LRkDtbl8xpxDUOidWOkmy9jZgh/2O38H5el2DpzdAiEAiBCDLVGFZRbWumODE0baXjlKhfW9yELEpY0CHttBAbs="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgc219pd.0_1602840819047_0.11225752007617706"},"_hasShrinkwrap":false},"2.3.7-canary.kgd3ozpo.0":{"name":"typedconverter","version":"2.3.7-canary.kgd3ozpo.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgd3ozpo.0+aea6d6f","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"aea6d6f23b3af8191372b9619c411bcccd2f1809","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgd3ozpo.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-GCgzSubNOZCC0bgI+8V4LHIhFS5McV617wPk1F6xF5Bno43G9xtoQ+p0AbEuiofVLFq1YxA7aDj5iv69azWjew==","shasum":"576bdd8f99a50c4b8d1bf5eef3ad0610a39bbd3f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgd3ozpo.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfimAGCRA9TVsSAnZWagAAAI8P/3k5iQcIAf1bhejq/rkD\n9nBh7Fe35j/RuOhk5wRMoCwstJOfnfJcGRIM7+Qx9TENowkbJ0Vi4LzEqt0H\nfjSxPIlHb3M0BS6Hk5ugAZMCWA9MdvMHE/Zh3/daOR3kVDKObsNNbkNPLfJa\nVeeTpK7Wo2l9mLAiDB+x/huoCIBR7CO2/V5a1oTCA+w62D+5OqciVWLAuVfD\nbpn0ubJ0dbrVFwuQwxtx4bwhv0PT0cOJdorwgAtQQ2fUc2+qsxmCLWumUX9N\n8LlRPQNOmwyddpvcWMGTGyMqQHTzfhSemHSi8rp3/0TR/iaaXgi/I1kTpyZD\nOcv7niHkDIdQzV/d16lBCW2VaKxZXdDczxbM7s4Mq4bBa00KQ0b+G/tUHk+2\nOugH9W40e5EEggy8yKdAJsfScLcyrF0v4je4By2vIvbvcMXTBY7yy2RQ1iHN\nF5AyORjUsq8E346Ym6eUagLJgElpz7A0eohnO0g3jJubD4mfveknzUXTKo/I\nmjqdLCQlheRDook7Uyym8cXhxScL3+JD5KWZjSmlPAcKeHmt5bNnbCcDWDs0\nXN8K9vMSvqFbznWjKX8ZzwB89i8A/eHKpQmzFP83hRdR82b2iDyQjqfE7NQu\nP1unr0FjVf/Q2TT4r6MJJI26wptGsT5jW5e0ooglJDQuRKLkLHhQrpQ3Lb5e\nDXdh\r\n=qAIP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1oWqlLTStT2lhBlqGW7CjVR6ceaf6d3J2eYQXmq9XXAIhAJaYHZYeFTWcklNFBlZ+xjUmshz4IFMPBaFAegCQ57qz"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgd3ozpo.0_1602904070186_0.06575326156821726"},"_hasShrinkwrap":false},"2.3.7-canary.kgdlm368.0":{"name":"typedconverter","version":"2.3.7-canary.kgdlm368.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgdlm368.0+72d6510","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"72d65100fb29d00266799061375ed45b33ee2bc6","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgdlm368.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-FVKzGw1ow4vCGZ26yMht2UopdYn12q2LO82Nov/oFW9Bn4ZTijxcSYR8IluvTGX4jfuiylVBI512Ht8rlFsetw==","shasum":"00946b619658e29842f3ecf43de23784574eea32","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgdlm368.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfitWYCRA9TVsSAnZWagAA3u4QAI8F97bhl2FBBExwi87h\n1qulkw7SWiLCO0jyQ7OEa82++ABtT6t84BjTgvZuxcFeNAfqamCAUtJXYaFh\nMCCmU2Up1bXlMtWDUCOS3YhAk4JluYzzT8ydT8QlBG4JRrsKeK/I5HjiDCog\nF7EYTB29lD+QHBnAgApI41PK7/RrczyaBQlldTpVTSFt+ktGB2AB9M9xSztj\nkDTAWA5XfbbOCDDsB8ftP1dsA5wFvUHgj0cXZt/jbhXQJjqwfLEjwKZs18Hi\n6gs12hamP5rWOKjmLjpiPOV8UPUoT2tR0+f4U83MrRTjqKQW/QUFNOlyO1Tj\nHuu5Cv8OOcetlMbTMkfGe41JXp3mg93IMLySQY7f0WRkCBly9PMj0uUXgqnE\nStoM+sBvUj2aZULpez3sfHAcIhMlnd8fB05fu/AKmuiIEypBpdHAwqAF+USi\nWFNijccfKUUt59T6rAHx62S/qRe5CGyxwT9LFp+oZApjJ5EEw4wycOivhzrA\nM3xwRI1zrpfNNkhg3BaNkcsWuZ/zB8VL25/WH/lLN8nvs17X3mcvqZaH5xKL\nfm/+VjgUjv3KyELpOkoxpaekfbqFkZiYyxkMIfT7SzvIAi61UgInE/hIChr9\nq8ccPJTxYe/Mqc86sLS8fUFuhwP9KuVZZjdR6xHs6y/MB8kdIgQlBnH/dLp9\n3Aa4\r\n=Hoxq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVfdSln0+k8Uwwa0+7GYhgvPLDmDjdpnd7mQ9wBvQ6XAiAqU5xTtCcB0jOdHtB+1/5FKW16pidc2dQpPYGvB6gF7w=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgdlm368.0_1602934168265_0.5042045148770726"},"_hasShrinkwrap":false},"2.3.7-canary.kgdmgzlm.0":{"name":"typedconverter","version":"2.3.7-canary.kgdmgzlm.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgdmgzlm.0+513188e","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"513188e5794c339ac9eb66c4b2b4063070dbc420","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgdmgzlm.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-jlwBMPawicbyDDBWVYO87VY1jVRFadrRF+lLTa0i68KWgX9kyvZrzdQ0z3pLg99aDWr/sZvt1uKkMbQo/ykfPw==","shasum":"9e4263dbdf11866dbd98e6576e9f0d6adb4cf697","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgdmgzlm.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfits5CRA9TVsSAnZWagAA6xcQAJuy99+wham6ZJO8BmOq\nlmZK8EGQ5EvurHnAexS88+UnsZ4Yp9KMSGg9bjt6eNrXnT3f1GwGIUA7NENS\nVxcPlB4xvkMefwuxST+ibnkjPb0OyzuGGZV2ZNVUcysYmPiu2FfwJCckz5gm\nC7xQqVE2hX3Sng6EcrUAI1HqT+57ru3PPPnXUpBWNKjPu6xXJRNLJoFHkBN8\n4sYmftfFTkca9VFTH8McXWDKn9wvogno8wPDaVnss9S/303kL+2eFEZVBCAO\nRPbdcihE1nsall0lMWU6Qt7leVR/OYSZfWlsdgStyTdGCV+7c+hQwYfxgHdn\nGNczgKH7B53+RyKkLhIX0BeeadMUr4sexXCmgbaX1R5asFJiI5CWsb2/x155\nZJba3RNtv4iUa0GELNYa4jwdLLtTcDfCpdz//GHI7837xQ0ZAX5Xco9k7qz8\nHw/vb7bT1MUiP0n0fv6Cx4KR2j66yfdv7oBNojeN0CcZhOZkxkIsfTpaOs+Y\n0/lX2rIa3WeIFcNrbcyCOzjCA05fhmexGBZZpRfjuye0qkDP5Hzly5c2DrSG\nASiI3uy7971lFlzmrV2Vwunn+OdEPEn6Zl5Mh5AYJOGIRWvVH+C6b86tOd0G\nr0vU3Saf9QPcBpAVK+M2Nf4ltvg1Rko6MKglVJngu5hF0o3jL+R/v04lmD2x\nOSLQ\r\n=M7+Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUqaAtd5Ulqv3Ya81dJ4U5xJFyjtChrzh2NP96Ldru/AiEAzE+ujSHzfhs+ZHvVIkDEi39iQYvZLpv/qibcWy0tdvI="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgdmgzlm.0_1602935609432_0.5655555164474577"},"_hasShrinkwrap":false},"2.3.7-canary.kgea9t96.0":{"name":"typedconverter","version":"2.3.7-canary.kgea9t96.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgea9t96.0+96353e3","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"96353e359f27f36466ca1b10150e1d03915d2bad","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgea9t96.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-bpOwH2Zw3NRCXbC9J3YpP4rst3m9WUhUvUE2JVEEqlauMFX+cUAr1WRUI4yy7Q8fuMR4KR0W3mhYL+0fSswcuw==","shasum":"2bb25bdf422c95d24951165b18db6e2da86cc482","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgea9t96.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi3dkCRA9TVsSAnZWagAAaSUP/j+jeGRxipPNW21Vm47o\nHtECs4yyQHDe3oCtgjD5RG6lSakKHu3z31H1Txn8dpKc6Vd2A3O4VqWKQjcU\nnVKdDFJQ6S3U+eHqQL3jbJNGZ6roGlIEVjqptDToQbDkxHp5Qj5v9RFgZZXz\n8GxGaNOZ+lllBxgONnMrtKUKZZq7CIW/gNeRUaizCuJ/bpm4TqKB5d2DsPa/\nmQTj6zwXLhNoUZZYXH8+H4in7znvPwBOHA5czGitLdx+PiSTp6usfFxHu6Kf\nkgvWn6CvFi9Io6wcT5aa+wmgMfe3B6y9N84cZ3Jx7Gb8orzXQjQJ0jzzQQSu\nlObJs15z5KQz0F/bhpk5JkyQHpFEUxJ7AeMg/1QAU9rhvUrwh9bb+A1lSNI6\n43Lyounxn/jhWBwY41ivsXUszVz6zl/j89WlfGf3z/P+7Zd9wxlmB48J+DRb\nRH2kFscG8U8wNWBIkbH60QseNFYZQafUg+U1wXhw7FyPJgEPA9cjoNzP6w/J\nr5HpJ0NtLY9OuXo2lLM0+Q9mO7XkG4eP/WcQu0sR4WruI33oHozhcuWmIZHh\npc0L5liOFck9LX3cmXMvo2q338/OzX45HcB+oYof+dozdFwQtJZBQCsvyXW9\nMVNSDdRqVfKUIgrnvbqCl19i4xTEUZUYaK+HekGLFrWME4JnIvBIj9huc7mR\nsqOY\r\n=3l01\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICo7VLR11TjfieNdAkwDrW88wcZiJtfRq6BChhfiWJVzAiEArOxncMBeslHZT7L1jIuXtYqSOU5uVnSQjYaGcBStVq4="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgea9t96.0_1602975588226_0.23866279695406756"},"_hasShrinkwrap":false},"2.3.7-canary.kgelgslo.0":{"name":"typedconverter","version":"2.3.7-canary.kgelgslo.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgelgslo.0+bfddc69","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"bfddc699bc980dda689b67df01af464c828c8df3","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgelgslo.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-J4Nfnhi7MIfx6iyBTITnQUl7BYCBj27+gHkC6GqINluo2PWcU7WtsFL1qtlZ/p+8Hhu7jkwNEkQR2E0AzqO4Nw==","shasum":"2a7a63289952c85401173122deb2c574fc8df726","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgelgslo.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfi8DTCRA9TVsSAnZWagAASesP/2ivueeI6sefM9KQu+5e\nfMKAsXZ1LmbGfEuKqyyhwGmXtC6FHFRIHVFT7PgcK9DnFr+uL9VquXaRjBY8\nNLPKhsUTlcLxnx2/3mjQNSqm7A+53Cwh0Oq5L0DwoRZVT7RZnMoCc354oa9v\naHVgyvnUCuASZHP6Df/NpKI8bi+VNmXaH+GNf1LO3RHjis6LEDBXs8JNoZCP\n4JTgAw9AXiSXfXJJQDOeVkXSQp01ZuLU5VXvutISVKWW5X8DiPDQYjeg5NVH\nqSCMM8suDVFURCsxGy2+itWhzZUCdnFg0kWsEHrJZgmagUJ6PL7bvyNuXwSQ\nfxr1AQdyGJVYcXufCTMso5hMsfGqxNyAwXhyrH7PeTN2gPzTYnaSG22/0+u7\nwOVi+aHw39PGfg51Lo4Ue1kGkAYoi3yIJipga/xnJu4AYRH3UPMtjfv38Psc\ngI9ThL5v1jd3NYiXh0zUELpZOYJQhiVhmOb1DoIbFiyMssvOiTGjTjPAuFZJ\nuopLHb+CqBfgRnMnCO+vY9lomid2SJQXpbkiI/7CN44kRNseZ/KPHMvew2m1\neNfytRSnlbl+9VflxVLc/vo0U2D3mLa31n9Lw1rDwpO3D508vgYnX8h1/We2\nCsxWooadr+G/cE2ECbvxLEB6w6HRzEJcTYeMkjuQq5b0HjGIybzDbX/Utdar\n0dnN\r\n=aPiA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBQoNn3Ygc+dxhsOv41t1j2Uu6cIeT4m+EPjrU/EN9SAiEAgyfonm/dmrfA+UU+JJzvxulf8f7BZH88xsyD6cQqdZ0="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgelgslo.0_1602994387504_0.6355429572760238"},"_hasShrinkwrap":false},"2.3.7-canary.kgevjcoc.0":{"name":"typedconverter","version":"2.3.7-canary.kgevjcoc.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgevjcoc.0+1178af1","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"1178af1cc765c0d5f0976e9b676636e243b8cf87","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgevjcoc.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-WN+Gfi1nh+c8Si3bS73yvEEaLAXVbKN3jgQE4sv+tWA8+we/aMrLQ/io+ECU0xBlI++fs1Bi1iYoJXH4kc3UUQ==","shasum":"85dc5e8d75867e87a41fefefc07c0e333e67348f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgevjcoc.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjALoCRA9TVsSAnZWagAAMrgP+QCimf0aUKyG2bt/GXHJ\ni04DlTrCTWSY1hqm5a5v1ytjBG8oh75Iaq61B+sy/oQA00c43TEjfLpU63a0\no0rrtd5Uqg+P9l4xkzfOqLH4phKcWZrYQ4e3jxqNAThxIHo29cKo2Pjj6xjh\nAlO2idqzhS+eAWhDQjzIlLS6Ge2zGLqD5fKo63Z5lskR0Jmw4fTMZjARTAm2\ncRQSk3L8J8Pp06Hltes+2InzBYjbVFzHklsOcsFH8lhR5JaGRAvkCmyCkP41\nbiUjAbDHd2Zt35UOf332Yohgu2WSzzccUGV1oT7ewzwERBC1Y84R4ZCJIn39\nxPbREH75sFugjruqnIKCOuzwNGSl67liKPMLPINUBfa10iGETlWaPXoywvBz\njJmij74jKyJMjPrZQ4k5lHZSCKE80PIfaAhKspunvktg2vb9eE6cSwg8aSss\n2X0cgPheTQeA3sfesR5jhhndt/o8f5AdKlFaxxFEuaCfGkJHDPZVYFOLPCf5\nVOOm85N7LBB4bInKfMKsoogseDxf8dapazCYtFXyqGhedtiE7lKYJdgZgb2h\nI8vwm2oQVOTF+zijtGrUJBt7H5rQsLdn5uxnWLM5kJLqGQ6AHJ4R3cfBua6l\nVq98qsMyLI74UzeBFXcJcFkFdPer/3AUkuDT5GjCAjLn8CI3mKu2YAjn/RdH\nnIZP\r\n=GxIo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLXSwhlFsMCIESuAGIGBY+MJEAXFRG8rKbh7fDgJWFWAiEAvJUfgSf+vVGrT69TMIyUP254qrnf9Thpwc9mXxhTSkE="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgevjcoc.0_1603011304103_0.8534591216245455"},"_hasShrinkwrap":false},"2.3.7-canary.kgg7oarz.0":{"name":"typedconverter","version":"2.3.7-canary.kgg7oarz.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgg7oarz.0+a1d939c","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"a1d939c5b0bb73a715396ebfba1be722b491e667","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgg7oarz.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-Ys/a+OdbtHVjHVJvVskjgfB9OZ7LZr+fs6WZz258ZRsONYktZfG++NWaqqRTzjsCYUf+oLjKNqGpTFy77I5X6Q==","shasum":"99b6f8a945a6d1dbc8ec58ec82c53ef620c7b0e9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgg7oarz.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjT68CRA9TVsSAnZWagAAz88P+QG1PuyFbkKdGMTAvKwq\nH/1GMmm/3ww1SWdW0p6rcgNuJtyqdNRspa3ReHKLSoJQkLS88YjAS545aX+5\n6dCvMQKuOuLzc68So2Xvg5zkf+jfV3LGhj+bqPR18mzl1Da6o5PDfk4gmCzd\nXXZ2zYYvSz6MD4kKVjU6VwugeOjACGJiXvxGRNkhpIybNmbl9woCAspyIu6X\ndMNHrroXmNDtrZXOj96FopwzGRwyUjLRkVCj/+Ci0A9q6ZIIzcJIAET3P7jC\nhkPxHqHU/VRmv7888wWnvU182Sl6hj0YZmDAD5KuEo/YRxEgR0ESVW3f2a6H\n0ZDzuC05eesaVmEDGLmeyWjZScmsKYkGq2G+Pu4kQaSeGTXOzrWiY+bDaw92\n68aEMGjR2LgjN0ugBVbpjexgbtxjdIvlJjSVP2rsBkDrl93zS8pin19MSKhB\n+UAmhr2w6vOUuaj/aK/fb5aWPCA/flvpoIlEpY7rF6vakTEjpTHiClrIIc36\nrNWosHoyQH3BuDX9y98Ya+QuskkJeMrvX8PernpwtaGHlABC8FI79hH4Ip4J\nlwF3Oa9FGL7t+jYlzGHG2Qc2h43fRRYJgrnay2xd3v7GpwS6O9TCydymHHzQ\nMT6Xv2yGLWAIuqn8JJFiZJorxtukAgyDwOPUJurYva+ZiffS7GHu6LMD/Bm3\nl5TX\r\n=rhuo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID242BlVhtpRz5BnwVs9n2qevvwtsjftymcW/A9J9TK/AiA4x1K5Ct/T6gDY4zJjaqF/NhE6dxLZVXzzJSsGnnCLiw=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgg7oarz.0_1603092155513_0.9550016934504963"},"_hasShrinkwrap":false},"2.3.7-canary.kgm10qxk.0":{"name":"typedconverter","version":"2.3.7-canary.kgm10qxk.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgm10qxk.0+943ad6a","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"943ad6a5984efacbcf25d99c44cd50d3f601da33","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgm10qxk.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-yHEtQdQmCKdjK/UfrbWKhQjNh+t1V+q+8JulM7qcdBoXfWaaMCTVEHYjvOT5KnFZIKrD9kCqGot9FTGqMqEJQg==","shasum":"d4209f11560da723813414474cbfe35bb31a5cee","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgm10qxk.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkpxBCRA9TVsSAnZWagAAjOAP/3BTRM6xinon8IULmskG\n8L/sBah4UJYAf2xyEJ++WNxLsjjy+y+Wa4lN/EroBoM5zf7SOkjQ1Oq9WEpq\n05BO8GLChtAsyx+asIMQy0wh7YVB/vEZueuFi8g4on3c6gMBq5Y4H4a6D98u\n5t3qXFKEctvhd34bYPsRc5vQ1Vlnz6nqPd+ZeApyWhvhQuUIOkZfpOlYvjob\nSPjNqQzXDVzvGBlMNh7hmZbmG5Bhen8Kd5JDSyxPp6k3KxmMekWFXKJ5uUlG\n1jrP1BM6a3p80MwE3EZWi2gxDMS+bhvqXsP6xoONoxo3/bwVYu19YXoKC8c8\n3Zi4HP2qDcstkeGsSoMHHLpoFPI/m52M51qKHqq8ATd5Iz7116RUrNVoq6eg\npq+qmccyGUG06ruY5RCYga7iUfltSd6gEObvojg7+s+0Db5rEUlcg7La8RqB\naQyq7JjtxJNCnLIhvhUUISQ3VkEE9k4XYrbSothwa22IhdytsWGX1REPvLSu\nnHzkOVDTTiHuhFNodljOMYlRFysBMd3Q34CM+9vvNu1rk822Rjm79zap4pmS\ncR+ehTZ4yQA91wKjVAsNK8zPgIJH8LGFEZvGJok7EozIAK9IBIdPuNSZeqN1\nh89YqFr7D4g1DZT4UKZSWdBO9al+hTDLFK1FuzRkHYte9AwNHQxRt64SEZ7h\nzioy\r\n=QTja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqAe+Z2OsGFlsWZeAMOaEA94mmP/icYM35z0YIXRIj0QIgVNRPWVtd15rYnHGc3yMcaVAX01Eyn+SBHFRzBeqWZPg="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgm10qxk.0_1603443777036_0.24020353158311147"},"_hasShrinkwrap":false},"2.3.7-canary.kgm5iq6j.0":{"name":"typedconverter","version":"2.3.7-canary.kgm5iq6j.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgm5iq6j.0+92320ef","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"92320ef4f5d93c8cc73a79f7f3b90ee710f67ea9","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgm5iq6j.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-Z3/90jUcfu8AYXvwau1PAIfjK2TZYfHeVHyiJUjWXcV/gqfAZFZejed0LjBkiJdNDxSsU80bdB4ED4XgdYX+ZA==","shasum":"bffc7accb966c5b4497936a58160f0aea293423a","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgm5iq6j.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkrnFCRA9TVsSAnZWagAAnPIQAIWDUelw6ZXEeuv/Vj0+\nX/7pCtLRsH/vXVy4h5mspdvIHYk++EtyAkgSCXWJ4PfjkQScQzsOWNKCGW4e\nnk3HQQTdEpNKZZPkMiCx4ljisFXNX0yKRYK8uCnBKUXg4OBTW4AQ9cOV4LRn\n29wzAn4cWHZ/kFMW20hL1qrhU/w0Y5XHQzQN53+PmYYeesf2/YjdAyehmmms\nZAsYS+ytcEji9vz2hn6qybXJC4dWTS3EnRq3BpHplExtx0Q7akpZ32E7r7kK\nMLhAcvZypR18Irf1BixB0Iqd0Qi+hYKB7pZr9JOZ+3G1nE8YEpUdsArpmhfZ\nhtJfeB3yoayzT6pWUbEWYQQlm4XmywWzatzDwqEydxOaXOzIY1PejyvmBZ6h\nGQyXga1E2f2b/IW4Bhz1MlogKRykvCoY74tZeCpa/wrUA4BhAoeNDG7bQLa6\n4gLAFHVgaYwOnBhBebrF0P+Y4/rqUu8m0FWF2DNWu9BE4kIfAM+vWxh5FnyV\nddmMZ8RPfUUCJcI8F3CG5oJO9Pg7TxmO3Oe/cDAs7GkGaqLyXFC7na3VUH3O\nsvMQHl5hqTh3T7Pf+03gwUxUsSB7s5Y7SES1Yobtm3TCvPPF0VtSSu+xC1Yc\nTpvv0gL4bMiMytq2+dUvLBy1HqQK+kMD0m6WerwD865CtibuViyQp8qdUrwB\n6XV2\r\n=sbQt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjHiIYHo8ThE0z9+zRCDpggS5FZhP83SFnXNlT4J+0GAiA3kUCJb5qXq4UdqGSxaNqsn/TbZWjcRxy5O4Pf+nIylQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgm5iq6j.0_1603451332974_0.7442851941758957"},"_hasShrinkwrap":false},"2.3.7-canary.kgrcn168.0":{"name":"typedconverter","version":"2.3.7-canary.kgrcn168.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgrcn168.0+6223ca8","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"6223ca8337aa3db4e18b41465f25314d97d3ab99","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgrcn168.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-n+WtKKc3uMgH8OxMKJ4g5SA96EF60nWUW0fphIh9vnMZgi076wBCXLXw4Otw0laD4V93AmofdnER04a26WatPg==","shasum":"f52d8c65f794cb6a87394dd23dc77598d4a1de06","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgrcn168.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl4V9CRA9TVsSAnZWagAAC9oP/2yGIr7HUck+Tn0PIdAu\nE9IROtfA7No6xinUI47YP7xsqa3u9qnSX8JmJfVIPhU4SKougxs4L/Cdvv+j\ne9YJTFysadHfOTY0/2hsmJXMGsyYKo5NkEwAxEJWQAC8cOp4rseYZl2hC35R\nEFkkK9/t7Nm9Qts8pT02G5vUqMRdZ8G52SqyCtWwK05dFblb9Znpf+YoNjKC\n7OokN9JFKVJ2s8aYCdmZs7Hp3WOl77RnBDFnVhJMz2MjXYIMS0khzyyvb4+E\ng8nMopyyxGOvTG6lEkPx6IsJB0N9JTIBy/pEeC+pLkgvP75J7hTHY1dV4rDo\nPPHkarhOxlDnhS2dWWZBglMkLny9evQvd/I7oqQBJo3Igf+MX0c0XCgUoMpG\n+j+cRfLFagqmyYDB4oMUqdg82DV4AltpKdfzShZSPT4y/YkBYvqwaLLWV7/M\n3iy1CDLeEb/H690RE8x5/0lkK1uMpiqYlsAwchY2AX7HJxATPsqOBn8BCn97\nUHmjlx9oDcZ14p7yND99C4ym8SB8JOubNGPY9D5lrgT02Gw+vP6AKqCpaDAw\nvhrN8OgvgiND+BgSHhD5P8DeokUF5smqng89gEqL49U9bzWnf82xC+8BSBwK\ntB5xQJR4MY6Qv+YoDcZ6aHaiBlW/e3X0LU9eqjaZ3a2Xbow0i3RKrIHaVaNg\n3AtX\r\n=v4dB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/W7lbMNCPccvBZ0qQZ+bLzcW/BKSNjtXpOiV08w196AiEAqBZayfEvUqSWDQYSlqsbH0cVkNpRyCNTZ6QTfnoQqDo="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgrcn168.0_1603765628768_0.9962698117778412"},"_hasShrinkwrap":false},"2.3.7-canary.kgsjdgwx.0":{"name":"typedconverter","version":"2.3.7-canary.kgsjdgwx.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgsjdgwx.0+797e401","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"797e4013aa8d16bebff7657b839e8168eae9bc7d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgsjdgwx.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-aVcR5G8f//dL08H/RUrPtPi7UKipOLzi4S1EfmAxt5xD1zhzEqMk1EUBp+dkDrj1yQ2Iy3fty11RUGJAt3xtig==","shasum":"05edd552d60dab4af37cc774c58ad8abbe185881","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgsjdgwx.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmJ3aCRA9TVsSAnZWagAAJD8P/Re08ll4KS+cU0NQJdTk\nJ0mQmIyBylry0jvuC7hnpoCb8TAPecswsbXibIF6s6872+AfmGpsKFiHZWL1\nGTQzRcDKfk2g5DX9wJ7HWUlHBK6JY0OC+gflGp7+H47R4U1MfF9Hz3l/I6oy\nKsq3HTHHSksaIv7SVEV5e9YDYuTT+xtmJgeVBzICdzE/UFcheUhCOK7GM1C1\nATnCCLl/SsqXwich33CaKrE/RK2dWut3X5DSubjZlOaN0CF6L90kPIt5tkK5\n3vl3TP9DnqYKqYlK0vmLuFsB3jJwOtOqV3dcmB915uYPQK9AgdfUZv+MHBsK\nfl42HLjXyfO+kES0gLYB31ZmhlbG5tNN0LGgxLqC4ziJcMNoAVOItXLfq3rn\ndboMoVi1NWEPLgT20PJQyOoYyTeNFdWRoyfTEGAbdbgkWphS6x5EzDB9c4pF\nldDlkfDrzXoSN9Z1riovP0xTC7bqmZOsAy2/QfrIacgW1O97R/tCEYa1wXC8\no8g7aPE+aUpq4Ggq9DNV5EvFtOw63ekjmt3m2p1lRfm0u/NdCHqcge7fm5Y+\n35otOreBZuTnNVR8IBA2xPVBJQYAjD3P1YkBftSpcIgoDRUUiPXOOf3iLDQG\n6p3CwzBIfdtfyklVsm8vurcHIXS5FsTADdM1j68z3cvEwqRFsyJZMemitB0P\nT3jY\r\n=qElM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2HUihvfTixoW+X2xDSwDGchuIuU6y6+ib/Kq7q0g1bgIgQzKrOjreRQZAeVmNM7ePGNE7UIWu2qnDqCw+SuncXi0="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgsjdgwx.0_1603837401439_0.6545852612802456"},"_hasShrinkwrap":false},"2.3.7-canary.kgsps60c.0":{"name":"typedconverter","version":"2.3.7-canary.kgsps60c.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgsps60c.0+b543fc8","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"b543fc84949ac0ef83fe12db1def8949f78a8590","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgsps60c.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-EKR6BUbOSqFPM8kjC+nheLGwda52v5dk/Oc2Gwl11iMUry5rYX/VxYDIQTEgcaaLdFw8OiXRbBGdG77M+vwUyw==","shasum":"a9e070ab77e8e82f27e9d1ca5d882e1d3b5af190","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgsps60c.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmMflCRA9TVsSAnZWagAA5iIP/0WK/ZZsSfEfpi6o1gJb\nwtRgfPBqljsgKMG8muOnc1lfBctPuHOVklHW4ZQyUOww8DA+rvJXV2bbg6Kh\nMhW9cLKd6dFJh1YHSqPpXpOQymjVJG91bqsHvkQdMbn1tBg7wVqQjSJsS/Rw\ncmA5MpDx7lkBrAz/A4kmU4rxEPjXbLvIcxk0sZLyfy1+/J3RieqCbjuROc9D\n4W853NA0goiG+9Q08ztMMwvUNn2z+9maZHdt0Nf0cpRKhORts7i3vObz6E7G\naDu5hUWmewNl6O+RBPGMiH0FAirAEeLRyQ1gFNX5RQEl/gZhv7F1LnpgZOJG\nZ5goigwZ9UyV3cFjB7XkcgWFUNfbeQUivVyhhslwpEZtI219G+Mc2CMehNzP\nJ9i8hZAtV3rfweDBTVfrz0Hkv9l7m0BNqUtCPSgaXZ6FJrhfZGDVkGsl1sxU\nCTV3tC/QNtBH9Nzrrg4KdHJQFI1lJBryUZLjJ3CF7zriQBrTIeAJXdoMKKZC\no0a3hgl9krQ2HqxfWfSa+FSPgtIqB80MHAPaWD8poooiE8MinBp7cpiV2tM+\nT9DF3YUSG4QuULJ7d8iceA8KhFACtXS6plB74xvmCkv+U+qjrr3eh0ZP7ft6\nmOIAnaa6muvqf0MGicVgHCsHr7/VuRv7uGWpOJYdtRn27sBhKvVImy69+bO5\nQXRr\r\n=+u17\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDuYU5EcGOQOYWPS7mh0Ekvpc7f/mlqBuU/DHxg+hA1AAiBRpz1+t+zLs2/AWGk+Hwd0SsA3OQYUIedPY6a3YPpVOQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgsps60c.0_1603848164639_0.6528309397186913"},"_hasShrinkwrap":false},"2.3.7-canary.kgxa6f2k.0":{"name":"typedconverter","version":"2.3.7-canary.kgxa6f2k.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgxa6f2k.0+ec70d4c","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"ec70d4caf5f05b7fd9710de0162b7809538d6627","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgxa6f2k.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-iDg+iJdDWVoBZpUWmoztEZDTetx9dwQPgeztgipAKfVC0g4RU0lnyP7d+xFHQMi9S94M1iVY3p4E1i1vvwdyaQ==","shasum":"7accfdcf42faa47cd2857c672e374955958d391d","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgxa6f2k.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnP5+CRA9TVsSAnZWagAAK8wQAJplX2zWZHE+jnT1ENt2\n1QAYsuY4PqjMmszrABMpscccU+vuK0EsuKUpAiOYxODKysVq1pV/5x9VGT7y\nOlUTYZFHYODAZ5kFcfLcwikW53y61W7S2RkrcfKhZ8gw2ZbSNyKTAoFtICHr\nZqYhTMZdEhxZZjnCfYEajFab4iqn9ReNFFn9FSLeXaiK28UQ3oUtmISz+hXb\nQxDJ4EoLWGpDCj5xobRqWDZPJ272TP6fnF/S3xk1mTvo3vbPdzS8t4YzU/WQ\nQqirAZLuclI1rIIEAn2YDoSKkZM2Mrf7ZUYk0C7lctPqzo2+Iw2qxHP82qE+\n3IZ1jNfBXsdLzpyi04alMy4IyXHyzanpVJGNgutwxSFjuncaLx5Xku4qzAqV\nVjtiW0uRbcJe7J6BtdFo8dSG38c3ymcRIm9val7LTNXmsdjAvK1cPmujSfB4\nxydyswGuPOwmkAARdUEbNOu5QisOU7+CnLszpcpND/j8jNdyOANUry/QlMHx\nLdGZJk7Kt9RavVJ/ibXXtgocia+/QD/6qcC/bxE3yNP6ahtJRFSHFJ6+C7HN\nDc1DBegaM8R9NTC5wKjSlj3GPguE8rsqHQjp3DpWDRpvg7IUrVkLHUVOVLIa\ntbYy0b/XjeE4Cxf3gsRzcQNMk87ba4y+YJ+aiz8t90NAK/1xYmdkjVYKJCfJ\nVr8U\r\n=YVMq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID61knsppD2yRIPGOGUpzVG59ebTGwlnHsmmOUt+HUmcAiBTkfIdM9xjQNaalm0i9ciknIENoVSbBjrj466iHtT3HQ=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgxa6f2k.0_1604124286321_0.08353645463129888"},"_hasShrinkwrap":false},"2.3.7-canary.kgxnbu9k.0":{"name":"typedconverter","version":"2.3.7-canary.kgxnbu9k.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgxnbu9k.0+73c2aab","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"73c2aabfb053333477af3c6d26ea8171c1f955f3","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgxnbu9k.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-qGSlbjx7uJUetGIcpoIH8iZQI+cGYeLKydGWQhBqQsLRfFkWJHn8LjV7CqsUfRLl0PlUhKdKKcn66En06Ndkkw==","shasum":"3512509bee2e15ac6dac1b6d70878a9e967c52e0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgxnbu9k.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnVTGCRA9TVsSAnZWagAAkNEP/1KBmCv29c+nBZaX8Y2c\n7MlEGPpYuFeODm/00lhYX2KuxAe7dXVorEN9mAXfvRsl7MJIlRQ5rpwW6rDA\ntP3cB+9UXEDpk+BfF7LNfg47x9NVfs7h0XnRaGVlNYUWD8GTcX6oya/dmH7p\nSWh0pkAqkuUo4mu3AqWeeyiGCobULQTiZqEOa5A4Jeg86lnJWmPVuRXbSphW\n05UVQ3zjWAqbEcTd0a83PMQ60HB47G1zaUrbv+oDFCmz8Ch+EfKbz4V/9o0u\nBHSppvAWdWXV00sLBugbXlL3/Fxk1rO7w4HckeHu2EPRiqr6NW84XMX4xekY\n/QmC98estPlgQAyoG90xF4nTp4DfOdSW6+mqyTlQZo9MkUrJIsfnkMG/IO7w\nQlHRnYpl4iwy6Zyc0aZjI9c8FyTtMO04s/zL2UZoiMoExP9YpKtMfl6LWS93\nREUK9Scx95+uHDIRsUb0kf+6zDo9Lw2bydeg9gbP8y6DxJ7O+DmHvCSBkL9g\n5SXoJ1dQ40c/4oLeDwSBfal/wdsoIPSKrnKr/K7xX37utberwapvPpsPsESm\n4JGWfigcF3/T5L+59u98X4OJBitTWTviJSQ5Aum7JBSK+YejAz/z7ujulYR0\nne0zKXcx7NiwQkjvgraxHUuPBT4gR74ygvFocyb3MKy7kCHEGF8pH8HHyWNu\nE9CG\r\n=Qa31\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJ1YnICBSC1AcEWedVI57lI+c49mf27ZDYzCCVDbysYgIgYjuJowL/jK6Z8BFKO7OJunCz9BZfmyPNoCg2ahqt99k="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgxnbu9k.0_1604146374160_0.9917542269202324"},"_hasShrinkwrap":false},"2.3.7-canary.kgy8ctsk.0":{"name":"typedconverter","version":"2.3.7-canary.kgy8ctsk.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgy8ctsk.0+da37e0a","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"da37e0a1f6e349e180229c197a0904162774dd15","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgy8ctsk.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-42E7n9/0pbjTCs9rpNC88SdWrBcUospgzYCtZI1gIr/69/aEF1n3cxFGqEQS9SBHoCc+mKlUdgz2XnCd9onyIA==","shasum":"bfbf536112ad66f3ba6c393eeb5589f105f4e90f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgy8ctsk.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnd67CRA9TVsSAnZWagAAYjQP/3C3gI4NmYrSyxk/PhjE\n1EWTHdrcIjPOb4+fekbpsJ2dStoN31Pzx6nBqjfgWIwA2I7Ewra0i2isNATl\nKhB5608PjvAJVvMrQF/EpMCkeNcZNouH0ceLXdoj4Bp/RkGt/fe89Z5kj336\n4zEkMvSkuBOp6RhACigM87MnLTfSzNHws16D6wBz1yAlm4x2kH1Fi6RcbJWC\nuEAxEzfsmuRpWb9bQpt2vEW9Ig1fVS/wwuB4NgGuG7kmpWDM+3G4AWUrZFSY\nu5FtCIbNCKSoM5epSTBHNguwIN9LbBIDIBnnoMzNJ0znvLghpX0AYAdMbec+\nDJmSpScp1E7nvDNNPncgHXFV/jdEIkBBJOFYuQjcM2NBv2XmgAdb/+tqJE9z\nNBI5UEO/xlEg/NiFI4/ILMzYPqPTFo9ZibYwyifVWm+Hjaww5Ji/6sMz8Hvd\nEiYWYUsN8GQvYK9KZUcnwydmArnxyhriEGu302NpEhUWDXlNoq3eM/mVkS/U\n+QEvJF7CH+aLU/JUK6uak7V9g8BFGgGyemH/S57b0QbPLWVo69PMLH7Hrp0u\nqdYzzN3rLK4BcVqElrA93OLSPsn+7GPIr1Mn6xXydhuWHnxJR6klPFOiWVVY\nBO56b+uHH20XlwLg7ENtaISiGCKe7JXp+m7eui+24wKiW7uPMW9zWdMgP8RX\nm5We\r\n=NbPA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxaAJpr3yDXZd/do/ZNVRw01VOVCCETNlYuFw7/EEYHAiEAniagS0lJGPd+bUlt/MtA432+ojKScCYvJGFS+j5WXFk="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgy8ctsk.0_1604181690627_0.5070711659575091"},"_hasShrinkwrap":false},"2.3.7-canary.kgyal5xs.0":{"name":"typedconverter","version":"2.3.7-canary.kgyal5xs.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgyal5xs.0+56ad51f","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"56ad51f6d19f7d1e4667ec77d0fa896af12cf68a","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgyal5xs.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-z5LR++3bkBY7v52iliySBilQwnR4A4chhKJR5n5sNnTNofTE/02rL5VKu/PMUDPixNKYshYTFoATTfwJG+NiPw==","shasum":"57322132ad21a5be8186e1eb6c1bcf901c493def","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgyal5xs.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfne1fCRA9TVsSAnZWagAADuQP/jvw/jVxKPQ0L8NWIsw/\n6FNyN5sdFBeGC/xa8ClPfk+sFOcvh4dmT0ueSn96hPaMp4XR+lrJT4gb5/PN\nC1xcEv21gJ6MEJso0xiHXas2fk45Ou+3e7qYjgAQzhLUOCTowDnu8kjKj/Ow\nwCz6fR5WEjJdGBhjmHKNJg0Galsko9YZtxGWiXFs+VX6NPxHP9wLsLBrH4U8\nUSjMTkCvPSMdL+kzyjMjTWKAO60cKrayHd9Dw7Alb9QMpiszHx6hC32tm22c\nafvGpraInVkO8uPdgVlT2LgP5ek6lHSQGass/omf9utmEa20SrQ7dPCEtxfD\naAIG15es3SUC+xhG4WI3SJ4HYiBl7QCkBRQn+1WqH9wrIKtcXnp9C56v9vLK\nFoyFYsaeSYMg0hFEbGCen//dAgxH5/PgphmKqWbpLza1eh6jMnRRwu+G9uoK\nkSzR8sqkbx3BowvnId3aRwGIj649+rfPUOX/ni/53S9ZTFKc7esZhKqekBaQ\nHu3/L2cggYoEqVbXsb25gv5H2jPfX1MKOBhsdnBYAYPTJhXBtMefCWGTDsIe\nfORLZoGugAIS9uBJ7U3MEF54I7tjLJePIlkmKKzisipGoRTF5TgbvJ36ra2/\nLvw7efcZ40yBmGI2qaLFHHS1MOTZgnT7fX8ITA73P1DlAuo8J/PyikdL0rbN\n8yQa\r\n=bqUG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEuuzId2SWyVrY0UHj429YTxCRNZjHs5H0BVcpoMvZ3tAiEAvRlNi0pdBwUmSiIHtnjj3xTDdXMUVjxIPopD74IpZi4="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgyal5xs.0_1604185439191_0.7240952247057766"},"_hasShrinkwrap":false},"2.3.7-canary.kgydir3d.0":{"name":"typedconverter","version":"2.3.7-canary.kgydir3d.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgydir3d.0+567ece6","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"567ece6c1645980648f6c33eefdc2d7b6bfe6d7f","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgydir3d.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-GGIPERtH166auNlDFnw2dgasZdFll0uc+S2+PorO7tYi9Vk2Jqb+0eEtc1UHHf1gVEe8I/ETAjo1hB1zqnxeXQ==","shasum":"e12542f8accf68454816e684aab2e7919b03dcde","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgydir3d.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfngCfCRA9TVsSAnZWagAAqtsP/29KmxTKdALl4qYUEThB\n4WWrVIxOssZpj4NM1EFRS/hu6sjY+mmn2Yswlmo168lN/AcIRC8RZriTzjcm\nmp8ba1SoSPIGHUFie1QIOQAfEcLoPlmog3+Svyrv+yi/oNTRnLirbZBUkNFf\nGsiL/fD36rg01l0PrmbVQtvVEc0vIs6goWFPO1shk5kabwoyM43TfZ67YRed\n0tiYkcEkHM91rJhWQJKWStr26ek0NQA0lyepIFICkXS/zPfVs48QYw+4syfw\n0ggxteREz325W8VSIUmHSV4gMiaw2jbNKcQ1qD33qGDW1iRuH4484Q3YjKB/\nB5j4DFZiYh4p68Fzx+jUw32KQJwfm6BjYZ9vsSTutQLAuxol6XyiusipH4zx\n94yRwzlg2fI2hhsB2ri1VUf5gp1hm12i+Mso3qPZ62dkeTmLGhhJJrE2/fxZ\n18L/PNKrOLNaK3ZvrjMW1Q3F0Yjjh3RZaxy+wTJS6jkdXz+LMsShCARm5F1d\nS7Sy58uAW7I+157kuiaXGTXen3gC0+h9Uvb3Ok/Dgo1pnJB8wio+Mcnf+KIk\nHBXPCSjOcHZNitlyLshDgu+KLCbXF5b35+nMV6ODVA+VhbXXEmMiN9Ky66vH\n4V3oYVTVeh1O59d6os8lWNWxeOPrGinn2JuPU/FeVIk47JbRRpdO3vRjx3lj\nwg6Y\r\n=kNO2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnqWhYE6f652XWfb4dyrG4xgCLi2iN1AglyRY6l3MbXgIhAKUbTdUAPwe8nqwodlEARfHWHyUtTz8iFOhZ/PsgOgUM"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgydir3d.0_1604190367388_0.3129770340894773"},"_hasShrinkwrap":false},"2.3.7-canary.kgzo7o56.0":{"name":"typedconverter","version":"2.3.7-canary.kgzo7o56.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgzo7o56.0+b39b189","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"b39b18963ee9792f9d49d79a6d9c17e80c586b9e","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgzo7o56.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-RKb4xtD5Uc5tpC0sFmEP7WMmb93Whcu6F11AJt3J5IER6U4VsK6iGi4jw73O1ZWvFIgxUAsmINHM7A1HmMgr1g==","shasum":"e7c9cf03bb304f5dd592b1959c428e46226f1dd1","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgzo7o56.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnzL3CRA9TVsSAnZWagAAJREP/j4aS3AZC6PlUN38uClX\nl8jCZjBYouv+l8Q6Vxpu7yOeuvmleTa4/qmxSb7zJlhPMxhPGZgBxHUh6tpF\nuTTLLdqUseO6yxn3x6zNv7T/j9jk0Lfoxvnb2e3BExynZtE/74Uc0beSlUi3\nIYQBHM6pTjKWL742lRAfkMeniQl2LEzhVmEuvSTIRN/IY/0ITv0isfVGhq+D\nprNgcmSDdY4gNK6Nd9Ns8rFA00ECU6ikrRFmdRqd0D/soLxYAyzYq+qmT2K9\n9eHb+JSLYpjvqSH/+Zu+ktlc5tvwzpmQip1tKliNOioUmoQu+EPoXlMCTyJF\nWytK8BZAvvPUwl4EOcqA1cvpStnJq2lQrR2zJxlr6wmHgUKMkvS3QPA8KWN4\nwGfw4mQC4ER6CMmkCf2EJEgcjyUcuuOwPkTvLnHUQA4SXJo18bKZZq3/lkap\n1avvoK4DQ6VLGmGTcUmFssetream+JA4UK9IjD4qytCG6u1UPaZ0pHt7c8G5\nrSH0JCbPKuFUyisIhdT/x211Tf1tFn3h3ylwRumlmgrn4Mluc1f3U7TsPXG6\nWPEtQ6ehbr3L9VXUBC2ZZRAqOUYWeYQU/NUaEkmd/2tanuAol/1AN7+OOYUo\nKRcjsUzEtnbAtCG6wtX8YanmGcXBRR/Xym2dqZyPfcaSgcQvDdRroao+wgyy\nmCZC\r\n=QzrP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6P0J0HeKuJrUHvu/guPmwnuvu252bHvYitYyERZryewIgDxDOE8YaQrk9SN2UhVNlYGG9uT24Jm98auW0FFpiv4k="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgzo7o56.0_1604268790579_0.11992102850575925"},"_hasShrinkwrap":false},"2.3.7-canary.kgzuclth.0":{"name":"typedconverter","version":"2.3.7-canary.kgzuclth.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgzuclth.0+d74a0e3","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d74a0e3e7c0520483ff308575cd4f52ae7ceab7d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgzuclth.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-7Xuqp73VYedpAtA32Grm5Kp7fSZap4hW3BtV/bPyfVoyjbEQjKA/+hx1QSLjUvbTWNs+6lLuZj/yOIh3xH0sdg==","shasum":"b840be960c548b3bc9f1233bfa59cca9b1bcce15","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgzuclth.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn1s6CRA9TVsSAnZWagAA6i8P/3l6OGaVpR65NcLtA46o\nLDfgLTUlO5sr9SRa5ngjSRjBOKeAI7Q2MM978Pfp+ikGqtaosoXlyKDN/UxP\n6OCB/ooob1kVg57yzpB+is2iPaW/dun192Ndblz7KeqvGjTWLAy9LflyK93q\n+ghvPXXqKVsu2wx21miK5+4lN7b+9/nO72bKhaobMd1ZKEfVe8GuAB9KSZsb\nki/rDrxkMqEp6yo6Se38k874xCanbG1rf5eLy/fPGWIdR3MH16v2/Skapg1q\nl9/gtNwN+HzPQWbSBN+FiDCZk8ZQql8XqId5NF/Ob9DZwUL0bMl9WrbZnaQG\n7q90xx7BsG40cn9GDpsrnX4G/JBAJXiL+Ysh/WrefGq+yGoDBD0rf51eqFA8\njg+c08LINEmnvi59YnWi/E2HteKWda8c5RUxjYuRZ0QbEbzFA3pjvDpXzEc6\nXdSQZ0QfUv2KEzD6b9qrt4l3ljaMPb7Gea6Zf+nImmHzdDk0pICwX3XpFCAe\n8P2jnmtZHXro8eVucmZiiir7RhQQdPlFAVE+gY/rxv5pejTG/2y2U8IElZiA\nCsh1KhVvQO5dks7gLQD65qP92q0GVogRuNi/QS3OxuP+I2HKnEz1VEbvA0pu\nAb6xVKvhRzDaLv3KxXLJ1bxMOYEGN+FpDAWyUV0JEVVoRz9UfGshPX82KuS7\nCEy+\r\n=KWyk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIpa1zPG2ACSkkJDIkqSIS9cJA7KqkRypE7u/iHy7IuAiEAxgoH13e2VG3RPc6rls7Z7pmI/RSJbRh/ScFiELVRaG8="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgzuclth.0_1604279098041_0.1584080623777595"},"_hasShrinkwrap":false},"2.3.7-canary.kgzwhr7g.0":{"name":"typedconverter","version":"2.3.7-canary.kgzwhr7g.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kgzwhr7g.0+4e753b2","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4e753b2fc3683e8d19575fd82a56068ac9b393b1","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kgzwhr7g.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-jxz0b+Sre2Ss928pGSdWK0na5c7Zgc7NmpLUNeG7hGJSQM+ZoEIE3V75SHaDU1TNqfAs50bduyJSqY7PIuXf+g==","shasum":"cd3d73edb954d21a795266a4c37d006d11e492d4","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kgzwhr7g.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn2lKCRA9TVsSAnZWagAA8YoQAJJx+kSd2y2yafksY4jX\nuHNtlp9GUwfuB+z0uu0THbokHymo9oC60JHtM3w2A5P6MmqRxFN4AnAKE7/5\n0W4wQyNKw0YORixYxMVNjVoqEorsa33A7mo7gbkjKnyk1q+0+Gpjd8jw8oLk\nX+Fq6MD3JpUK/gK6BfF9iERNhrtEtpJHWybACRXMPNFZiBFsg5QRJ4jLki5Y\nf0NjL2ScN4qE+v/YIYSOFCLYJf6abTPtaKnC7A22kqzLIudkzirpuMpaplNq\n/sKwyzZJJfb82NW1+dCP1Jrbh/467Q8SEb6cND/X88MmmMP4vthlDgXaaf9C\n2+yNP9EcnHcSoECzg8uK4GCJbEks1pbRhk/vd7qhsMMoQzAGBNSUtR6ehX8l\n14UUur7Iypa5K+znJ2ZVIvdlocx0JeTD9T4qJjLDoJlLii101CJiMg7ABybi\nrl9Pgyvft40YkgoYw3Zh4pSeTRbvuztJiSHYZvZ0Ee+ZbyXJgb9miKKdi4l+\n6EbhyHixfQiWBzYVqIqMNXQiYMEy300MfeQY8dUo1EOgQ3CmO/mnk6jVYIAR\nEbJjwEm1WhUCPQrStoY79F+5ZlfqBWYkUgRcvinuR+z9CuW35BbphhpUO6qr\nuGgEaJclc8V64KQmHKYtz43iodzv5WTYRydIgor+kB4XrVzccFUYUw4hJh5x\nLMX9\r\n=KFlq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbozyZsXAfvjJcEn37W08qi0e35hVNYCYxaNh4gT6EfAIgRitb5+3xbeDkHWdGhM3tAkRktSP/F9knu60q+GxmBVI="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kgzwhr7g.0_1604282697563_0.9652887962182839"},"_hasShrinkwrap":false},"2.3.7-canary.kh1h0fly.0":{"name":"typedconverter","version":"2.3.7-canary.kh1h0fly.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh1h0fly.0+1d1a670","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"1d1a6708a612c13408919170cd80c0fea18f9986","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh1h0fly.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-FPR0uSfcCsSpeO3WCo6Qp8hJncLmw9Z8cmnF4cLHAG68tQ5MmmkANBE5ly3lcLB7yIdzIkYhTQWmZTbSNK2Xdw==","shasum":"0b44726d6a3f3d9cf65c35612030d539b080152b","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh1h0fly.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoNwcCRA9TVsSAnZWagAAsn0P/AnZjVNQ/+pBUeUnZOFs\nd50UZc5mK8lAPbNzEZ1PeyMhRmGWjW8o5y5Q4bBnRnHilb0M0+87ksrXjfaD\nvQWsJyKtQbbfEJsZY+wdVOE7jMlqbUpN3Zr6/SzT+N+myfi4ASaPF+Utamty\n9SHyYvKeX2whWi4n8Wn+3khAIcFIaABmfp5ALxeKt2ht51wzu1V9HcQ996vt\niyBgdHMVU5wczGpwFrvdStaIm06lQNful40PpREI7qaYYJXlG1bgV/B3CgnX\nmI9C9Y0hznwvZQZxtiDQW9GtoVn6kV0pS+klpFK1DOt9k0LmXYDcCLRMw/Vz\nfMBBjP5oxzkTw3aUfYv/VEeRb1XRKo0B/+Fr1/PzL7wQn3cA9aDx3CZLWu+X\nvKxVg3ezGnffz1LRCDUfxjMIM3vKjoV8W9FVyAF5BqZXdjqsmjNGdbjmAOqH\nmYrW3zP0DHpK0HRPEwNSBmJKMgvHQHDIKFVQ4wzhnG1GRKwAHJ8rlkWeuQMC\nyrsU4s2MigjgZx9VBvulv90dzJ6dOBdJxTUEg0LeWJWNNgwczBhwiQAh4Zat\nbOCJGCu1vxUnCFKKkuw9MJs/9k5aL8BK55No1QNCF+cTsnA7GZm1KZOlViLB\nFlEcd0gJd2JGCenTk6xxbVuOE7S8Qn3kr8XFtRimptWxZUhASQLcjJPqbSB0\n9uOq\r\n=C4Ae\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVxb5mY+y4I7cxLWCvVhtKwIn6UmVQEYqLgt096HnxsgIhAPPVU0ZzMq7lEJk7/t5XSsavrbARYL1DdmBzQm38catE"}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh1h0fly.0_1604377627970_0.800820178893666"},"_hasShrinkwrap":false},"2.3.7-canary.kh1tdkjc.0":{"name":"typedconverter","version":"2.3.7-canary.kh1tdkjc.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh1tdkjc.0+77ff395","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"77ff395adf798534a276ecbb01278994654d8207","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh1tdkjc.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-uCeLBPApEXOMZVo59NeKczXhO2nVlKobFVvFdD7FrSpEhBNETuLkUxg+Xtdyyma9M3feFEuF9gfY/lI5yVMxfQ==","shasum":"e602af5ec4e79d01ff431a3e665e90d1578216f5","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh1tdkjc.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoS08CRA9TVsSAnZWagAAFwEQAIfF7NTY+rfumYE5480I\nr1bF1YC5IR5wDZdzaps0nJHxJNDphFUaqYF4mLsNXWoinoKRd7Ms5rq41JJR\ntUj2tMKiM/aHqL+G+NktqZ/FvUHdTbzl6/HhOmjpEW5Civvc+Kj6FPtzyIV2\n1aBpNdyuqjTIwMtGua1MBUw7zRT7HLlEOLnzwG6sYatfs0i5XdvhA8cPdiD/\nRxEk4VcpovyqGzdNDhR6cA1R72VPD7TUfl3KvL7M2OYEFbccgfL64QXg9Scb\nBlp2IFtyLdDdVIzEwHcE8L8zzJnUNctDI53/Oc32rYDDSCtCUfz6BEfcI0IK\njna2qpoENCB71nB8q8GloKYffJ71AKFmMnaSZZsH0Mm3SO70cxLvmGksiSeS\nfRJlt3ewlg1MJKzMA3fNvzivlGuuG1LpJgVBbUtYJvdQM84+KDfMuYRhmw1s\nmZi9FZyuWz7fe1HffJ3Yy7AjG427poQhJKt87K0T3n1nug19FPtX6xBm9Jd6\neyiprpmdzejkU1FIt03DFa+ZTs5uy3gypAeRbfZ3Lcnk8pPQCMdhJd9akln4\ngaFgYTGJVC5Lq+nM+tRfFJaw6b79WoM6y5RYBhbhWiro+lUYa10ZEDTbmMcu\nOfRdOVVu8TGOrD6grGZeGeWpZjK0iOdDnzBWyo2M1CO+wQJKysSqJYo275ZG\nnvaL\r\n=5fNp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBD3SdjEp70WqeWiJl8P+FTebr4d5Qwig+hRtnEsrH6MAiBSWIGUbnyoclBb5LY0jUlikNPEa4G0mKNFTLJvY+F03Q=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh1tdkjc.0_1604398396230_0.605397714925556"},"_hasShrinkwrap":false},"2.3.7-canary.kh1ut1x4.0":{"name":"typedconverter","version":"2.3.7-canary.kh1ut1x4.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh1ut1x4.0+de299dc","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"de299dc23d09f530b930fc3772f08ade0ea01662","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh1ut1x4.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-G7Temcx5YHMVnjyXf4TGU8a9RV/Yq1TIOtk0E9VFJrxZWV62IT+vyQZRHDypd0hdD25DqYbbhOF/I8HhDEClVw==","shasum":"e29d5334e06f56fb0c1ec61c1aef5180a37c5c5c","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh1ut1x4.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoTaeCRA9TVsSAnZWagAA3aQP/ix8ly9Vg6SJT/6+SZjs\nomoyn7BzvaXZKHcNAxd1eSvOK95ffbQJCnJcDu7xoBZR6/N5GJd1MgNOtrR5\nzDKujEe6mu7BNFdWkpVVGg9K5uRp+Yvj4l/3XCyAY8guctVsR4LLYm6d5uBP\nDq2v9oBONm345bPf25x8tZn4LIsFESsJyBy1kfzhQjhN7sBj+88DUcre+Nyn\nJcSbdKj2XzibbYB2Ntl7WMDmCd6t6KH5X50SJwUpGsHYe/ORvOwSSh1aatvi\noxQD8mlfu2Ow2ffpXWr93UAPEiZBg4jtQINF54wmpE+lA7J5OKK1Q9QUtGBH\n/Bh2+ChPAX0+SFYUFExfU+tuswf4net8KaLeJ+jtyQgqWsmDsJzW4FFxcq5K\nHwuABeXQo0PZB1iHGMO+lrWSjjUwboE3lA1LoOtY+YKkL5zZ155tM4Y388m1\nMOg2lT+FZpgfvr75ykwwXXdnQ+rjqZ53DKs/6dUAc8+74Jy1iZoGENATC6eI\nhIFmvNirGUBaUmaPMuxE8EDcGI5zxxMqANRiIy1ITHwpBUFHYYtTUWCmniyO\nQuwZl0I2XYQLRWVxIfncAExR8gGv5ctXZp9zYVceutkxSEdHB655eP7Py8M1\n5IJy43WtLDWShil5KK+jGUwYpzVWAC5WPnjI83CB1Abs4CAbHupK/eZyyXNE\nvq+O\r\n=JMVi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnA2y19DYP76A0+9PCcqrqzLvXhzA0pOU8MbKkbevL5AiAitsGeeYHtbR9xRYKjGQkPBkwsM1j/X9Qp4Fk1oMMQfg=="}]},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh1ut1x4.0_1604400798038_0.7711472091124323"},"_hasShrinkwrap":false},"2.3.7-canary.kh2ho8dd.0":{"name":"typedconverter","version":"2.3.7-canary.kh2ho8dd.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2ho8dd.0+35ecd98","tslib":"^2.0.1","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.4","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.14","@types/lodash":"^4.14.161","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.4.2","lodash":"^4.17.20","ts-jest":"^26.4.0","ts-node":"^9.0.0","typescript":"^4.0.3"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"35ecd980f098c9ecdc188471b7446d844a2125a7","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2ho8dd.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-4RobS3DyfXlhw5Cz3+tFlmjxNL0wJPyP4VSZZAlgjfM2lmTV3oyvve+3WRSe9a/42DT9h5/1TueuwDkhz77juw==","shasum":"93c105f05473dc0bdd3f7dd5d0357f23ba3782ab","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2ho8dd.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfocylCRA9TVsSAnZWagAApXgP/ieJ1p8x5LlK6GyU8Ebv\nncpNI8Bui1G7BYgeKOgH9oc4+5xvLk7uyf93TFyh4H90sTkIDY9VrxjetM4U\n2LecOMeCXhjvEe8Jsxdw/UQA+WQ1JEol7MMYNMGiOIryGxmrefDYsQ8Kmhrw\nMTSGm45y03G6Mq6EcNZtTr3dKl8EvEQEcvd5dCDT91yowhOKiqRutm2lZqLd\nqy8njAv4PUQQdrspX+PY39xQMK+Fwoxr2VxbRBb5QHyScbPomJ1vjeGFgjAa\nMtlLKAuuKqB2GvyxBdTB3zkC5irK8HKSEXRBbtL6sFMayAVvD34UULmH4BEO\nx19Adi6IjD2/T0p71cAfxTL43OcQZo2Yqyz0DlqC6s+lKcvz4l+mxMiSPtTv\nXZASTE3fqZxFx9Z+KpdKGpEWTd6EvLypEi+/4b8mvqr7lcHyWyc1ONZcrFFq\nE6bcvKrBzdcEbhxMJjhXftM482q2RZ+GfMbPsnkIRZu0+3iqQhQjZxmt+Jew\nxrHmb61PT3xLuyuo/HJheItW637cTDRmgQHLukWX6y05exi4iiJMfN/YtLaK\n61NyeKWFCe/vm3/xEPoyvg3qT49j+Qd7gHAYGRoZQ08Nsk1A/vLti34I3pUx\nH8bGtQZZO5dVZiO9PCpuj0VHvr5/C8VMv4RclnIO8yTdGR1kMsvoMmXSW4FP\nhBAt\r\n=5jWw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBSKrC8jI682P0gvZ1rTsjOgHHpjr+8xqHSVLH8BgZ/gIhAK4c/MItbVdktsKwi2Rkr0uJ8sjYRULIizVhZc1JLDeh"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2ho8dd.0_1604439204862_0.14908224102066425"},"_hasShrinkwrap":false},"2.3.7-canary.kh2j3gf1.0":{"name":"typedconverter","version":"2.3.7-canary.kh2j3gf1.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2j3gf1.0+9eb68fe","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9eb68fe3759d21dca66a9120dd83df976fbcdc78","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2j3gf1.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-f+n0UM/GTnRzgjxUx/zUmzIaxCNnldL9uh/iOR13qWEmuFzvsljUgNG/wzO4Fp9Sp8AfllUSs9qhUixyGiMMpw==","shasum":"90b931e43bb8b32fb95a6e00e0e7d817d2a84054","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2j3gf1.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfodX7CRA9TVsSAnZWagAA6lkP/R4j6sepMXO97nkUEOB+\nNCK6As4uh3vPNaWMtTVxF1IlJmekh2NowSUT7lZkmTyxt9RLV7QAmR/cNrSM\n1vhQsz/1zHELuM/+y0XssKQ9ClMWjP/0KDRTVMedv6teiEiQolu38UFjdQSr\ncwIuw7ywFTw/PQwC+HtiSp0TxWw1NEzRb84D6uCw0Wsx3KBLGAuXbUeWHiNK\n4HCsb2y8+bTL/z8RvJHej+ujCPykm/RRjEk6U3BCIfRjnumtoCqWTPTmlX43\nR97FgZt2cxBJmNl+CUBNaqgt4VXXRwJn9fViNUv4opPw27St/VOBr/fs3Eid\nMrd2n+aHKS1cXFrnhtkVb7oLhfaVj0N797u4hmmOtO3xeftJXOT5gExky3yd\neCv0Yrm1CqAqvVx+KWPxYSOoZP31k26Dxk/qcNjlgKSVg2pYEEO1mi++v6sA\nLXOoS+QXu8wg00b0Mn932x+vCRms/O8uaF85w2/f+0kVuc0B7V9UT2ifkY2j\no+inlK8OkPkiPKGKJcmMjdxcHhVB5WGGQ/qLhpfzLzg+WtvZcsYTAeqQUiOD\n3yVXGY7I3l680q0cRoGdBDBfmB68aOBdSG8OVf4/p8Y6FG5PVTh56xwIuOq3\n4NYHddvCM79d0F2E0rKW5r4kybj/Vn2IPcTAaX/w2OthtX1eIgReRSEcWq+S\nqIi5\r\n=TIAp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD75gGvrOOucK52aFgRYrgZL/ufj+/CyYSqTcIVlPMSDgIhAKOwrn/iREHb5b8VjTOLhDK7YrqXjo4Qq0TouA7J2Dzf"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2j3gf1.0_1604441594806_0.7931723730754106"},"_hasShrinkwrap":false},"2.3.7-canary.kh2jnpxg.0":{"name":"typedconverter","version":"2.3.7-canary.kh2jnpxg.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2jnpxg.0+4a91ba1","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4a91ba1f635fa9841f21b333722d6b035ee5991e","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2jnpxg.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-YyFWP4VGQ6FW3cMwFTQUfrh4WMaTogN9A/gDATgAuBGQCB4Pd+Ec3JDs3zaNH3leQMgpl8q3vroR/PMexM2D+Q==","shasum":"35e03d26b90ec618d31265cf2453bc18b2d4caff","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2jnpxg.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfodmsCRA9TVsSAnZWagAAfMcP/RoXqTSGJEMigyQSPg8u\nKltV6TF6XSB49Xdfcr+zAhXcTxMPZ9lYNGgZSVu5sBZzvwwEuAGjBJMOgqNQ\nOCw+e7DOI1nqfy+TlfTaZzbtjZRMaeEwN+rE83hY4J3If1BXLPWJn6iW3QKa\nFGCkoGUD5YVyHsnlpfx0TKhMNcWV55O2jqt/cCXMBKWf8J2kkBwGzTpikHsf\ncUzraB7g8u5MSUZrjRFr9bhOyN+eLPCvp/2ZKk5tSHuX7rbUSvPdCkTgwpNN\n/cwbkFjzHVQadwJ8W9gDjZ7cClHv+f6cOwirDoG2EnqCcQ3VGH1+96mUD+FD\nPTS8zT55fGw7nUFg+inmJ1pZRrwsu839x/tiXq3A18i0oHvGB1tXrn0e92P3\n+8vkhc7jwCdsv0RV6Hds8oHZpzxsbK43UmED/AAgInCQugUn3IUvcU+0iULv\nUABUcaQ77mQQWPxw6CIdrezFUFDuBeh7x6KhU76eWuigOyQWmJSBrd0cvcAT\n5NJAydPsL6OurZLy+Su9cPGwIETf+X2FNnCpQaNA/5H3gK6eXv0H1GXp7Kqc\n/TetdZ1YKZ10qR+lCGYv8Gt6iRAuTiS/L36NLZ73bmWq0l31U4K9plbTeLff\nJ7pQEW120LiWf9YLTDCdx5SL4PlGy+mAOQEtFbmNbUtJI3HAlxjioxwnBQWq\n10yv\r\n=wbkK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6Xo/V/cTq9E5GucidWzLG4ocIe34deC0I+pAZO3th5gIgZGg3DBOTbt42ZqP5pxXhku4pj8Rwu2bfqG7jp62Vr1Y="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2jnpxg.0_1604442539989_0.8808539362452339"},"_hasShrinkwrap":false},"2.3.7-canary.kh2k6f0d.0":{"name":"typedconverter","version":"2.3.7-canary.kh2k6f0d.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2k6f0d.0+e05c694","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"e05c6947ff7d10880363c653710402a843e759ee","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2k6f0d.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-W2eu05uF3S1gxQhp3MNIQnnDgMs8gV6c9dlsU6Ov7THe4oESR7tUqc4beqEVyml5g9/Ibuh5gFt6OSvtSudsIw==","shasum":"11017a72d23e618973521a2ae2a31c9d2a0b8e01","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2k6f0d.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfod0TCRA9TVsSAnZWagAAc54P/1u6zD29xcMhWpmDwcDX\n0YHL5DmRS3a4bBwSUi2TPk/ZpWWeq/KO/7gDm5FUxXP06KE3aWU0+EizkACt\nsyhM3TR4ANhQ4UmivBkzIzi3ATkIgak8fbohwPk8YavDRLzmjICopex++WmF\n8vvbLIHfIqm2bpOkTS3Y3OmegjLsWW6v+vmPOgurQfMFbJqZt1qSMw495uRh\nJP6wugocg2iFBt0Bq0gA7+zpjq+tnEUT+hPYA8kSbwE3FINKITrg2EwwcHKB\nOWlpuu0U3si31co4AZNbsww1XiNzCLRjMAkkFJVe0uDnyoqvNsjILYjZKwC+\nxcyV7U1yoBKMazIxDpVSDFY5DjMOlY7ITmf9k4MlpoqdIk7QsxPVhbWWeozT\n9lJ8l/EUnjBDKQlippu+6cbnwuBlcipBv8XtJh64vd153h2jT7D8nEKtbM0f\npahtG7irPoJE10nKY9TG8l/X58gblIeyPjOLBZ2BNglILcQGJrg/ouJvvoj9\nF3+psgwDjHayuAoREP56q2ytgRz3iJhWpQN1DP3PhAmeFQh6zRJop6r2Ikwd\nNAW44c5tLUejwoYBK4N5C4f+gavIWp4gfDly7T0GWG4saNLf11Lo8sR4wdmk\nvCtKaztxdhvVaLLp69lRuQxkpEwzM4dpPMdTrSbKmwdP3xhiBJewV17PJwX+\nyMCV\r\n=pHVI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgsFhWvVLfMjlawHujIS2gDyce26SX1qCHs33AnFlWfgIgeR8QgdeL6Y7FoFDZvuxUUe+uX50lU7AeOhhH4Nuv0Jo="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2k6f0d.0_1604443411365_0.5773513003398689"},"_hasShrinkwrap":false},"2.3.7-canary.kh2lwwtd.0":{"name":"typedconverter","version":"2.3.7-canary.kh2lwwtd.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2lwwtd.0+1c0f97c","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"1c0f97c9b5b389e620642387a9801e3125207caf","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2lwwtd.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-8vbGoK+M/mqGjW7d0AxyPyMvGcjHJY+ly4ry1JjuY9twgCXzjSEAFlB0VdvUZ2GI5jTq97q0/eo5iuRS1NpK2A==","shasum":"10e9da296343c721bed43b2ba611082b002f8608","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2lwwtd.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoeh4CRA9TVsSAnZWagAACWEP/1K/2Cxjqbp1Rnd1bSpc\nGPv9zvalLZ+iqowkfwp/OSb2Wmt1tPZQj9lSkngiftCozwDh/fiMLpnuzqTT\nQ0bb4s3GdtEZZOXQIWor6REOBbG4dDWuTLnrbKYSHCeiKaJoYoFbiqwLGRrW\n+dJSHIl5c7yhd488UaXQzC7kjmgACfSrhugHJdKr2EzfnoAXPpB2OyqoB/PH\n8YQPE66Hf6CevzmhBxWtLBpC9fXD2pqBPzh4ZFz3SMcePwzZgn44lUuP6hJx\niLNrqzG+Y39GODYFc6M8tQRjHdbXeXZJKwpiWZ98KBSp+8yFTDJu10lK2yQJ\nDYfd8JiiOe0h0QunS1c0B61QQj/eZa+QwJ2nq7DpvMa3Q/xxI9aPU8B//S1W\n/QDFPpnfJNRShk1sfrD2QNXCcmXVnrH/Jbo3pAO7OdxK5WLY3Yew1ycSTSxR\n43oXF/mFlLfCfYqgpMf5gWRYhlLnTeG90lLaccTjjGYmj8c6/RrA8GJrBDai\nXTqxg7+z0baZdFX9q9aAnKWo2solepqkRkmpRUuWKL3IGOu7gzFZ0z8Ncw1U\nx9TgJlUrV1kwSzv/pGOfoSGXX+2e7/kAuqu4t3yQdHhtwo92MPIu/88ev1U1\n8HozpVs/YTTePGXzp5yM6Ocm+QvPJ//xNF2C721YAn8mhOGuaaPv9+t7ujW1\n68IH\r\n=7LK2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzZbtBtlfe9CASy3z4ffmgbD2lWm+2V3sS+99InuhyTAIhAMLPCCEP8ftaJ3LnFPYX9ykOBHN3u4QQGHXKYPkrObVL"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2lwwtd.0_1604446328039_0.568820873540228"},"_hasShrinkwrap":false},"2.3.7-canary.kh2p7j3o.0":{"name":"typedconverter","version":"2.3.7-canary.kh2p7j3o.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh2p7j3o.0+61f99c3","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"61f99c3da556755615955996608b0c00375f00d1","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh2p7j3o.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-OHxy3Y3XJsdXHCdNaHV+pDbPW3NLYPI3+14LSWc3AGApj7PM6AEp2N0C2g8I8l5cT5Oyo7/KezhBhdmpkIJtMQ==","shasum":"f259879eed081fafd81e3d06aaeab5110e09abd5","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh2p7j3o.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfof4WCRA9TVsSAnZWagAAJlkP/jfHi4KoW2aEnD8csXF8\nstPpV6AYAIRYN5GvU9mWFK+nHIyvRS6q7uAw9Riboyw++USf2lyOypwk+E28\n1MQDpELiZOmjO9ur6y1mKcmkmB1fTViKWbI5EZwh8OtSDefJbNM7BuLNVDVR\nLlP8eVoOGKHr8IYUEtd2rpFYI88KwIpdlrKwR6R8OkpPhFDmgSuHTIaOmxxU\n/B6rLGr3BtxyapGAZtNdRb3+UL3czVeyl5w4Dd3e2StJ/Sm+N6t3tTWXryCL\nhYOMuEfrOXYFrDmRH6BF+de5HEProPwzTlXp4ZHoDt0V3Il+YVS1jNGI+LHR\nd6+4TqbJREHy2s0PUYnf+b7ORGEVxHqZVK0pdHX89I2NtaI1jeuVooWSRNrW\nHUk/CgzDtWKYgm8VT1v82kg95ui+w3EXI5Pv8nVO0njJsUKLAisCUfE/ggvG\nouz6Cpl2DyFsTMKIQNlJ46+jMOkfaDdVhJOUAVYtbii3O4SNARzxTGK9LSbL\n8I9+T3wwTEB2dgDiglS7PWCXIouDDbrWSWojACfuiLfBAYZFDnx8xXfWoA9R\nM1+0OTJf0fFZ9kqfHrgg5qI5Hc8Ya26p9LmEegeK1aSHJyEJPfVh8pF8GNbT\nGB4+Tzx7I+OryLtHkHKYzFtMrpfKRhSPEJUH/yBnRL9EwSkW+hO1kLws9/m5\nna9l\r\n=SwZD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvqyGLZcu344yQ0xRKZNZlEVa5y4JTUkqOSqr9zbYIigIgJpRvk7YEomZzrla9G9T0Cekm3sTsV6rwpUsVyDFZp90="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh2p7j3o.0_1604451862001_0.16538832735542464"},"_hasShrinkwrap":false},"2.3.7-canary.kh4ew4ru.0":{"name":"typedconverter","version":"2.3.7-canary.kh4ew4ru.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh4ew4ru.0+22400ba","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"22400ba78b7072b66ec3fee2eed9155ac4591d18","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh4ew4ru.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-5/GiKpO5rOlu/UMO9If9zYjahTOuDIyvx4RcVYQZjKfL4L6dP1gDGX0VzKXkoY9gfvcGzCRseF4kApnT/ySLxw==","shasum":"9c50032633e13fc6ea7071f28cf454e5b77779b0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh4ew4ru.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfo5LMCRA9TVsSAnZWagAA4FYP/RSGx5+C/PZFHYuvRaXF\n0IkZMenpy1S/CDqEi5kJh1qGw4G5Xl6Jp0Pw8tyQPKWab+mxcOvL+Kztbouu\nazq0X1czhYWf4COSajC95CS4Nd3tFwhjESs8SLh8x0ghqPAwedd/gbGCggRh\nYbVmxzVgzFFT7XYLnX2TdI5hIf4k/3V3SK4mk6K+1DbWnOKG6XYIpv++xmXN\nMFOLLsO0aIvv2aZEJ621dMsK+0OJQoWle5P9c3qG5QOl63TT5rvcO2Sre+KK\nFeyaKuhXpk74I2GNPiO52E82OSSLqR1hBRk7CtXZaFPIJBt2hRbVDgwO5obP\nGJleAdVk6h2P5KVPYLKr8t6Vp75bhj9j3fhr2NJpJrnvLA79kZPTErhjgTM1\nVgT+0cZ0SteCT/GzMnDVIfsE1yyXMTnxZ/8KV/Di1vjOgwVVhBjPdXDtgftU\nsm6SB1UsFd/BfamJz800WppOlhfSZpy640M+5c7qwyg3UJSiyRjQ2LbBi441\naY1nyEIpMRGh2Z7rlX8dM7o9aKDX5unvtycS4QKH7PGyNmWg1pA2jNZ2Ruug\nYmVbOkiJVlT6UKL3iTpuwFQ3K5ypdYdN0G6d4TmsEQ4JBYRia6wRSgo08BrN\njxU+BuM1tH/YXS6GBrIOiCWQy7ioPIPhOJ6TlWx9Bne4+k6HSxeVGs1/+0qm\nD7o0\r\n=Cj48\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF1/gMy5DMXT6EkFKSjrL3t7fsjJjRPe+l41KtPymxYAIgIecm4VkBR+azX722ltDFhOnD6gOvczOWK5RSifE79WU="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh4ew4ru.0_1604555467892_0.5155404663324001"},"_hasShrinkwrap":false},"2.3.7-canary.kh5ddq10.0":{"name":"typedconverter","version":"2.3.7-canary.kh5ddq10.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh5ddq10.0+495963a","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"495963a7de73e2c0551c46d527032ee0face0ea8","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh5ddq10.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-hIjQSIQqOJlEzUF9E6dr5MSFg9V0p/aOnlpWm1yQJSJuCpa3XYNyiVJlwxw+KGpJBtJLJicZHZ9vLOrZ+ejQvw==","shasum":"ebf7be912453b0e55673a8ee6c2306611c5ac7f0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh5ddq10.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpHUVCRA9TVsSAnZWagAAChUQAJN4L6kTf/F0MGG5tIMT\ni0RgsymrKcy8aME0Q68aRif+m/oMQjb5hQ5e4OrS+Ncc9KXtRHB5OVTzKve0\nMugnVFi5WTgUge5Ph1z03YF1+ZIODDElggG2ktGddGEXnnCHg8g9a4DOO7mR\nPRjoWP1VFCukPuJdZuabV7buPJHiveE35vQ9pDWLuKBvn0cwIbDH+gThH6nO\nRTyKeEuTiwPpjcmyeP/2xxG6qM5IV3iE2IFt/e2xsipzHlDgh5NF7Jnxf8rI\n4Hp3EXy8SZ1Jxm4CMYYM5U7kiOMX9LyJBqlHCOQtMY0g9NDtjQsr9g+UOJ0c\nYCikC8swvhMAA+Az+ox4k7fgm66x46IwzVD0oVTF5d/aIIyOg4yDuF2ziBJh\nZgY2EAn98C0MwpzHxZGDWyCNh9QVAroxFmler6Z36LnLEf9j5jA6MVyB4+OQ\nIyYZzHhO7rUdxryUO8EpWQr9CPfuqV0nZIPEMi6Eg5e6dXcIu8d5yuJ2bmpA\nntkEx+4OqGCCrWjJ2WUqgYv3lsefjF0ICWHq7ntXW81RlxCwOJ/tz84UMle8\nkh98dyLzlUSOEkznUrEmcFX0hxyBAFEwNIzGKr6eY4x//InPi7N0vZ4zoD5Z\nb4kUJSTZuylq/JNaPGoSRig+Z2KwdsuW74lcsARSYM2BhqtwDivMKRK5G0Q7\nKwCL\r\n=K1F0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAEa30M0KpIPjJ/lYFnOw05va75b3KbOxuWMdc4Sok2hAiEA4+LOOtZSPEvW6gRxPMpYruywZy+oZjSKlrTka7F4knE="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh5ddq10.0_1604613396959_0.7643778687966063"},"_hasShrinkwrap":false},"2.3.7-canary.kh5h50n0.0":{"name":"typedconverter","version":"2.3.7-canary.kh5h50n0.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh5h50n0.0+bd4dd0c","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"bd4dd0c3cb7df9e61614bf7202dadd7cf7cb8116","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh5h50n0.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-dDZfNKzU1acFuHIXXdllS7uJceAHyHzjWFxEuLYtjeE3hDYvVVRGGHNv/EwEyQPAWmd1BSvwNC2D9AxUsTqXmQ==","shasum":"304cc90c83a0704f1850a6be71679bae321624d8","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh5h50n0.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpI26CRA9TVsSAnZWagAAo8YP/3Up3PMGcyRw/hojo3Jp\nvChihRvtbg7awZ0aiYKf0Owb06fQnOAmIFzDGulhmNkGQa3WMjd76cs+4n9X\nUoRVi8RGwIHc/H83GoD88Wif7U5t5Q4RHxGaD6WHx6KNwYvwUZzscz7pwr0r\n9Guv5nDRzVhUWmU6Ed301Yc9EppQBg7ddUAUEskjyTW2ZRqvogJxlrk2YlF/\nJa9Rn4KW+6k/Iop/Fz0RhjKOwqzJYOFFVAmskcAwzHNvYC1V/lVBiM1bfgEO\nRrazlDuZ3rg0pBCtNCOrUq3bNfQUNmCnGY1YQfFn7mDiHRocuHBFdtrWVDUy\nuNn6ZuUl9/dBafJCJ3FPIOUiizJE2m2FVuUyVvPJ1K8ZAf7ioJ+vzspaW/gE\nzpfWKyOtOjjwcf7DOd8J7T09wvuh7p++f+X4xPcz2oyMD8qbbjDnL1YcAxNY\n/CBQ9uTV0m3EAo+q+Ea8UsJ2eGy3/LbB8HS3YfD3K6k/9z/xOU/7KCxOFDDA\nLGKH+GO5hDLsDLGjUXs4pqrioN7A1mCPBTvn1HkvX/pvrFSX8KqqgfF0pbVS\n9HYaATK90nKWAUrbNLBMORVzmIq2irXBj9MtJs63eEK1nB8CJiCD2F8lQ9wM\nfmCa5ezcqv1XUaO27XnlO6jVRbUbaKEHtc+KYEATcqC5IHpg/yiifbWBB8I2\nl2co\r\n=ya3O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnMOKUSY1MX3/WHgLEodCmimHIN5qeofxXhQeZVD6mIgIgS8FAAj7E50TubhxKKh3Yqlv02yfSNp7HO5hi1SlpOq0="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh5h50n0.0_1604619706415_0.4349429540401806"},"_hasShrinkwrap":false},"2.3.7-canary.kh5jla6k.0":{"name":"typedconverter","version":"2.3.7-canary.kh5jla6k.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh5jla6k.0+4e64306","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4e643063666c140bd0bc7e5b74d999cca6d507a3","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh5jla6k.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-K+E//AupeSkf8Q+csS3kBjZqDDSpZliGhtF3fWK/IgwOzyOkEg9QgGR4/SUjFUtIljb81dpJFiD9ZckTbqausg==","shasum":"f03a438894431f8306699001d6480b5db91c4a49","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh5jla6k.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpJ3RCRA9TVsSAnZWagAApp4P/0c8oDUFW2fyXzplYcy6\nE4yVUq6kbkOUmQeLoGPVkfMOq7wQihcV6U6+t57LtTQjhQe/5q/eLkgWRCiB\na1Pyz5zRP+C3c0OtPAqx9upRps6hbewGVBhgjlZR6DhhkMTj/0RHfwrlfXL5\nwvNiDPJvmtYpFuQfLiXABH9bdloXCYhM6DXi63pCIZDXZiWvRX5JmxHbgD7k\nnUe0pa3d5Wb1C/8pUDXcMEE9jnzOrWMJq+4w68k4q9JUis2JmJ3mVg6LH4WU\nwcsAoB86p6cViK7JzbL+AoGi5VBHY5bCwzQOcsI+UrBMyNXcizIsAc3m1vm1\nW+1AsJ2uCQ4hOD4g+PQaDYK5uoZ2ta06rA4KKIDexIh/YdwgjVo3jaCpB9NU\nTtoyXtbPAHcHKrgriofm5jFJhGLatpbCkC9QEi8L2J5R9mx4ZUqW9rGCHVYi\nsfFXVuLkq5m3FJji1KYPsXQA9Hf321OgRia0U7xMRHO4ZTAqQyN7zrg6pm85\n3G8pjQC7Xfwz15iR0Lqae3TyFyE4+W4sWbRW5JkyTpMDKWlfYBp5jbnDsAMG\nGjniw7AU4pBN9boO9bIWzNEveGpH+Uo20epJBZpTPH9bwd7t1gDCZwg18dS8\nEf+DvwJTxQmtul2gAzGJwrRM8pizFzKDY2X/IfSeDBK8IntYVdhIP0syVsYI\nGqVh\r\n=BDd5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9yhv2CqhSo3dQ7uAauSTbC8NaV0J97gAsjgcovvxa1QIhAJS7hPIRjMDxq+z1WQiA8Yai5rqYou6r+FJP+NxFnwty"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh5jla6k.0_1604623824722_0.027824367829981433"},"_hasShrinkwrap":false},"2.3.7-canary.kh5lyii8.0":{"name":"typedconverter","version":"2.3.7-canary.kh5lyii8.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh5lyii8.0+f1d8fef","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"f1d8fefe024a7c7567f66ab76c8a14b242cfbb84","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh5lyii8.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-d7scz2VXeh1EhOx9n/S4mQY5d5R1Zlmud9zw4SLMeAuf7I1OCGVXQ+76FDoGWLxlkx9VsNcpria/7Vytl3pz1g==","shasum":"c05042d07b50f464c2046532020b07f47b3c4283","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh5lyii8.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpK1ZCRA9TVsSAnZWagAAi4gP/iRXqZRfBqz0NK+8xusu\n1JXE9ngq3t0SUWhelJ6Iy7QluYUCZ7elZlWEjYkX3P4oEV+p1QJ00PyKHA1B\nUHhkQ9RSr77mExlsNAeCbATE4Xt10XBz4Eq6SMlCzxY7upQ87buZ58GMo0+P\nUr8SWiiewtfTeMS98nw+v2hDTt7Mf3mHSEePOtE/VcT4i7hhgW1t9WK7ncPH\n96D5pyl5qqz0MpyY1X9TpYgwv6toAdOraZOmifCstRppicuace4qSPpUwgoG\nddh4TXLx2VnXj9qXhYOqOS8hWR35rbxtqNo5jivGzOrcctNOjcwvV2JNEsoZ\nG5y4YglX6JmP2J/2XQtLgUszjPDz/dD1Ou875G6GiAwsCEzGPgz+K2AgdfYW\nimC3uSE26iwSJmzqRF4c9HSsaGXURPW+plAp6WxxWm8LDe2xqw8M3oWDkboY\nilDGviRZ3dc/RXz+nFJxUkh5S+twFJF3KUbe4PVaEit4H3vOViz7Arh56WdT\ng3jYC/3/eck8WU1AKsfWUSoGVDLiwxvI23acxTakjWLdA53mvoZmoHu0KsVp\nNkb5jgJVHV175zdqbo/DP5VesveopeQOqXTx+sUUVvfzkowJx9nzj34qNOG0\nLoqlXuQ66rywPdLyRpvmye9hScGna7C3ylfLE4bFEqqFzVjYi9DeVyb6TTw6\n85D1\r\n=R4cl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8nwbMk7qxhWY1G6xgwi5bZKb0EHNW8604kOJBbhveMgIgazm3i22kjNEIxJtF4NazLK5pfhUd9G4kkwZs19C0zLc="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh5lyii8.0_1604627801132_0.9112498346041666"},"_hasShrinkwrap":false},"2.3.7-canary.kh61az31.0":{"name":"typedconverter","version":"2.3.7-canary.kh61az31.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kh61az31.0+ffc0ac5","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"ffc0ac5f47893cbeb596e62ed5b4fb37184431f9","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kh61az31.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-fj3W78W2J+pMDNWTJy7O3suUIkN68Gfoz5YyjkHH6+H+Xo8VYh8/s5gD8PyGKfHPtdkUIEuklJTCk6OWB5c+Fw==","shasum":"a73ccde7f0adfadc9bdfee2fd68697fa6bebae55","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kh61az31.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpRIKCRA9TVsSAnZWagAAA5IQAJU5AZO/Eo8fxj48G+0J\n485/lzYqfpTWWqltaDq0dOiaAnd8uaP/AJOJAtNOZ3Z1V8xalRZb1qMPdSaU\nVUhgW32GI90t5DfJc4N9OUnDkuxZ5lrpbzfh5yHhIojWLlNNrTONAQTKNaal\nnuosDdFYlpVHH4jC5UKI+79YMuPMFbl2eJTISGgAH8wonhxVfUlF1zDn4/In\nc0CtDzVI7bLTLTGovI0imlJvB1FSVpLcZ1niXryVXV4qm6yxwBbeKosorr4M\nxJ0y4crKJkGqliub9NOY9sh9HLu7L5h0a7cXrZ77HxU9viab5y1XSNa66L+B\nX14ZNi0HCCvHdU5wN0pRhc6RTIldczI33hM7wRhYjh0iCksFeqf1sPnGAKEg\nofxJUDZY4JkRhKd0JKaHw2pM320RHbjZ0AgB/VMCgk3rfe+GNoeL6mFz5M3n\ncu/Q6/tBPDUcoZwg+uPudXtQSCz4YzE5OF2mdhGEx2KBu2qFPqG/QQEjPuvJ\nVKcbFNDrh9Q8ZcUoHSvNsHArFtugRBkjkeQaGxvjyrvmQ7PTY8EPThMB9fHP\nnttzROiXE3fuYuLm492lOt207nDp4ZA2oJ2z5YWJwqMKNsc0nXc9IUpNA58z\nG/xG6SaAKl8diOgVkEHisDWzcm4v1R42keuiHeZ5AtO/7kMcbLtQ7rUR+XQJ\nC3is\r\n=St3N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbbfYzDS6Q1tGDzyybv7eDdLVR7hsKhyNiSY2BRJ1nsAiEAuLNw/UpLh76weCECNUYgB7wM6YkNe3mcJGGJxxGmEq4="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kh61az31.0_1604653578076_0.8074158225512518"},"_hasShrinkwrap":false},"2.3.7-canary.khbdcr5h.0":{"name":"typedconverter","version":"2.3.7-canary.khbdcr5h.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khbdcr5h.0+8cf40ac","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8cf40acf9659f9d721b395d57b1d6cb7e3d22343","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khbdcr5h.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-mTFWFIiwa+vivhnADhqwh80+5hoYZV+nCZCbnvhS6NK8ctK6lzlRk1j45A9vEXVE1e4KPCFNX//skSjeS95BLA==","shasum":"ac5b66d0f6aa4b45d56db9fe8fcbd7c2edb5c14f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khbdcr5h.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqf4TCRA9TVsSAnZWagAAj6wQAKQ4e7fSfG8FGF62f8xv\noU1kt+0BXrM6CKDOhKTyGHx20jp8LL8WWsiGPLsmXajyVI3bcY9sSYFlodHJ\nhyoHnSr/Ibr0LP2NZbTsVPDPAim1TxssTZ2C6Ppzau3lpi6GNoxeXBqaxNDY\nKEhhMeHi7M2Vt5xHNNl9+2Yr2zcuzHWKvL8JZigq1HXcIUY8KVnqawAns5e1\njbmSk9AcYYx+tBWycM9I3qcwPesKPCg9Lr22t11Fl8Ftmps9nG86Pxd/XV6L\nv1C+p3pdSZo36GzQDZJ2Q/Ul4YdquuPrUzv4qnq83R0xjHc6FqYUGLiuXwvb\nfVIwunLNDruAng3p34B/XLk/deKBibl+4iqeoVMXHhD6nJiszd4qMSyLijYi\n61wQEwbL66BlM3dgWC+f85PagP53Hq81I5pd9xQf4/IrwwFBTAjYPoBZJEGb\nuPgMFxh92B0aI1iKt9cpTw5l4ShP4uObuxsNan/V1Tz8sV4PmU/OA/B3s7eG\ns9lfgQr0OXM7aMGMzPJn1rhFqUNVHKBGn7UtY4HAtPCDcMBhhXyZg3Fzx+DO\nO13g+LrxzOeT/lJCCs/3kuFbzaRFKdbCJjaMuudg2BFe8KK29iDhWRhH1FEY\n0/CeeUY+EQoRXwcOzFu84VT+WkzXq48dcrapVDDyYhd529IhAEYp4ANXLFT1\nQMFL\r\n=P6gL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOnauT/LwXxha+kuTPClp1AOW+/Y5U4cJCNo4h3ySYRgIgDYGcSYZCs45tZgtCtm3rroOX+XT25qiEXrVIlo63/Ik="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khbdcr5h.0_1604976147442_0.9844872939007645"},"_hasShrinkwrap":false},"2.3.7-canary.khchhyyz.0":{"name":"typedconverter","version":"2.3.7-canary.khchhyyz.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khchhyyz.0+2c92bea","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"2c92beabb1d026fab857e78ea3c88ef1e15d832a","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khchhyyz.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-mH1yD9dOiO4HIB4uEaTQLuCKCFDyL57mkbD7yacWLomGenRxQqSgX2S1GGQLxyWFrX8zW1wRnFbm5hWVWZMQoQ==","shasum":"e9e694102c0c5ff555c229be4e204fd9e88583b0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khchhyyz.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqwV2CRA9TVsSAnZWagAA/l4P/Au/nlwlSz3xUw39GhZv\nS60GeL5/WStiJHTpWlmX/a/J26M8UGGCGiugz9WArKWJxnF9l/PU2MLI1xZ2\nS7gAXh8oROM8cUw27WH3JOO6zAYbTP4lImIvyhEV8B3eNdYdRr3xlLyK7e/J\ndDZX/9olyM49+O3L/dji0BQQl91q4LArbhcgZzjPtT//zDIuvfweaUUB9i2J\nJcDgZfyHXw5LgRbGcrqw3w9pnPljyMFJocHnT/mPa4TTe0eBd785ocY5KggM\nhDKAaJfFHCmw13MUKH6u1xCt5D+Q1pEq0I3KlCErDdGOdhBO9nVGuxT0EpXY\n5reB4eW3JkR1dZu2zh99Es/bYxSNH+lOhfvoui58fQXUQ7PMVH37ibn2kH2F\nFx8VC0BFXkQ1Ph86ZdZI5ECOxWaklywXoBHjA4LBbKi517YepilFyPhavYRi\nVXKFN08KpJ/NCZCgAFnyNeZLNvyXaqqt+RzmLMfQip3ELplESZOCXaw25h3x\nMdk/lq57+SDt+aviRJ/Qt/YerjuCPalgYdv7Y1OSyyPbR9+/I1wlvvGk4sRg\n8/nWS/slWGGlU/s117l0K1jW1UXdygejnClKD0xtrg9Rs9PvTslJStBoB5ib\nLI96ZSsfEBEeprUJ9yjQYlCVg9NLXJji1kc+cyIoV87gtDmMJhtOako6A7Ey\nxAqn\r\n=wPbi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8Up/acDcad9He+ASXbzMLMbcKTABDWB0Ohb79qZXNYAIgMV9j59Xt/KjzHMiDhiwYf0iDrwvb7ZNG3CGfV0MGISc="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khchhyyz.0_1605043573960_0.2547116740663451"},"_hasShrinkwrap":false},"2.3.7-canary.khdxsl4k.0":{"name":"typedconverter","version":"2.3.7-canary.khdxsl4k.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khdxsl4k.0+aa86213","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"aa862136af5fb25886e857feaad7bcc05087ac12","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khdxsl4k.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-lSj7Ad/H7VheejpZPL3F2WuADyw5mha90alanqKriwSGkvYHbUf3ncOpV2cXb6umM8lZWUkvmjQg+rNQMDliLg==","shasum":"1b682123892fa8da52305bdb5f52dd2fddaadda3","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khdxsl4k.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrFySCRA9TVsSAnZWagAAqloP/2UAXpGwCn2dLUMynJ0l\nVN196042+MLEQzC/+VT/M4KG0qwSh1HrIqeMIYxxNChQeVfVq9q0zv4BJhr2\nU0kIz1ImD0rkE5pbiPRD4UNwIIcMTW6zDOeyBwWyWRbrWcWvTtQl2U4bpxEX\nbZypGiF5Yn6r0kJGJfs14VElTMH0nx6VERUeuztlQs/NrwctI73DeBlz0LCB\nScpWHs8b5FIYnT+GhQWqqM4eMOCdacECYm3oeqO0dHcv9H0eV0+wU0X0kf4y\nilXdfo83yV9/8F88pYTV/SlQPtoSmlCN1QtImh+XQCZM4qhom1/A6kzTMv7s\n1tMJxsWDC4xflrYUR/tPtQm1xqvE2UGVPHtc2/ws2mZK6nAReOJ4/gMvPjGj\nYyMycA6GXMnTOGF2LYEomwBqQyitLvrJ+c28csU0dGdKgCfcCTLmhUVhbh1Q\nIxlm1Z5jgby+Xq751Ak1DUAVx3rNVlA646cajXpYs3dGYTXhqq3HyJDmUbrq\nPERM6tc909VcegaUlvOehlFCcnQlj4vzqbr/J+QNFsw6Po8Pw3lf5ZZ5Gd14\nwLcjHcKjiVpASDpVwo1LldLEo9ROOireLW3TSkB0ys1ShgnWGPIeOJre1LLf\nqCnMITMq/nRD+cVlIHg2tIHDKI5XWJgh4Y4Z9ne748HhgJB6rjlJMwnZ0fii\n9W0s\r\n=uxEu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsvSV5VUQzEG6LPk9Ku7ztVHXRVeaJlvlNDjcXvgZmVQIgGasACWFVhZ7yooBhy3bF6YBwUh78iGaC88a8/A2XwWs="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khdxsl4k.0_1605131409632_0.8366176073731972"},"_hasShrinkwrap":false},"2.3.7-canary.khelfoev.0":{"name":"typedconverter","version":"2.3.7-canary.khelfoev.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khelfoev.0+8bbc781","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8bbc78180abc7658b87037719c1e2ca5104da79d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khelfoev.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-3TpUhKfwElbE8YWLX/I7fM7f23Y0mMPKafWCeXk+zlgcB5of4aBrD9/lL27Vs1Oi2kdBcCbsKYS3Y7D3L9iKIA==","shasum":"cadd57978cbcc67683e87c6fc6d6f91557d883f6","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khelfoev.0.tgz","fileCount":26,"unpackedSize":45619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrPeuCRA9TVsSAnZWagAAcY4P/ibCtryCtCOvGwkrjhbT\n01ImtHQ/twKtFceeSf0EThDyJbf7Ymohw2RAu7Zgnq3duOfhuMxnoVlzA9uy\naV2Trwzv31uFtT5Cf99NoOJo0OR6TrLKfew381pKzTP9vhAeczpNuJsnA8JK\nwoJGau99KCbdt002LLif3517+MULjZxwIioz/5nYsfeYg+ULsG5m0ii5Icpt\nayWrCfR5vskdQSV0NvekEMetJ40Uo51wr1Kj1g88K4n2hOLtonuoDmzqXzSQ\n9MbcJyT0shulrZ5eyt/VuF47joifQdhQKOqi0YCtYP8ohaf940kE1Mcjs2m3\nVSbC7lrSNRlaalOiaKDlCHv+wzkWcJDM5Y6O/w+HvPm53c3JCTzjyWnTC0Kw\n+otkaJja9ODDEJOHGL+kTSJOmq6Yn7lmfHI5hvqQaZT1iAW3PMXeCzhJYWu8\nVJNPF+uML8GX+Brscre38FYCllzjaEN+kURX1CxrqddD3oTGpJ305AGIoJxG\nKKnlGOmAh2yG7VzamMBKAyyrQ5bHF2OsJZB2cGfbHprFKdNXWFiQR6irguOq\neiPdowWViQp0zRdrwImyRzuq1J/INHUjvj/fIi2iQ+tjqtYY7cFsFu0iOsom\nCTOOYQj6Vs6L0ZSm9Lkx5iBl7h25/FxpPAgNKblaB/8RNtWKCct76YqxuZAo\n4tzK\r\n=PSlT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCojCkJSCh9AF7DgvonhX3E2iz4wi7X1tr4tA7f13NKkwIhANLZs+vgPrW4Bq/RCHTCxbAq3Qa7q/A8/me9s/itSCTy"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khelfoev.0_1605171117422_0.0866105877659471"},"_hasShrinkwrap":false},"2.3.7-canary.khg09zf1.0":{"name":"typedconverter","version":"2.3.7-canary.khg09zf1.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khg09zf1.0+321b263","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"321b26357baec80d3e2ea7e85b2704d7632ea366","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khg09zf1.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-tRNhFuC8vgqDbEFhuulkCFyD4DK6+zkdyZ6rt+KzA3dOFadmYCqit8rOY9l7xVviX3s9w9V3pIJagLK7WFKZ7A==","shasum":"4669b69f58a8d4289c93ce3439dd062e77e224df","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khg09zf1.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrkVFCRA9TVsSAnZWagAADC4QAIIwjZtz9/j4A8NCuCED\nQVXWIokDeVatg0qAWzXwbUjMY80WZVoolm6jCMWGmFbMl0VyE7kTsMAQ770S\nIv2OJDag6p/4/cQEV1gVBj/eo147NPhHowj4T/qy6Ct/wjHi/Yi9DuQvlkEW\nVPGp4lsfy78+RuPFXcCbd/AnCV5v0t3y7gdIqYBQ9p6WQ47zlFfPBLIcrkRw\nk2HwHOlPpL7QOeYnBHwCVRS653lBAxlOf2dxyNHmTz0rwQHaqGaLhsZbT+2V\nzzDaLBvMWG7rSwpKgf2UcYX7ZT6qFsFgiy2ErSO36FNN0yBzpKcVq9HPTCyA\nOc7Sftlmn3+QmMj/NBjc6aCpOS/uyTW4I6tA1z5qxUSKz45yutcBOmfbbkJG\nhJPBxzaQDzX2NA0T6LMU3xaHAAsauwEIiiOWMCoWj7ru+pEcSCbzJqUDllge\nNnTITiowVRB1aUGEFf2dxx9IyagLUNADY/gCxFQjmJ5Wm4wUcY2P/Ye+s8sZ\n4IIOFuD7IwGMecR6PEkcug2WS5hMIrXDL8I728E8NDDIEyCKfIk64uh/poww\nKpZB05IiG2x3YtukozSNNZBf3VRdsHEygvMdqoYtpigC00Su2Xnu1QiIPNn4\n6S7Wc2fWNYiwDSwCpk26uP1d99PIvKbweDBCwX7gLS2QH6BtljnTsckDGC0C\nISSw\r\n=ErIO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj4VMm8PMCvHH4uCIsql3YnzzQHoFR6DupouN3919HxQIgacNHnAQnUb27TTe9Kf5PPDX7LaDoGssL5rRu6aboiok="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khg09zf1.0_1605256516882_0.9299504326383337"},"_hasShrinkwrap":false},"2.3.7-canary.khiras28.0":{"name":"typedconverter","version":"2.3.7-canary.khiras28.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khiras28.0+68b4cae","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"68b4caeed2d95cd808fc0c876a2f71a12ce69e20","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khiras28.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-2AlykneK9H8WfEyJjVK4QT/9w4oMSD/3tYdfTmZBhPGF1pBss1yZzo5HlVX6OEaFhV6PKPI5IZsziqLTjNjF4A==","shasum":"d4160c63cdaa05cff5e39978155193549da4e952","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khiras28.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsM7wCRA9TVsSAnZWagAAvgYP/1//vriajjGrdsP9VOVf\nvrSh/PGeN9443Gv4AQ+QdV9SSZk/z5IsLYyhdsjtzgASINzxfQ72rhpI/maV\nThP7SHicAE3ARjF3BZe0SUuRkKAWTfIvbVs4Se+H6STUNg7MFa23u0Ihq8mr\nUnuqeXE3JQr6doC9LBNh1SPhRuazBJHFE5pwayTfQrIuaruUBGDVmsRX43DW\nxFO2U+m/pmN1SO2eoQ0nD0zm3Gj0ZCmw8wo6am95tAAa4GzA3QBC3cswNrDV\n2zdyAV53W0rfFc0BXf5iOWHj7d8IJXdgO2sJi9DC2rF1UGzHuYEpJsZ9T+Km\n+fFEJVKUOh20Xo0mORIira+CCoVZq8iLLuXuUeL6ha7dM81NN3CX0lniT14x\nwSS/efRlQbbjF1skcvKw6MUjHyYPCcqamXErThSz1qPmpzbOPbA9eKk8YJJi\nprahGVhxNQtK5MkLAHYwiJlzmppORdzUXrpoCpT0n7L3KrTqtaJMcv0w7xCG\n4ZzUv/ltlO/LImawqE34gYdzoNOH+miUQmYAO2D4/KPOWiUv2UXPGIjBeXuT\nhJ8CFzg2ojgjHPZzvHQbq+9UqWf4R2Bjblpw7+TneqU49PvKrjeAeTvblZ3L\nSayCOuY11lZWUPGQCf5oVD4kFqXgzbsmoUWGLu8GQfkcsTz5wL9IRfS38T50\nJlZ/\r\n=T7Ul\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKARmjEA2/TroLTQ/OP1GMoJNuTJaxrP3qBpS+o5XWDAiBpoor7xwTjLN7j3DXBVpdpgDmASWQ/EpaN1CgJFSmqJw=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khiras28.0_1605422831475_0.8992997164827525"},"_hasShrinkwrap":false},"2.3.7-canary.khy4xbmr.0":{"name":"typedconverter","version":"2.3.7-canary.khy4xbmr.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khy4xbmr.0+5941bf4","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"5941bf4349c3ebef81a51f961e4a3aaccfcda32d","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khy4xbmr.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-pEQC5Nl6bCefXKbu6JUW01r7y9UMAfZmTTP+FpixiXi8peIUoNxa921DUEDMIo4EQAuwRaPSWVHkedQ6MJ7TUQ==","shasum":"1f0aa1f79acaf5a8cbf6b5bf900909bec42a5156","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khy4xbmr.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvv9HCRA9TVsSAnZWagAA8RoP/00Y8KuIUZq1mFwQRAmX\nL3dRcBjh5IJEr3TWlZ8Pvib/pBnuaVm9MnrbQVEErYew6prAvpBJuyRpcrbg\nLsSjYTIC0qRLFE7HD5+/1dY3BUjr8lxxZPDd+FdBf1/5x3Yd1lqmMh2jb5sd\nY4Nhv+lI1MTXgOj37mTXjYuVJ/XuK2N8JzWgOoCXmyn+1fkWAYmftf5JL42t\nHGS55Zadjq2bWG5me1ZzQbsPyyucsuwEuelQK9HOPlRDZCbxDtmZNYkCx0Pw\nXLY2HfohW24R7ym15uKtZQJeu09vSU8ydI22IXZ3UiuV+imEx3hrqdt+Fcx6\nGCeMW5ZfQz9zXeM7WDe4onIQ5qUGUX1GYqoAc5mmPA8UlRwutMk+9GPGOldV\n8N8/0JGFBu5otrNBIrzr8eJ93ifqSnXp7j982vyiGNmlYOGEE5A6DIor+3p1\naxjnLztguRnZF1kyplTd+kNvWHve/BBK8VnDg+h7XV3G9nZqLY29lMS378uR\noOhe5I3YYK6YnuncydK9EHfyBV2OMKZeTa1AMEOTqAKA4nQaQ3zUoIbEevTX\nId9qk62IIjjAV0lwHxtHOE3X83lzT8dty8T/Rv9GQcozrM7XZe9bOrnCqUgj\n9oyct53vjfSxpGABIwJoq0uFeY/CbU3Mr99k8OB4bQvl8CqFEMqRA9XxR8T9\nZrQR\r\n=ICtz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSxHcvOaW8KJfXZ985xoZgCokCxlytHv9/gAHEHBtQDQIhAP22gR7HCETlOKCcIFub42SCieX/h1GCA2deZQfshIgx"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khy4xbmr.0_1606352711041_0.14372041263721425"},"_hasShrinkwrap":false},"2.3.7-canary.khye3mjx.0":{"name":"typedconverter","version":"2.3.7-canary.khye3mjx.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.khye3mjx.0+028cda1","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"028cda16da32c4d838a9bfeae9f1599014432b0c","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.khye3mjx.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-2CQHDktQxLS3w8+NFLpJf4iF2pGn5SdpA1x15YYgjLayiuJXtmtVtJxHuVfDyWlUGvXtI5qvH0E5PUYSKgJ5xQ==","shasum":"5efa273b1b8d560a0f492f8f14c8a23d2b883f4f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.khye3mjx.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvzt6CRA9TVsSAnZWagAAKIEP/jIP4/aRkujkrp41kRYF\npWqglQI3V5gfONRNwH8PmpNYK7wpQywmAsKv0XyIdtMlci+mrcS4EkTf0K1s\nGf4+ND6h2xPgwKY4eU7LU4I9FpO9NYPrYMQbAcbmXqFykQDEN8OmVSp6F/wl\ns9L0vrY84Q9TgZXWsnjkstFts+Rvf/2lyi52ACarbWH7zBDLA0enx6LSeFTv\ng9DCi/6uDIvmG6aHPg3DQ0Sgjp/97MVB8EQKFnoG/BYD328z0fTISbGJICaA\n+g6jkKGfbvo++7rN4O7YEiad7gWVgKt7y1eJoOTCrKdn6lXGwBBrgeNdzSsL\nytgEOGc03gO11pLBugvZ9hj3HmI+UHgBfH6nwYDrd7Q9bP6mON4+fNvv5D51\nO7fnKJE35mRaW8sjkzEdr2w/8jgK1rqPHf5osvxFq4ekEZjN0ZrL4z+/tpFP\nk35afeTiWPXfE6OE6YfQ+gtmmabAfmc2La+C6kPjUOT9mmwjfavBoALZ+5O4\nfQuGxrWGHfCnaJBkFMo7rGv1sw1dlYP6l0+z1Lf1xPFiRHODiS5B/De3MjG3\nsLydL4ZawvitVqNbZFM1oAz9K+b3ocHRLmSkC7gIq3+7FIAupMUzwosZwWWP\nwEBjdAdr/+BpxokDdvdNHmW5zgwn96qoysPiga0UcGEmsgqYvTpT1ubAHpZQ\nK3hQ\r\n=Xnp3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7mGYALNuK8czrtp7MlRws+untaUGu+8PuGZQa4TmgmgIhAJw5JxZ3e0EZgLmDwL0F4dORyCVx2v7YcJ8JiSvoXYXy"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.khye3mjx.0_1606368121729_0.6118767799066882"},"_hasShrinkwrap":false},"2.3.7-canary.ki2idjwy.0":{"name":"typedconverter","version":"2.3.7-canary.ki2idjwy.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki2idjwy.0+56bb41a","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"56bb41ad262bc68693ea9186c2715e356582d886","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki2idjwy.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-eZ4VXLyrC+0BCYAToUdnTEY7P2lTET0ClP5eWClYMyMVtffImxdDHf+v6u1zgcjjsHYlCbrK/w+Aa1eHk76HUA==","shasum":"60a06c16c8e8f116844ea4937e82edec6a954c48","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki2idjwy.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwwhQCRA9TVsSAnZWagAAIGAP/jUmTfdEa14zIHpqLv/K\nXJ9Zv2PqsppegdGHdsKkWFedeOmnFfV04fDjc54Zg+k1b7oAYCSG44st/vvl\nnIU2Lxv0j2iebUNwIhoOBsApqrRuSE1L2w0vEGCMe9TIzGdb1z8vg5TZ//TF\nYFhbgQgXyIwBUKxXg6+hX0X7gFoKjNdkf5QbwwI3cnLdx7FbDla2hGDMIFRA\nGlMeuEB0fDIq/UtuszHoMbCaeE0MZhiKSgmB+xqT4xtdPLEcqmiRxBEhrv6O\nKVi1F2bM83yQGBHRSQOp/s+pOlRHnZmLL6WiqgUoRFQIZfWanTnT9vX6Nnr1\ntOpyyLPyTTwO6cC/6992QpzkO3PzWGdoXcgxwpyumkZV8w77WZ8estPHiKAt\nHTzQfNBpUy/SlBaJ5Az6mh8vTyS3blu/VK/zmZZ/mrct8JAmvSRNNQ4ceRgr\nt4QDANZCi46FmxPucTW3KnwX74o2ygqmKMbKsbudOvTfIUFIQVmXFaniL6Y6\nObyLl+Vu4cZ+N0CUPg8Kw0vLhyPtebMFU0/DV00MlvRIX2RidXqeAGWzg45e\n5Q8b362nzVKpU0ShoaHL/npd9herppBU8cuwhHEXvW7uAbZ6kD79sanpZpsp\n3jSqOmtyXeFlF99tlmTv54eVOj7vNMk5FvOeMs59ul9YNFT42+qnZWoQ9Chs\nF+oQ\r\n=lsmT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1VCIXCk8hdDI39QVbGqR0hh/re2Ys/wNXQvVyvclQ8gIhAKf6vNbv9EUQgRlTbAyEtS2F7WpY5VJb4oMOIEoU+aPt"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki2idjwy.0_1606617167819_0.6132633684549433"},"_hasShrinkwrap":false},"2.3.7-canary.ki34emgi.778":{"name":"typedconverter","version":"2.3.7-canary.ki34emgi.778","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki34emgi.778+7c0080b","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"7c0080bc977b16cf2b733533f15dce836736acc7","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki34emgi.778","_nodeVersion":"10.19.0","_npmVersion":"lerna/3.22.1/node@v10.19.0+x64 (darwin)","dist":{"integrity":"sha512-g+1XsS7oYrBRGkl1GjiDR/mUX6XixYKlbkMy9SonNS/4CkT7F5PCa1CO/wk24tlba2yXZ9QmRck6QezRWYIT+g==","shasum":"c7f91911c8bba1d7879f2c428c681669a36f79f0","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki34emgi.778.tgz","fileCount":26,"unpackedSize":45761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw5jcCRA9TVsSAnZWagAAxswQAJAZRBhISVR8fA1toOcO\nnSQNHF8vFlUv4cI76sBs9tBBXO63YnCNuqlhpu/ITQgKDZJLTAqXBDiskrT5\n8j5/cF2PpZdzQKfC8jNApVsKLQXZRn2xEhGEH+k8szWUFwUBtm0LhRPkDQhj\nDG3gKc6jGDaUC5MGdL0a9r6IaPObZ4aUxO53/JpfORzkuO9ugVlBF8bAHLSe\nIdN3+3kS7rVzFRSAOG2wb6KNFXWVfPUBzaCK/OI/jJZ9OspSywfmr8WPssY2\nmtmw88N5afSK07aww7ysNqRPrFzwQOVw7eKFZx6z7i1AMDNnVocJZkWhx6DB\nhu43unG6JVR4FW3pfQTwfRbpfhFwzBglK+Yr70HShfOIxQpPFqTeGDjobPcL\nK3xxdBRNUxDIr16bsFrd7RxU8vv1IkhHspKzkDM3tEk09BA0EH7I2vBW1Ktc\nzMivN6sZ6NMm7JEkMjbRXxkVSoU6KDJ/Hz1PmWl8AY1FE/Nv4CjeQ+M0eRro\nO7/lQzUubzLHVU3cbXnjUK6k5NQ0eg8i+4754kBpdjMDCEVpAZQH8EhrlHps\n6YKx9Jjz71K72oPh9sLhPyJGqUQaB2lZWetzX1MQ7mBITJEFxFIT8/mRhDNs\nreM6QbSpMelpgcoUnCXVkILgkSExRZKf/v8b2N2F6id2gGYDVULQKOJmxJJo\nGMnx\r\n=A0df\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQiBzkLe8XDGdZWJhTw2qEIwJDGAGjReNQIgIY6kzD1gIhAPNVgOi6c1abn714QJ/2O1hbfj/xmFDkKc7uo+sONbHp"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki34emgi.778_1606654172250_0.10508775199957898"},"_hasShrinkwrap":false},"2.3.7-canary.ki3i90va.0":{"name":"typedconverter","version":"2.3.7-canary.ki3i90va.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki3i90va.0+0a18e03","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"0a18e03d481ff54e227ab4b2774c42ad34164f08","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki3i90va.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-leLRPGXnhXweg+7763R//H4+ZKKJEQwA64hJiwVuclnKoJ8M3lJNtm10t3vryG38EOvMJWddRNjr1A0PUxzJAg==","shasum":"8608ab40bee6ab737ba55d2c0b09dd945e20a791","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki3i90va.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw/OvCRA9TVsSAnZWagAAB4YP/3hf8SZYpWtGTdmowl1j\niQQwfqajMjRfrYf4tepDGN0yImlZeZ7FwRyUXtbgPkxj4ZHNmqrKnuCdU7Aj\n2jbutpaTC2XYMNH6GM8OokwrQc5JAJfK5095J5gvWTM/kfEhGCdirByxzmPd\ntt1jZ1/YKuRQCptrRkyHPdAvpVviipyqATvKUWMkjPByD7gDTKLV2dyFrgdC\neQFbJssZ6yrpgc1CnBg4H+D9RCStTS7aaWsP5UWaTVgB7Vvy0TBnPCrFzLTO\nt4G5C4fB4oINKUy0NuTYTBFt/yqsBNml37g3rwnN5FRghqd8sNIgwu6M7v1P\n/aLj88YEWyeBTfpPOrCbXHPRVtE1C3kqhyabRou6yDvBEszPKGsjTaap0DTX\nHURloz9FIP1P4nZRkleENxonVjSs++TWeDLVa49tk1KVmQybj6ZNzDNR7T9W\nw7hRruZyuKIBw9MytQeJHA/TAMs74wjNlLTnuUmGjYwDAjagYI/K62A0Pk2m\nqDQViWiRhBI2MDvv1Hy0ihkmwm7cDQKTLiyQMaIuyUQp39sP2TbIZqyqAA7G\nvlOrYR8HPnb4j5LAInHRCHxZr/jK+5LkAclMw0STqd2/sDr/Yl3S6uvSGeRc\nVNcm+kBEumwScw96LWKuF86p/+9L8bfug1WlxoMYOZ2CQUkOIBu3F2hI79h7\nw2ig\r\n=7xBE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGyGvYNE+2/u03+qt0Bpx5nx2orfV5jOfVveCqcBlZaZAiBF5ElK7KGigYVgdFWkEHJsMbXzSrLMH9Rgarztw7DWRA=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki3i90va.0_1606677422885_0.39528336992898505"},"_hasShrinkwrap":false},"2.3.7-canary.ki3imu3t.0":{"name":"typedconverter","version":"2.3.7-canary.ki3imu3t.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki3imu3t.0+fe84b4f","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fe84b4f9ebbfe82900620c108f1de20e952749c3","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki3imu3t.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-Rq1HqXdgMCWkLNTS2416ejDty1G5V5/jaM2foTIIZDhDdwJYGR2m/DgoXfaF+S6wiMUwRalKgZovpQBncijo0A==","shasum":"ea1d25f0c692a59ae7ad2d04a57b65fc0792c442","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki3imu3t.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw/YzCRA9TVsSAnZWagAAai0P/i4YKjaDHAhKb3qP4TPl\n/gdXyC+Lntd67rL60/Aw5BjtBVPzT2VEE94jt84FZiLzrlqyQDB1SxuKRBSL\nUGCpcbUWkmbWsdTQAXpLFEyU9QFk2heQCw6gwOU0K6VcR6exmoHitAGImXS/\nc020AHvcvbvT6dLY+AAzKoB7+ORFD9FtsYqjDzKvlux9XrcPC3f16AjxGw9t\nqjvodixLPdWbs66GdZFOsQFQ7yp/vw1PsNQyrmpZbqUyCQi0v+ZuLC4tSnIy\n9zJbQ+zIiLNvXYJ3e2EXBDtv63vftMyXp7OWv3K5gjEl4JMHZFjYQhrpev7E\nOk8EHDqAQthGatCZHBOB9pGW/HSbDo4m7arzHcM15gIsKdAseeRfn2jLcGxr\n9RuQnK4V8Hf/TouvJhwhaTNKF+FGWWgjAVewSg/CKbHiI88WHTB6KmTAIIVy\nGHO26OE41uegYX4ZM6K+wmeUv+/BurdTz6BEWRmPW1kHmZ1EBBXeqQ09ZP7X\nprDzCTmUI7elELx2F6BIU2SW/33GYg5eNNPOwqnG1n5hUomh54vpJGRS7yYU\n2cqWSLYXAjlC/xVI67wPCwIgD6/613jBz/yrFRrsuNqgOkZXRaGgMfNnU2ZX\n3fPN/olnP9q5s0kLGwYhpEq+PsxCv3qeUpyqURQoO1IwwFUSUEF76n0CLtLN\nUrHR\r\n=UE9U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChQG4Vw4duDLcahDehNuwky1vDSUpZvHpwM4wIHmlZOAiBpNdupbZoGqqtHOWDunLHE08OTrYpHdqDgGvYrQPMY0Q=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki3imu3t.0_1606678067126_0.01845872807478255"},"_hasShrinkwrap":false},"2.3.7-canary.ki3w8w7z.0":{"name":"typedconverter","version":"2.3.7-canary.ki3w8w7z.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki3w8w7z.0+d0c04c6","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.164","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.2","lodash":"^4.17.20","ts-jest":"^26.4.3","ts-node":"^9.0.0","typescript":"^4.0.5"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"d0c04c6d33c2ac4eadcd55de4ed5a4d0a4b143bd","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki3w8w7z.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-/5uU7P9xjNlE+bngolHnFow7GDTLc8HxSx5Rjdop6R9hj51poI8xAaiURuvCVK3Ul81EzM4OMdiIwAqXCjQnuw==","shasum":"ff36ebbce9a2ce00b7b5ed977f3fcb4ba2f8ae44","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki3w8w7z.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxE+DCRA9TVsSAnZWagAA6pEP/jsRkgTBbehul0asHTNA\nKqB5mGDMM0GwoUIhslWJg85JJBHTKT8RAQpkmtV9HSRxmQZPATL54KLVaZj6\nczFGhkNPL8krXYygPDupKWby0j46Nd3ILoaW+DIpMfuhO1S7RXxKvGNpDubF\naUcbGfIK/6SZqiWEfTEg9bKTortoH6a6KshzvjSePJ2uSIym8bZ3dZqdA19Q\n81N8tDDoKhQIl4oG1ZLWc4GzJWwu3E440kIIozNdBqzBlszdhFmO752lxGh6\nVtWrh6R+kkwIpbbH6osxhEKsUZ5eCuV7KIlQ3VCv/R1GwUoFofSCsV2+fOQt\nSbXXILUv7fvudbzAvBIJM5v2nVCha3OzbY80Y85+PYLleqkRMyw+LNSBuFuN\nXFYW3xwgZA0ccUKE+MXvynWLxwHw72khzbSa6cj3BMS/SLBI2K98mACuKAQI\nFjepUIC+Ef/uWy4XaBacMJoQzddZg4wNbs05mZg1y9Uu+Av1v+J1RuNwHXaC\nT+y7C3aiDBcTdQk8vocRis4R7rYRHjzeTyBysd5xc/g6ECp4aJOiyIGbs5kU\n77dQH1FkJb4TVKuHnvmFf4qom/XVlKkQAbaT+tAhN41xlxtUcsV24cGGIsxD\nm+uNnPnCZ9tMlHrjondD5/cErxf7W15AeVqjGqa4EMzVfG+Ab4AUEfq2/Dgw\nqC2X\r\n=2Bvn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE6fK27yTjH2HeHXU+uPxrUd7SG1oj+FpiOb4941rpUUAiEA7B3xFh/Qh8f2Jw5D3wPA8Uj9Gxxg2DSHUmPvteWLw0c="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki3w8w7z.0_1606700931390_0.7213169726505317"},"_hasShrinkwrap":false},"2.3.7-canary.ki3x3sog.0":{"name":"typedconverter","version":"2.3.7-canary.ki3x3sog.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki3x3sog.0+e371310","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"e37131074c87abf70db6584fde37777b83588104","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki3x3sog.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-IL9QnKIAlmv1BH6S+RnyfP5UINDWYJjUPq5QYlxM5I4LnMtCuojpTDkIilgpeeDpeQvB2RYiD51au81g61qG9Q==","shasum":"e1fb2728d2b0e20cc856ae6f883ab80f1f80283f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki3x3sog.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxFUmCRA9TVsSAnZWagAAMyQQAIRgitg7AKiJPUm3xMyw\nmpq0YuX4UuS+8KVgHAS252GMmDKP1d3rjlsWYpeI+EOGJh2Ho9jRTEDD29sK\nj1odXyMmsClAznzcXMNDzC8ZV/G9euIdocZFL0IXDumMrdRG131JlkT44RL+\nyq8w4MiQ/GJeYCEBN/xLpKgLW94GBYNeJw+odDrp0lidGQ1mLGeYwtx/MMF7\nU10inafOCFATiqG+RfF1sUA5xx6oDfGdv0ozxh24rMIp0/5RZ1zrbN0bSzVr\nLjJX/uG83OiZYfAsXz89zVvpIxrg26cmUa7YzroY/RQz2oe0Q4FJPV4ienZF\nbuM2nQae2zpXqJ2DjfeYK7e5zGB9X4804bYGkWkQ/daXc6lh4T8iq5o1pf1v\nS98+CRJLlvOikXre2ISKRGMoLMZB2BpWU88HAX6UpCY6Uc6ataMV05U62pM0\nUxQb9dqquJEmofIEbYFREVQqd2mS3oAoMZRmWqECOcfJEus1VlpxI3MKy7+F\nWgRe+yqx4iDJsGSOmI5qh2R9szUq+GliafERuAFDxZiOl0nHLB3EzT1MyYmY\np4Mb2H0I6lk+jrwWwjgFm4wd0mvetfzpe6wy/HbxeNr5O1Qoe1rie57d7Pab\nKKdlAM6uYkGjPJwXTgM1LdKBjqHa5Ukv7Vh340S1RFLbj1gyfLFLYbaDu7Um\nX7jj\r\n=jlIS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEeGoI2DO/F0bdLKEaC7RfBIxdGdduAfq0zWQRIvm+wAIhALYAS/PGWkWIL/eo+pMUjU0sDon7I9ZDibCd8s+AAqRX"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki3x3sog.0_1606702374228_0.6053437847465122"},"_hasShrinkwrap":false},"2.3.7-canary.ki6vxtqr.0":{"name":"typedconverter","version":"2.3.7-canary.ki6vxtqr.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki6vxtqr.0+a931fb7","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"a931fb773dba6f069b38df347f355a29eba54a71","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki6vxtqr.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-QpiD2b8b1N7Cz15PoeNcK343wWNJ30IHUX7ASsmfE+qzPERGU4eNRj0cN7cMDJfyLMzoG2odWUL74gaJ1aPQqA==","shasum":"5d2e2d0c579a27f5ad237b473129e5a221e1fa69","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki6vxtqr.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxxIXCRA9TVsSAnZWagAA/6gQAKSSWbpvHT0PX0GIEQoA\nAMF6O70jJyBPyDTQqOdwxzQFeuM6SHSH40soSwkRNMuHUUETXm9qXnn4Y2gv\neEbCx+2HOJlrm0rULx8E1SPVCH10a8TkubYD17F9ZKDrdHAJ6jJoRX/dlhGX\nqmwKRVakls2+gR3sn/fA7wj7UbaVRRke/NFIShActVz39C1w1+YB2iKYPuDT\n9PxInsfJK+AB9l0aUAqJlQDMIkTlV+tDa/o8QG/0HNr9NaIfibzXm61zSKqZ\nlqjp730BQ971NbRngm/Y74w558QszdcjYLopc1Zb9+GM3jwylRFv1N6WjXbp\nn66QAbGFWGk8mGEC9GTzd3FcXfXfb45CPMgjP9F8G1VqUDX1FZD5ToAj2jJJ\noewA1ib6xzryqdPQO3YT1FTxrGUVY+Vf5+DWAV0CrPSz05TQo8VMbmMaKCcY\nqrjxdkT3EJ1YpXXh3Nx3R0Hq1qiSOshmn5Ce07UGqWerh9bkT2rNLdJgnm2w\nbVaJd9Cf/cL7M8QYA/qsciMukcC1aW0QLEBSb7QP0WUCqMBQizErLhtxma54\nB6YTqZeSzDE0HGyaQroxgkWg3feIwBwQymcPxc1c+Yvr+OIxN5NG3UlZXeUz\nwGOmnCwecIf6ChWq7oyv5BastK3oVTr2Vy/ODMPE/7W01RFLdU6HUDEfjx/o\nmf0S\r\n=wvz2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/7OqtA2CttPDSltGSEQprAWwpjRuE90i19VPJlSxD5QIgSpOkoDwA/gJ/mONFDufjwPnmzMZL5x/OU4/Ge5CeDwM="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki6vxtqr.0_1606881814651_0.9801450548016941"},"_hasShrinkwrap":false},"2.3.7-canary.ki7l9jjj.0":{"name":"typedconverter","version":"2.3.7-canary.ki7l9jjj.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.ki7l9jjj.0+fb59053","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"fb59053dfa51105c0c9a307a487f87045eee7518","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.ki7l9jjj.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-2/BJJ0oLX6PPoapRDv0gYbGItwcLdbC4TPaojuuettSPA1YardjY84kzEqTv3k2YH5MCIaLpgEm8t3yuN1PY/g==","shasum":"90513fb2741d7eab4171b7fa73f02d4598ca8cb2","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.ki7l9jjj.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx7hACRA9TVsSAnZWagAAJywP/067lN7c1psPlcPcMN8L\nWnFH+eX/mNauGvEX00lLf6nNBTjNfG0lcj29anPqunozuwRu+HwJtplDwT2r\n5is7DJj6ifINtoDLjChUcUe/5qqkx4xCw7KaXIx/WXJaa+VqA+vURhjeulAe\naK+9ETKjJM9X4RXhXgj7QpRIUvXdgSf5rGU5rjDwFaeQDXo+E/G9es6qfc1Y\nlBg+qhpc4rG9XprNFOquYU5Q5LZhq61YRPowJHfpcsKbGTFjmZ0PJMAhWszh\nCF2i3I6SozUdB6fPbPQettg+Gvns4sJAv+BLanU7LBwIP/yOJaxx4qL8g5v+\ntNpsfL1Fb7ALNXlxL/Z/iHjBaYIV7hHRJp05A6W14WqX34vQQu3fDiyVCWrJ\nVLUcHwOS16Ors1kZ5dNff7BW+N5fPRs4ePX5G+RJ50n696kB2dOhtdyFRxJz\n/jnAuiKVFy9Rzs1QcfdT3e80GnJ2axKR4hd9F+XuujMgWU1AmIrzSm4WgI+e\nP5zS76/Vqt5Hyam0PG6RC0mhKqld133ZylVceg3HlXyGiHKo7R5hkyLRLcmz\nEpthOdqV3C6sLkIOZuxrJ8TD6VW7lzqrj3ui4lsvVM2oFOaBvJY+YFTsSghs\neiN5n2gg/1KW9uTZnKsuZ4vfx7hiTGQCHj2GmbLkCBd/roAwU/6+XqnO+NAc\nf4O3\r\n=C73Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpyjEWdgTjfGNE7H3IO5v8hqkGYHxt/d+HM83Pn2oJVQIhAJcPNJtSKcQX53BEd9BcJPtpX8tFFTxTGtdwtwVm4JVM"}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.ki7l9jjj.0_1606924352329_0.5054771398849514"},"_hasShrinkwrap":false},"2.3.7-canary.kibdskyc.0":{"name":"typedconverter","version":"2.3.7-canary.kibdskyc.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kibdskyc.0+629b163","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"629b163f15360fbd0bb448cc9732d4c146437756","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kibdskyc.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-2xLT7o8GFFrmBywZZQB42QyqbILgYI6859bc92vzSnT4Ppxn+w+WdfoS9goljOMOermCGdIyvPNICp5isdwB7g==","shasum":"c70fa60c8fb30455a3291d6c7f3d5b9576a8c6f9","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kibdskyc.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyzgDCRA9TVsSAnZWagAA6DwP/iP/WOvkqG+6PAah/px2\n0R2yJ47QMJUISMhU8fVvQodBEskoarIxfkLEaYkyerA+rXQnlIDAp4tqZeWt\nl6rzT70kAQk2gMtqogVdKEgoswA8LjG5nyxpbzNivJhsm3xR4dgQ9cDFTL7U\nCWgdwctIdqfe6m9UIxKYxmV4jXC2hhxhveMe1xKiC5QBOgOu0ZM7af738liY\nnPVnUkbEEfA/SPQZBw1IBGFzzoEjSse8ANhx8yBGPcCNXHuG09iYPFM3JVA5\nY1AtbB3rZsGcWX791AJmJvkzcjmYR5RlvxbMweMdN4yR9q7iWCVYVDJ8Xl8D\nz1Qr/7HZm2t5+rlCQnfZlHFAbW43lIsCzDBXusMkDHPQPcZkGN4sN7hsOtmr\nX7TANAHVwcemenhZixTZOYPRO6FLlthAn3qxh4DPtjQXV7DDZf/R83Dcb0LW\nUKj5r6A2jfV5LkbZPl/yJbhYzMSUWvIhUIK1G8BLyLDphcQALwiUQjhMAZ/x\n6PcL79wKBdmFa5ePE7xhkn3d4ZU0jHYfLDiYM4/pjKeJtD6o8Wdncm/aXO5r\nRDSdRamZ5U8E7L9NcLrPKO4Ew8h/VOk11es+YRqiZocMsgwk5/iT6u3IzBBy\nhfOQx0ibGB70EwSxFSFvwYGphdHoZHXcw2AZBwtCSrzW7V8dEF4YjZnDQZUT\nWazW\r\n=mQKf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+JFEfR3rgpJTQZNjd+/NpI2YxYRnFSr0g6b30NsFdBAiEAlGKIL9LENV3AZlL1t3FccJugtkxYDF4ez0f29WG7Apw="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kibdskyc.0_1607153666727_0.5224121134710917"},"_hasShrinkwrap":false},"2.3.7-canary.kicmb1c7.0":{"name":"typedconverter","version":"2.3.7-canary.kicmb1c7.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kicmb1c7.0+8d194e2","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"8d194e27a3a92a5d05a355ebbf0c85c945ce7624","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kicmb1c7.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-Lk88QqUr3dsmn62FG1P6AjeUdld8DIz/15iyn0HfedX3D7KblFrnYgLARCGv9ZvNURZzZsBG7SryRH93QwhhoA==","shasum":"78f53d3d430d7ac6b0fc6e75131f96c9af4f831f","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kicmb1c7.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzFwPCRA9TVsSAnZWagAAdLAP/27VT7B74fg6JMwDOPio\nilfNpRWbCE6o76XGUypMKdrWtnkE51g+CbqWt/AR/xwidggzQXOd7sWeurtz\nhh9oiULU6T5UaypLQ4unqqcL2lvxCaLek9p5dPttuD+3Evv3lZeBBo/XzkUf\nc+rKSaXYHGNaU1rbWQ4hskHEQevge2/jUIcBI/+ePirBQvPUZnajwkHIw2vf\njpS/ODuzIbYUZjONn0tuuJqHe0K2DH+OT+KyYsXUUtlAHadNwfmXl16Ubu0B\nNmO64j4N4+1J8+OmQ44OtEBcCrJtJf3LMBhabQMoDtsrOMAwmTTwdN/xM94q\nl/DP8l4/9xRwHKaHWFwTmljisXBCpYpehwey8njUK+v8zlUnPvbSxmEWPi64\nUy35lbG4Lhe6JIjDLjh2fXxdLC5wZbSL/Q7sSuHFEmMysjj8JeKh7exLrcW9\nqHXWEFoved/P5BMJhQFF+p1LrqL4fejo5A8twMsPxcRiqBEnU9lMWPh6zhxy\nw2BQFhUlS77SbO+S6pi08lIp9dz+5SfF7UjAoh7YAy0cq3l/zAGKD2wfIb8K\nWsI/DMK/FMMa9yFNJw6K8LUs2RMh438nmC2q/lN2yJ4YYFHlqYFQLdVPRat6\nNCc34KbaPcqyTI3oR4GOsnwhwqEWv0hocxrBSSeAN5fU+nqeeLx+vJYOJXmt\nuxHd\r\n=dgpb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBFVQxGrUlGaitfnBXdHLMnQH6k8gh6IuD8UNOn3VVTwIgEIIWa3Sc81S7KwzZmLqWxj9vS58pKsdE93BxCWWfPYg="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kicmb1c7.0_1607228431011_0.779436945090239"},"_hasShrinkwrap":false},"2.3.7-canary.kijl4du6.0":{"name":"typedconverter","version":"2.3.7-canary.kijl4du6.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kijl4du6.0+9f4dbcd","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"9f4dbcda252eecad193e47ee70220dd28311f1be","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kijl4du6.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-bFJeFYS6Qzr+rZX2z7dnrqA2TC1zzGtuW1E4G3cXLbEsu2B5YCcBXKf1xH1bPMh219RiWSofdnBJF3PSdFk74Q==","shasum":"b0b2f9b2648c6431dde20a43dda0b08fe9ebed7e","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kijl4du6.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0smpCRA9TVsSAnZWagAAWPoP/2MIpOY3Z1knagoi6N3H\naDywUyf6vYt++1rhNWstcq/Zkz92usp6fGW76+kKOjaa8x6iK55n+JKZDDJj\nLYzgrS7xvs8NWhoU2RNpbE34C5oOKyERYAB9xgPdCIPG8NNXvlChawjF7otW\n4HAXfXbMT/Hg/1AGs0VQpBTbMZCSksHzwLRjq/SIaJ8X/pouz8GFdxdRVjAC\n5O2qG7EdDWyS++u5ShA+N2RgD2JZvk+ediN6Zp64sBjB/U2gRt/AwyzJXCSn\n6ueqO/V+hH2uUAUN7lszDTlu3QR7RBoaYmHeYFdlvOxSKRanQvn6Z0yBp1iq\nCvKJoUYtPW3Cy8jJl4UujJ+Ajs2xDIIMNlU66ko8iMsdKka3E01MuLNfwUmh\nB/eY7xwMqZCvSeugZ4g5S6aSiE3qwWnP7yzcCtrmfNAm02Uidd+p3IQ0VRhT\nSEXaFinFmgEA+W+lYiCsGq+ULH5VM6gaSzjOy0oQ66zH50SvrgSpZG4xc3rU\neX8Kxa8fP/jFKU4V/FenXb3rx1HwavEVuXJHCMgRl1nN8YQOA9P4UrpCB2pm\npYSSUNUdxA7Up15cvqWmcsbj7YMG+skzyaR/omxX8g7MWnISZ+Y5B4N33W7k\n9e/GEHCdeKFru6UPHk9AH8oJQIPOk9o6u8lkIPrb8fgBTeiiA35Ngtg6Scfa\nT1qe\r\n=tzkR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+l0ER0Fz2EYdva6BZB0w6deurZkgXUBFZu441vcY6GAiB/bpUfqhd9s8HSNC1qc5qTQh+fsb/gEu/ufOiAx3v6lw=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kijl4du6.0_1607649705123_0.39957787334956785"},"_hasShrinkwrap":false},"2.3.7-canary.kijvk681.0":{"name":"typedconverter","version":"2.3.7-canary.kijvk681.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.0","tinspector":"3.2.3-canary.kijvk681.0+93c4776","tslib":"^2.0.3","validator":"^13.1.17"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.15","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.0.0","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"93c4776c63a7577c9e1c430d25a1a90d4189395b","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kijvk681.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-1GwGBFDKcIRmqxmiZBALdzjp50X/ZMi4Ooj6ASeCHy4lMcJ6wOGPQLHdz52FUia21j8HtBaWk/kz3jhWNdkhmQ==","shasum":"ef4f1d9220773c1719411efbd8ad848322ea8603","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kijvk681.0.tgz","fileCount":26,"unpackedSize":45757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0w4mCRA9TVsSAnZWagAA6KMQAIQJhPYJWZR85mJuiQH7\nHAC4i9BYsKPaSbWo1EiDAap7EnmMa35AjNt1Yb/+mXwt3VfqVJRAYRoQVmH1\nvUdno3k5VDiQcqPlJxwaxSqEN8Pxv4DPpmWuFHaq+TG7DcXOo3NkqC5Jy/dX\nxANOz18VTGfJKi+CSQBF6/ietuJ21i1fwd1dPoXDu7VXdr3+dMjXmDr6bt+f\neOXjfBO/flDNsTnlfIK5OiD3Dps9slgJOSJpQYgFr39IZqjUHPRSkGCzDi1N\n7XvIKcqanqsLeqBjZrw9av3wtELNX8lx92EhlMamHxrgqjEt0sAsnBx0M7hQ\nNR4uJbnbHwcMYozSq/45a5D3hZyqlRILKc0quqMInv/DNKvct3mck+V51eIE\nNRt47KRq4bjR08k3PN6Bvj6doJW9sDgmPTpEMmA8sHkYCPUmjm4nhriIn3I5\nToUFkk+QYM1v6g+bEm/xawnoEaCC3ShLvnYfmm8BVk/fNGyymDNrWXHR3RoR\niDQ0KbqxEjIzPPdZcQowWgvmbg/1shbvwuoL+5KbXhJ1PGLcLuGcR6d27W4n\ncc0Ia7vOriJLzii1VnUWi3XKH6n+3ZDGSjoJTDhzymLwuEak54YfK2BWRWiG\nf3znH66/fj9d7/HOxBta3NuxxRCFSCJiJaTM9rEIVwp2cCP+yXCr8en4bJwB\nqiES\r\n=1qt4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJYCwbc4aB4ZHPKh4VSXL6xYAQc1RkAxmUaZSMKEzM7AiBnUK+cAX07BczfTummyby67yhvlTnWhN8+7QpFIicb3A=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kijvk681.0_1607667238280_0.5506766777815624"},"_hasShrinkwrap":false},"2.3.7-canary.kik3wda7.0":{"name":"typedconverter","version":"2.3.7-canary.kik3wda7.0","description":"Convert object into classes match with TypeScript type annotation","main":"lib/index.js","types":"lib/index.d.ts","keywords":["converter","type"],"scripts":{"test":"jest","compile":"tsc -p tsconfig.build.json","gen":"ts-node src/generator.ts","clean":"rm -rf src/*.js && rm -rf test/*.js && rm -rf lib","benchmark":"ts-node benchmark/index.ts"},"author":{"name":"Ketut Sandiarsa"},"license":"MIT","dependencies":{"@types/validator":"^13.1.1","tinspector":"3.2.3-canary.kik3wda7.0+4c6ac59","tslib":"^2.0.3","validator":"^13.5.2"},"devDependencies":{"@hapi/joi":"^17.1.1","@types/ejs":"^3.0.5","@types/hapi__joi":"^17.1.6","@types/jest":"^26.0.19","@types/lodash":"^4.14.165","coveralls":"^3.1.0","ejs":"^3.1.5","jest":"^26.6.3","lodash":"^4.17.20","ts-jest":"^26.4.4","ts-node":"^9.1.1","typescript":"^4.1.2"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"repository":{"url":"git+https://github.com/plumier/typedconverter.git"},"gitHead":"4c6ac59976b1e9bf75998f39ccaeec896d300322","readme":"# TypedConverter\nConvert object into classes match with TypeScript type annotation\n\n[![Build Status](https://travis-ci.org/plumier/typedconverter.svg?branch=master)](https://travis-ci.org/plumier/typedconverter)\n[![Coverage Status](https://coveralls.io/repos/github/plumier/typedconverter/badge.svg?branch=master)](https://coveralls.io/github/plumier/typedconverter?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/plumier/typedconverter.svg)](https://greenkeeper.io/)\n\n\n## Performance \nTypedConverter uses several performance optimization, first it traverse Type properties using efficient properties traversal then compiles TypeScript types into optimized object graph contains functions for conversion. \n\nPerformance compared to Joi\n```\nTest Type                          Sec\nJoi - Type conversion            17.62\nJoi - Validation                 61.67\nTypedConverter - Type conversion  7.29\nTypedConverter - Validation      23.51\n```\n\nTo run benchmark: \n* Clone this repo \n* `yarn install` \n* `yarn benchmark`\n\n## Usage \n\n```typescript\nimport reflect from \"tinspector\"\nimport { createValidator, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// create validation function\nconst validate = createValidator(User)\n// this configuration will result the same\n// const validate = createValidator({ type: User })\n// validate raw value\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n})\n\n// create validation function for array\nconst validate = createValidator([User])\n// validate raw value\nconst user = validate([{ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, { \n    email: \"jane.deane@gmail.com\", name: \"Jane Deane\", \n    dateOfBirth: \"1994-1-2\", isActive: \"false\" \n},\n])\n\n\n```\n\n## Without Factory\n`createValidator` good to have a shared validator configuration, but for single usage its better to use the `validate` function. \n\n```typescript\nimport reflect from \"tinspector\"\nimport { validate, val } from \"typedconverter\"\n\n@reflect.parameterProperties()\nclass User {\n    constructor(\n        @val.email()\n        public email:string,\n        public name:string,\n        @val.before()\n        public dateOfBirth:Date,\n        public isActive:boolean\n    ){}\n}\n\n// pass the Type as the second parameter\nconst user = validate({ \n    email: \"john.doe@gmail.com\", name: \"John Doe\", \n    dateOfBirth: \"1991-1-2\", isActive: \"true\" \n}, User)\n// can be passed as option too\n// const user = validate(<raw value>, { type: User })\n```\n\n## Guess Array Element\nUseful when converting data from url encoded, where single value could be a single array. \n\n```typescript\nconst b = await convert(\"1\", { type: [Number], guessArrayElement: true }) // -> result = [1]\n```\n\nNote that, when the type passed to the configuration is of type Array, providing single value will guessed as Array.\n\n## Extending with Visitors\nVisitors executed after conversion process traverse through properties / array element. Invocation can be multiple and run in sequence the last sequence will execute the converter. Visitors work like [Plumier middleware](https://plumierjs.com/docs/middleware)\n\nSignature of Visitor is like below: \n\n```typescript\ntype Visitor = (invocation: VisitorInvocation) => VisitorResult\n```\n\nVisitor is a function receive two parameters `value` and `invocation`. \n* `invocation` next invocation \n\nExample:\n\n\n```typescript\nimport { createValidation, Result, VisitorInvocation } from \"typedconverter\"\n\nconst olderThanEightTeen = (i: VisitorInvocation) => {\n    if (i.type === Number && i.value < 18)\n        return Result.error(i.path, \"Must be older than 18\")\n    else\n        return i.proceed()\n}\n\nconst validate = createValidation({ type: Number, visitors: [olderThanEightTeen] })\nconst result = validate(\"40\") // { value: 40 }\nconst other = validate(\"12\") // { issues: [{path: \"\", messages: [\"Must be older than 18\"]}]  }\n```","readmeFilename":"readme.md","homepage":"https://github.com/plumier/typedconverter#readme","_id":"typedconverter@2.3.7-canary.kik3wda7.0","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","dist":{"integrity":"sha512-vkkF3YfVPy1JQ4OVpyQ1XJdtSO8QYi1tPSLeQApGO3wPgg1AojncevMuD1eKDR+vuNtDgXnA0CjvVbrCrwewfg==","shasum":"0912f6a81d7eb106e8592c767e1f9d8c6d6340fc","tarball":"https://registry.npmjs.org/typedconverter/-/typedconverter-2.3.7-canary.kik3wda7.0.tgz","fileCount":26,"unpackedSize":45756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf00TbCRA9TVsSAnZWagAAl2cP/R0FSll7u2hrbPm0uDuT\nguFJ5LAzf/IydOeQUYycPEujjcu6Mp+Pkfm1T4YsoXzf/UgKqFsD+ekJEZv+\nmpZyItVxRlAnzeq/RkuJWCAzZTxEJIcZr1YvkXEs+9CH5kxr6G4DXeeYiHLq\nnlXAkYpsLy6rL3WenqP27PwktZZ/6tt4SZxmmWbh6/3SlR8kCArhzEYi0Hec\n1805buMvlCMDEJ3/EHqksIFZWzz2QO49yUFczeQ85BTOvmjCh6WNQXioWJx1\nuo+jmdRHgdvRGPKopnmogYUyFWV0qxYF9+e1CNpLx8Vo7GhiSb1vkHBmhQ3o\nkkw0AcAMRe78Xgky3NJ0Cb/kauY2TRWOGXwtzthFriD4reIJ6ExxXiVBUM21\nWRx0Y0SA+YWYWExFBaOK72Ifr2YoJdfkyVdMX6BB+u6ip+AqXkjvQpNNAVt5\nHrMF34MIlKNcSBrKc9ugqmkIsG7m/zDYXX1y8Mcb1HHTHNVOuvcDelgD7VR2\nW/qrZrGeM25SqYN82Cp56iDk5VGM5mgHJLMqrzPrOauI9I1d2uVwCuYMIJi+\nJUJcRt1LFfjNe7qyd8Vdu0Typv1Yd/pzYgC5/VYxApzPWVPfONWWrYYH4cGs\njOMGJqamXWueYJ9ZmbPNqi8llMkGlCTq5tJRJYSRzpaxDJBnLNEtPGc8/6fG\nHJYa\r\n=gEfR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDko6vKTqqNPd+u/xRTJE+uXf+DhIVgFx8eIM3iB1qZAAiAaQXkRw4SofD19hbo54oWMlPxVn8TxD/EeqBtRuyrxaQ=="}]},"_npmUser":{"name":"ktutnik","email":"ktutnik@gmail.com"},"directories":{},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedconverter_2.3.7-canary.kik3wda7.0_1607681242600_0.8711537317749367"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-29T11:40:29.641Z","1.0.0-alpha.0":"2019-03-29T11:40:29.770Z","modified":"2022-05-22T12:38:35.145Z","1.0.0-alpha.1":"2019-03-29T20:59:09.163Z","1.0.0-alpha.2":"2019-03-30T04:14:07.047Z","1.0.0-alpha.3":"2019-03-30T06:39:50.172Z","1.0.0-alpha.4":"2019-04-01T21:55:07.573Z","1.0.0-alpha.5":"2019-04-02T01:38:52.923Z","1.0.0-alpha.6":"2019-04-04T09:08:09.494Z","1.0.0-alpha.7":"2019-04-05T21:39:27.097Z","1.0.0-alpha.8":"2019-04-06T02:25:31.453Z","1.0.0-alpha.9":"2019-04-09T02:51:55.476Z","1.0.0-beta.0":"2019-04-09T04:00:08.358Z","1.0.0-beta.1":"2019-04-09T09:06:06.788Z","1.0.0-beta.2":"2019-04-11T12:00:13.673Z","1.0.0-beta.3":"2019-06-28T09:33:40.676Z","1.0.0-beta.4":"2019-06-29T22:34:50.169Z","1.0.0-beta.5":"2019-07-02T22:56:10.121Z","1.0.0-beta.6":"2019-07-03T06:52:19.410Z","1.0.0-beta.7":"2019-09-24T06:54:55.470Z","1.0.0":"2019-10-04T10:07:31.579Z","1.0.1":"2019-10-24T07:42:25.369Z","1.0.2":"2019-11-01T08:37:22.717Z","1.0.3":"2019-11-01T20:15:05.228Z","1.0.4":"2019-11-02T23:01:29.912Z","1.0.5":"2019-11-20T00:47:23.651Z","1.0.6":"2019-12-01T07:59:10.632Z","1.0.7":"2019-12-02T00:48:04.359Z","2.0.0":"2019-12-05T17:03:09.966Z","2.1.0":"2020-01-14T12:18:42.039Z","2.2.0":"2020-02-03T21:04:45.262Z","2.2.1":"2020-03-15T12:18:47.053Z","2.3.0":"2020-03-22T03:17:40.229Z","2.3.1":"2020-04-29T23:12:41.958Z","2.3.2":"2020-05-05T09:50:45.986Z","2.3.3":"2020-05-20T06:26:35.562Z","2.3.4":"2020-05-28T21:02:53.478Z","2.3.5":"2020-06-03T22:40:46.593Z","2.3.6":"2020-06-04T05:18:06.821Z","2.3.7-canary1592806142.0":"2020-06-22T06:09:07.567Z","2.3.7-canary1592877058.0":"2020-06-23T01:51:05.579Z","2.3.7-canary1592886862.0":"2020-06-23T04:34:27.966Z","2.3.7-canary1593026645.0":"2020-06-24T19:24:11.056Z","2.3.7-canary1593069049.0":"2020-06-25T07:11:02.043Z","2.3.7-canary1593125083.0":"2020-06-25T22:44:49.434Z","2.3.7-canary.kbwv88am.0":"2020-06-26T23:47:42.568Z","2.3.7-canary.kbwxgwmn.0":"2020-06-27T00:50:27.268Z","2.3.7-canary.kbwy7dnv.0":"2020-06-27T01:11:02.539Z","2.3.7-canary.kbx8uhbt.0":"2020-06-27T06:08:56.102Z","2.3.7-canary.kby6baek.0":"2020-06-27T21:45:48.194Z","2.3.7-canary.kbyejgob.0":"2020-06-28T01:36:05.920Z","2.3.7-canary.kbyvfeer.0":"2020-06-28T09:28:50.585Z","2.3.7-canary.kc1bv7t9.0":"2020-06-30T02:44:33.967Z","2.3.7-canary.kc1j62zf.0":"2020-06-30T06:08:58.642Z","2.3.7-canary.kc1pwqwc.0":"2020-06-30T09:17:41.080Z","2.3.7-canary.kc6u1s8b.0":"2020-07-03T23:12:34.777Z","2.3.7-canary.kc6zqei2.0":"2020-07-04T01:51:31.280Z","2.3.7-canary.kc7ailpb.0":"2020-07-04T06:53:22.838Z","2.3.7-canary.kciolr74.0":"2020-07-12T06:13:12.976Z","2.3.7-canary.kckaf5hv.0":"2020-07-13T09:11:42.000Z","2.3.7-canary.kcras9pq.0":"2020-07-18T06:56:17.674Z","2.3.7-canary.kcrinrbo.0":"2020-07-18T10:36:44.486Z","2.3.7-canary.kcs5b8ny.0":"2020-07-18T21:10:50.787Z","2.3.7-canary.kcs8mlx5.0":"2020-07-18T22:43:40.159Z","2.3.7-canary.kctvam2m.0":"2020-07-20T02:05:58.092Z","2.3.7-canary.kcvksj6x.0":"2020-07-21T06:47:31.095Z","2.3.7-canary.kcwgd771.0":"2020-07-21T21:31:23.397Z","2.3.7-canary.kd1392pj.0":"2020-07-25T03:23:06.511Z","2.3.7-canary.kd13oe59.0":"2020-07-25T03:35:00.880Z","2.3.7-canary.kd18a18n.0":"2020-07-25T05:43:49.236Z","2.3.7-canary.kd1i13g6.0":"2020-07-25T10:16:48.666Z","2.3.7-canary.kd2p0nhi.0":"2020-07-26T06:20:11.088Z","2.3.7-canary.kd3mpv1u.0":"2020-07-26T22:03:34.529Z","2.3.7-canary.kd3rqvd4.0":"2020-07-27T00:24:19.897Z","2.3.7-canary.kd6wewq6.0":"2020-07-29T04:58:18.544Z","2.3.7-canary.kdf0lwtn.0":"2020-08-03T21:17:52.954Z","2.3.7-canary.kdgfdc3a.0":"2020-08-04T20:58:56.927Z","2.3.7-canary.kdi5mwkd.0":"2020-08-06T02:01:55.890Z","2.3.7-canary.kdi9bq15.0":"2020-08-06T03:45:14.512Z","2.3.7-canary.kdid6yqc.0":"2020-08-06T05:33:29.208Z","2.3.7-canary.kdjdfg7t.0":"2020-08-06T22:27:51.931Z","2.3.7-canary.kdjj7hrf.0":"2020-08-07T01:09:39.232Z","2.3.7-canary.kdkqxkys.0":"2020-08-07T21:33:38.758Z","2.3.7-canary.kdqpr7yp.0":"2020-08-12T01:47:19.194Z","2.3.7-canary.kdtej428.0":"2020-08-13T22:56:23.559Z","2.3.7-canary.kdtibqoo.0":"2020-08-14T00:42:38.125Z","2.3.7-canary.kdvw2za0.0":"2020-08-15T16:43:16.769Z","2.3.7-canary.ke8zqwdv.0":"2020-08-24T20:46:52.701Z","2.3.7-canary.ke91wrl1.0":"2020-08-24T21:47:26.813Z","2.3.7-canary.ke93q61k.0":"2020-08-24T22:38:16.803Z","2.3.7-canary.keao8m4o.0":"2020-08-26T01:00:14.945Z","2.3.7-canary.keaththw.0":"2020-08-26T03:27:23.317Z","2.3.7-canary.kebz3sj5.0":"2020-08-26T22:52:12.091Z","2.3.7-canary.kedxkqhh.0":"2020-08-28T07:44:56.673Z","2.3.7-canary.keeqwum9.0":"2020-08-28T21:26:14.098Z","2.3.7-canary.keexw8ts.0":"2020-08-29T00:41:39.035Z","2.3.7-canary.kef2e3lg.0":"2020-08-29T02:47:30.780Z","2.3.7-canary.kef5312a.0":"2020-08-29T04:02:52.630Z","2.3.7-canary.kefh7qik.0":"2020-08-29T09:42:27.857Z","2.3.7-canary.kejh0j48.0":"2020-09-01T04:47:56.281Z","2.3.7-canary.kel7fsyz.0":"2020-09-02T09:55:24.837Z","2.3.7-canary.kela2rem.0":"2020-09-02T11:09:15.230Z","2.3.7-canary.kenou8nl.0":"2020-09-04T03:38:06.222Z","2.3.7-canary.keoswy6l.0":"2020-09-04T22:19:55.563Z","2.3.7-canary.kepjwxp9.0":"2020-09-05T10:55:44.235Z","2.3.7-canary.keqn8ee3.0":"2020-09-06T05:16:24.171Z","2.3.7-canary.kerx6yap.0":"2020-09-07T02:42:59.400Z","2.3.7-canary.key2i6eu.0":"2020-09-11T09:58:19.749Z","2.3.7-canary.keyz518l.0":"2020-09-12T01:11:53.341Z","2.3.7-canary.kezbpkd4.0":"2020-09-12T07:03:45.524Z","2.3.7-canary.kezj7wpq.0":"2020-09-12T10:33:58.989Z","2.3.7-canary.kf1ngfd8.0":"2020-09-13T22:08:08.532Z","2.3.7-canary.kf32nfdw.0":"2020-09-14T22:01:15.247Z","2.3.7-canary.kf3gt31v.0":"2020-09-15T04:37:32.338Z","2.3.7-canary.kf6gpx8m.0":"2020-09-17T06:58:26.552Z","2.3.7-canary.kf6lwncy.0":"2020-09-17T09:23:35.271Z","2.3.7-canary.kf6ox8zq.0":"2020-09-17T10:48:03.396Z","2.3.7-canary.kf83flsl.0":"2020-09-18T10:22:00.419Z","2.3.7-canary.kf8yuiqx.0":"2020-09-19T01:01:23.377Z","2.3.7-canary.kf9he5u8.0":"2020-09-19T09:40:32.773Z","2.3.7-canary.kfdk5pvu.0":"2020-09-22T06:09:02.998Z","2.3.7-canary.kfg7x8ie.0":"2020-09-24T02:49:49.747Z","2.3.7-canary.kfku9xyl.0":"2020-09-27T08:26:43.062Z","2.3.7-canary.kflwpa3o.0":"2020-09-28T02:22:20.290Z","2.3.7-canary.kfm9pqez.0":"2020-09-28T08:26:36.232Z","2.3.7-canary.kfnbyb01.0":"2020-09-29T02:17:02.078Z","2.3.7-canary.kfndaw7c.0":"2020-09-29T02:54:49.950Z","2.3.7-canary.kfok0ubn.0":"2020-09-29T22:50:43.318Z","2.3.7-canary.kg3h9ub9.0":"2020-10-10T09:30:16.725Z","2.3.7-canary.kg3j85u4.0":"2020-10-10T10:24:57.455Z","2.3.7-canary.kg45m6uw.0":"2020-10-10T20:51:43.492Z","2.3.7-canary.kg4vj92q.0":"2020-10-11T08:57:16.279Z","2.3.7-canary.kg68uhyf.0":"2020-10-12T07:57:42.449Z","2.3.7-canary.kg6g8g5u.0":"2020-10-12T11:24:37.273Z","2.3.7-canary.kg736xd2.0":"2020-10-12T22:07:11.015Z","2.3.7-canary.kg8ugq0v.0":"2020-10-14T03:38:23.656Z","2.3.7-canary.kg9x6kqr.0":"2020-10-14T21:42:15.185Z","2.3.7-canary.kgbtqzo0.0":"2020-10-16T05:41:41.811Z","2.3.7-canary.kgc219pd.0":"2020-10-16T09:33:39.177Z","2.3.7-canary.kgd3ozpo.0":"2020-10-17T03:07:50.312Z","2.3.7-canary.kgdlm368.0":"2020-10-17T11:29:28.410Z","2.3.7-canary.kgdmgzlm.0":"2020-10-17T11:53:29.536Z","2.3.7-canary.kgea9t96.0":"2020-10-17T22:59:48.363Z","2.3.7-canary.kgelgslo.0":"2020-10-18T04:13:07.662Z","2.3.7-canary.kgevjcoc.0":"2020-10-18T08:55:04.302Z","2.3.7-canary.kgg7oarz.0":"2020-10-19T07:22:35.612Z","2.3.7-canary.kgm10qxk.0":"2020-10-23T09:02:57.271Z","2.3.7-canary.kgm5iq6j.0":"2020-10-23T11:08:53.092Z","2.3.7-canary.kgrcn168.0":"2020-10-27T02:27:08.999Z","2.3.7-canary.kgsjdgwx.0":"2020-10-27T22:23:21.985Z","2.3.7-canary.kgsps60c.0":"2020-10-28T01:22:44.845Z","2.3.7-canary.kgxa6f2k.0":"2020-10-31T06:04:46.439Z","2.3.7-canary.kgxnbu9k.0":"2020-10-31T12:12:54.282Z","2.3.7-canary.kgy8ctsk.0":"2020-10-31T22:01:30.749Z","2.3.7-canary.kgyal5xs.0":"2020-10-31T23:03:59.305Z","2.3.7-canary.kgydir3d.0":"2020-11-01T00:26:07.517Z","2.3.7-canary.kgzo7o56.0":"2020-11-01T22:13:10.711Z","2.3.7-canary.kgzuclth.0":"2020-11-02T01:04:58.241Z","2.3.7-canary.kgzwhr7g.0":"2020-11-02T02:04:57.737Z","2.3.7-canary.kh1h0fly.0":"2020-11-03T04:27:08.127Z","2.3.7-canary.kh1tdkjc.0":"2020-11-03T10:13:16.392Z","2.3.7-canary.kh1ut1x4.0":"2020-11-03T10:53:18.266Z","2.3.7-canary.kh2ho8dd.0":"2020-11-03T21:33:25.060Z","2.3.7-canary.kh2j3gf1.0":"2020-11-03T22:13:15.061Z","2.3.7-canary.kh2jnpxg.0":"2020-11-03T22:29:00.126Z","2.3.7-canary.kh2k6f0d.0":"2020-11-03T22:43:31.507Z","2.3.7-canary.kh2lwwtd.0":"2020-11-03T23:32:08.219Z","2.3.7-canary.kh2p7j3o.0":"2020-11-04T01:04:22.144Z","2.3.7-canary.kh4ew4ru.0":"2020-11-05T05:51:08.061Z","2.3.7-canary.kh5ddq10.0":"2020-11-05T21:56:37.097Z","2.3.7-canary.kh5h50n0.0":"2020-11-05T23:41:46.568Z","2.3.7-canary.kh5jla6k.0":"2020-11-06T00:50:24.921Z","2.3.7-canary.kh5lyii8.0":"2020-11-06T01:56:41.285Z","2.3.7-canary.kh61az31.0":"2020-11-06T09:06:18.245Z","2.3.7-canary.khbdcr5h.0":"2020-11-10T02:42:27.605Z","2.3.7-canary.khchhyyz.0":"2020-11-10T21:26:14.054Z","2.3.7-canary.khdxsl4k.0":"2020-11-11T21:50:09.841Z","2.3.7-canary.khelfoev.0":"2020-11-12T08:51:57.653Z","2.3.7-canary.khg09zf1.0":"2020-11-13T08:35:17.041Z","2.3.7-canary.khiras28.0":"2020-11-15T06:47:11.657Z","2.3.7-canary.khy4xbmr.0":"2020-11-26T01:05:11.284Z","2.3.7-canary.khye3mjx.0":"2020-11-26T05:22:01.917Z","2.3.7-canary.ki2idjwy.0":"2020-11-29T02:32:48.014Z","2.3.7-canary.ki34emgi.778":"2020-11-29T12:49:32.511Z","2.3.7-canary.ki3i90va.0":"2020-11-29T19:17:03.031Z","2.3.7-canary.ki3imu3t.0":"2020-11-29T19:27:47.356Z","2.3.7-canary.ki3w8w7z.0":"2020-11-30T01:48:51.640Z","2.3.7-canary.ki3x3sog.0":"2020-11-30T02:12:54.432Z","2.3.7-canary.ki6vxtqr.0":"2020-12-02T04:03:34.796Z","2.3.7-canary.ki7l9jjj.0":"2020-12-02T15:52:32.518Z","2.3.7-canary.kibdskyc.0":"2020-12-05T07:34:26.877Z","2.3.7-canary.kicmb1c7.0":"2020-12-06T04:20:31.205Z","2.3.7-canary.kijl4du6.0":"2020-12-11T01:21:45.297Z","2.3.7-canary.kijvk681.0":"2020-12-11T06:13:58.423Z","2.3.7-canary.kik3wda7.0":"2020-12-11T10:07:22.707Z"},"maintainers":[{"name":"ktutnik","email":"ktutnik@gmail.com"}],"description":"Convert object into classes match with TypeScript type annotation","keywords":["converter","type"],"repository":{"url":"https://github.com/plumier/typedconverter"},"author":{"name":"Ketut Sandiarsa"},"bugs":{"url":"https://github.com/plumier/plumier/issues"},"license":"MIT","readme":"","readmeFilename":""}