{"_id":"reflectype","_rev":"27-14fabd0049547ef62d6a425e6e142009","name":"reflectype","dist-tags":{"latest":"1.0.0-rc.2","beta":"0.0.10-beta.17"},"versions":{"0.0.1":{"name":"reflectype","version":"0.0.1","description":"Support types for Javascript class's property using decorator feature","main":"src/","keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"gitHead":"fda5d8773d6b9b685e3adec43cbdaa245e90994d","_id":"reflectype@0.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-SHGk07UO9agvcUqGjX1B/pa+TIZivY8M3IepkRnSytvw0lqronWB9WaAb1fPgOYdnawCHlMUxjDueA8pbBI23A==","shasum":"0c8e3e8cd2734b42051fac3f4217b8ea5edc750b","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.1.tgz","fileCount":52,"unpackedSize":77992,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID22XGz+9oLuUsoQ7AgFLUykb1KuJT5VcjwGyf0GLo37AiBnl1bShAYxsFvsX7LpifjtXSH8K2CB3guncVaWXAhJbQ=="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.1_1696636636148_0.4276363508386918"},"_hasShrinkwrap":false},"0.0.2":{"name":"reflectype","version":"0.0.2","description":"Support types for Javascript class's property using decorator feature","main":"src/","exports":{"./":"./src/"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"gitHead":"fda5d8773d6b9b685e3adec43cbdaa245e90994d","_id":"reflectype@0.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-ME6ggR02MmnQ3fJTSjOrMYpeUxQ9VLVHZYkZnr/3LUWiprn2ns4X3bFeKSFx9zm+Ahc4otUtgbazXSCpZQoW2w==","shasum":"2b560ffab6e9a43764090af2b08c3d02cbcf76f9","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.2.tgz","fileCount":52,"unpackedSize":78034,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYdmGD0qPZGqBYwbh0qJs5RB+DWP66Ze+Pb94HaAYYRgIhAKX6g3kpOqLNEig8r+TkavZ02xPofCnILHnyNQWOLw0H"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.2_1696637447426_0.887935130499945"},"_hasShrinkwrap":false},"0.0.3":{"name":"reflectype","version":"0.0.3","description":"Support types for Javascript class's property using decorator feature","main":"src/","keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"gitHead":"67d6d7263d17d2a644cae01108c1b1ec9fb8018b","_id":"reflectype@0.0.3","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-t6mPslJ/2ybXBWkeyBngD1MLh38+XNmbq2VcwWs13nIRa5ZQpg8PNw9QDr+TjYFr6zxQE8HyNidjJda9wHUVuA==","shasum":"edd4e943f1827230e617a5d2a79c09e8453befd0","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.3.tgz","fileCount":53,"unpackedSize":78012,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgZjxlmljGqFWX4qZFp/tjtE8sOpr/ditw+kCHS4aSyAiEAlh3xDID5p0wiELfK9ZWd8lxsDi3XSbDy3cY1fM2RFCQ="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.3_1696638358257_0.6222906978644132"},"_hasShrinkwrap":false},"0.0.4":{"name":"reflectype","version":"0.0.4","description":"Support types for Javascript class's property using decorator feature","main":"./src/*","keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.4","gitHead":"de3558a8bb15e354b254f1a7bd8357fa68b006ad","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-t2V1fouSSCSmYX4gVH3zeGeMi074k5foK0ySHXpcMQDsJl2jSUWKWenjG6zWziA6dSrGiEsnKhRfv/Gp+V2iug==","shasum":"ca629d463d8f61b23fbe5c6026ba6c39ce7c882a","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.4.tgz","fileCount":63,"unpackedSize":72129,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgDRbGKY10hzP2SvgGrQp3mhDUX7ywQKqn/ITV/qQkVAIhAMoqX9TW0FnD03eQVHq9eRXo8uz4SHJxHOTejqaic7AN"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.4_1697353548805_0.16155266603917418"},"_hasShrinkwrap":false},"0.0.5":{"name":"reflectype","version":"0.0.5","description":"Support types for Javascript class's property using decorator feature","main":"./src/*","keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.5","gitHead":"1a23403718e7744c934579a06fcd299ab7696046","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-pAC9YKchIqt93DxUSN+ergVtFun+OsT75dtjS34M92V3DeOHV7zGPh8e6wLjgE+ufn5X4SDHj1ffaPoMukZhJw==","shasum":"dc9293892e551683dcdb28051e8c4648dee07633","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.5.tgz","fileCount":63,"unpackedSize":72181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcYy/U07RSw4rDGIAAmPVuYaOS+7dnnYBDL/h2NWBFVQIgUrm7PXdxMw46neqYZNjh0RN9Stc2Khoic8sNF13V3AY="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.5_1697632139688_0.5587043039043205"},"_hasShrinkwrap":false},"0.0.6":{"name":"reflectype","version":"0.0.6","description":"Support types for Javascript class's property using decorator feature","main":"./src/*","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.6","gitHead":"fee945b77bf4c3ccb08fc80a3417fccfb0e0981a","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-TlAlNldRoo0DYrvZKN69mXtVc2YKgzWJf8C5MasAR51y75MnVToCbwwABZfxweLsd3PNLqLL3xrvmxAHEOWvDQ==","shasum":"5202474f33272aa3e1daf624d33654b2b62e594b","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.6.tgz","fileCount":63,"unpackedSize":74596,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMY1uNOZ3XPs4BCyUNdk92J8eT4Q16JqW12o6+2UTIrgIgY0Vy5SsEv9JKQt6wTg5+M3iQVfvi8OWzRYV8E1hJQgk="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.6_1697831948179_0.8392268693779221"},"_hasShrinkwrap":false},"0.0.7":{"name":"reflectype","version":"0.0.7","description":"Support types for Javascript class's property using decorator feature","main":"./src/*","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.7","gitHead":"902ee582f3d9605d395aa897331f132fa87414ae","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-LYlWpCQr12wgybIfvR7VGn6eb+iS4NYGkc8DZXkt6JDE39T7ws1Sud8XZVzlkrMbFrqf0oZkL9nX3ZJVwLoHqw==","shasum":"0721333728abccef36f19ef8344fcf9f461fdae8","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.7.tgz","fileCount":65,"unpackedSize":75323,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVuCF/rbMVfUrGLSCyGx8A/Whx7NeE83HYJ5C069GhoQIgKIISw6485RzTPFB5zdql7q4pwbxejtYf89a8P2CjScE="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.7_1698835046991_0.08368000187316538"},"_hasShrinkwrap":false},"0.0.8":{"name":"reflectype","version":"0.0.8","description":"Support types for Javascript class's property using decorator feature","main":"./src/*","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.8","gitHead":"29e509886789e48ab81f7f7242fbd92fcc47647d","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-ZA1CETlhOSKGu1y8KNzNS/6qnSSjNIYFSpJrb4ak7CdXuEwrWEnHDTp1ALQXXl3JXI6/mTQhaln6XpfAioF5dA==","shasum":"2e48fa5965620f548c6658c0f4d7573bc9d21192","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.8.tgz","fileCount":65,"unpackedSize":75522,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFpEhTfY6sbNbk82w6/XpmYbBGTOvJt7ZRIkqreV44waAiEA1R/Or0eqv3mE8lTrSIqibrxN7JB4TfWiSAVlf2aoNbE="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.8_1698835233725_0.38032324160951125"},"_hasShrinkwrap":false},"0.0.9":{"name":"reflectype","version":"0.0.9","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.20.12","@babel/node":"^7.20.7","@babel/plugin-proposal-decorators":"^7.20.13","@babel/preset-env":"^7.20.2","@babel/register":"^7.18.9","@types/node":"^20.6.0"},"_id":"reflectype@0.0.9","gitHead":"28b8bd88f233cf6089eb67552f0759bde4a8f852","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"18.18.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-daLFKL0BIpW/eh5tiTIsShSb2GTpbFO2+FRbs1TzEbXJc1Jg7SAJHpViyZHr22IOWZIF4UgDiF/3Q45HQxfJtQ==","shasum":"42a1c9d8df8f0122b86b9aeb33057ed3043ce298","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.9.tgz","fileCount":66,"unpackedSize":75568,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBeeyNhNXLg7SUdxxqFOXWSyyoPcZk/IbkBDS7VDgttFAiEAireAdmbM3GGg9p+pbVTffdKUw4C1oQgJ2P6kYeRfnSg="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.9_1698836113674_0.8920827535702474"},"_hasShrinkwrap":false},"0.0.10-beta.1":{"name":"reflectype","version":"0.0.10-beta.1","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.1","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"16636ccef28458e5a0a847b63ce854194588edb6","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-RMOdSmwC+Qef7FbRo0vaEtsS3KNpubSpkM2K3J//b6R5OavH6AX060lmvowm5InJhDHTVpfY7/XzfoVIFhVxVQ==","shasum":"a84a9eac2c2a4fe923c0e248590445319906672c","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.1.tgz","fileCount":85,"unpackedSize":103481,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK25SH4Vkc1mtnulnPPPdTIzuD32YojjTFwzYnsBT/6QIhANdiUE7C8YbfVgPwupz2AOgdgt2j76XDkUmz+GDwdgzm"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.1_1702865246714_0.5163679837969555"},"_hasShrinkwrap":false},"0.0.10-beta.2":{"name":"reflectype","version":"0.0.10-beta.2","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.2","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"5760b07d4dfe4362d86d03a62b143f596bfbf478","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-a4MlPGDjeb86H9LAlrAO0HrN1SG0/ulhGMLjv3EKzM/gkDlcL9sPhX/C5cKuj4TI4HqVIxjsguqZ2CxZuDh0Xg==","shasum":"cf5dc06e2ed6fbe2c21240c768f8abfbb5b3f4c7","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.2.tgz","fileCount":109,"unpackedSize":135454,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6HcPVghTY+hikDEm95EUUpo1veKeKG9tttjA7HVcbzAiEA3tr2NZ429tTDSmG/dINU7V6r0koFHARcJ99kMn624yI="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.2_1704313374716_0.4139154169226884"},"_hasShrinkwrap":false},"0.0.10-beta.3":{"name":"reflectype","version":"0.0.10-beta.3","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.3","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"a71c2315ed6b467b901f8ecd1930bfe37e5f9604","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-ddi3+ZKCT8q8N3LGmkMt5P+Yci6XDNbHPtt4dJUI6499y1TyqjqcEr+qLngvrPV7XZUhq8Pjb6DbJ25IAQCRWQ==","shasum":"04846bc39c6ca4001c65747ef4bd08a79130f0cd","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.3.tgz","fileCount":109,"unpackedSize":135985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/YZRSyjRI0BX+hRrZyEtuiK9xcS6NhlbK3LxNK2OvSAiAl8/xdut5Pvq1h5+PRcTKIMHsCjV6eYGDygA6YjlEH3g=="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.3_1704377937237_0.6767743625252098"},"_hasShrinkwrap":false},"0.0.10-beta.4":{"name":"reflectype","version":"0.0.10-beta.4","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.4","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"65e6cf021f017693a6d718882d7f3b498b6fd8e0","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-syOWq+PO1qojALllua16lY0dsMTObqn8voSQTsYaYZUUX5Kn/BHC89ga0nGO3zlUMVcGpHrZbeEqFrbBKhJ0dQ==","shasum":"e6428dde231849846de2030a2849a47539505413","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.4.tgz","fileCount":111,"unpackedSize":138276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK8QFiadx2jz+u3g4XQM8QqlkvBa2vu03oRJRhKNli6wIhAJdaQmgUEc5Pv+oUcnVuEW9xOC0nPJNj6/6qNXFObMqj"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.4_1704745726164_0.2099587835344192"},"_hasShrinkwrap":false},"0.0.10-beta.5":{"name":"reflectype","version":"0.0.10-beta.5","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.5","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"908abd2c5e42eee88f702e369d354846f256bdb3","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-348cDoM7rq41J3Kqnf2Q69WKZCDooCAAQqJnCqDPxrnQAsuKCVEdK/cNKAgQdKBlarOVa1/J1Pf7/n09TDyxPQ==","shasum":"7a2a911ffc9232f9d340310fae013cf521a5e5d5","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.5.tgz","fileCount":111,"unpackedSize":138530,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIApQ1Ei63+n/gcKfzzFhVa6wSOnLhbsvS927wQlu+F4EAiA4foiHn9OcCkPZGLZoe6NSEZyQNo61TwD+1LdtKk1fLg=="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.5_1704808758134_0.5914577991809928"},"_hasShrinkwrap":false},"0.0.10-beta.6":{"name":"reflectype","version":"0.0.10-beta.6","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.6","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"ead70f227b6350e4dd66c5a44c213ddad0818301","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-BOz6NgUWiOnRb3yBMEGORABL3GnV0WyakMjgSUkMIQ1w47uTAQafuZ0eGvZlWG2f5PCaZjtT1fsqtT9JoJKcRQ==","shasum":"f267318f194237da17f01d326959ba02eb2a0f3a","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.6.tgz","fileCount":117,"unpackedSize":156440,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSmyIFwAjEHcdEcxV1MPIySYgKwK4jyqC4M/XPyT65WAIhAIk2N4CL3qByEsD57n9tSPUzoqFN2Xdp5m+/J/teHbtE"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.6_1705068440213_0.5320928129464864"},"_hasShrinkwrap":false},"0.0.10-beta.7":{"name":"reflectype","version":"0.0.10-beta.7","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.7","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"16861b3162e0caa23aba24b6fecf33180f930ace","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-uSC8D+XV0WxAuZKrt+sVWiLKch6R7Q+ZFqKuILamEHPmS7XJY0juxZq1ADsN/4CQPC6hkkMlP0+mw7HR/xn+vA==","shasum":"51d7313f5d70a09acd53ffb6bd3fd1b50deb261b","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.7.tgz","fileCount":119,"unpackedSize":158737,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGF527Bc2A6xR+7obMiC8o0vLkgWEgWtBYFno+NjzTUyAiEA2606tsBC3JeP9nlAgt4kMCG4q0wBJXodpTV+swZI8Jc="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.7_1705090878637_0.9141212513736299"},"_hasShrinkwrap":false},"0.0.10-beta.8":{"name":"reflectype","version":"0.0.10-beta.8","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.8","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"49a1222b8fa070e702bd254d2b0111f2555cae3e","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-5is7nCYh7kRnxvdYGrO7DcWe3KZF40TSsJqHCZ5DKVfJahm0njIfHOacCsMnH0TKW86fj94ueK9BTsLvcPqu4w==","shasum":"92a5c86b138647b14979ef04c8f6d0a9fc7ccc76","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.8.tgz","fileCount":119,"unpackedSize":158736,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmud4hCJLJqzofXpFtN3jAvvzw3e/pOQUBfPkaMGEvoAIhAM9DaQQNGC76MIofyZzsjx/H2KjAKDsMc/XxksESy3x5"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.8_1705093459190_0.870724028976505"},"_hasShrinkwrap":false},"0.0.10-beta.9":{"name":"reflectype","version":"0.0.10-beta.9","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.9","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"cca3a8eff3ab8d4167434105f90dc22b8eee2c44","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-nCN+HloWygJVKG40auuVugXwxCmxzh8l1FIjiEjsyU3CbpOMkkaqQSCGNfH1DC5DyYgw9isweOplLvzmITkK7A==","shasum":"a0dbdb7345873b8cbcc4afb81bfb9b9f1db1e915","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.9.tgz","fileCount":119,"unpackedSize":158720,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8uBSUo6ITxkhI77dbtHbZ1nnncKH4QymxWCojG4GS8gIgX82S453exX6Q6cH021GxwG1GmxYYg0cTOF5VEk7fo0k="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.9_1705108233695_0.34222230239797646"},"_hasShrinkwrap":false},"0.0.10-beta.10":{"name":"reflectype","version":"0.0.10-beta.10","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.10","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"db614d39effb460efa618f6597d04107e78a2695","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-3wrjcy/kykP3qzMPk8xbjNoE2bEQznODhW3+HYlsToCwYWfschNOPD5hOIF8bmQWLw3VOvdZfvP1GnQ59lMOzg==","shasum":"fe5fc1e12f950c0b54fb3da1cb3ea2120ffcfe03","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.10.tgz","fileCount":119,"unpackedSize":159016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwHJrWY7c7twJTmkr+Eaq+6rQMA/dqx3GUv/Xh4EwnKgIhAPBr0HtCdIFXlVETulNzyHbeZCER/Vwy4FKiY8MZ9Tzk"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.10_1705210024606_0.5616384758703432"},"_hasShrinkwrap":false},"0.0.10-beta.11":{"name":"reflectype","version":"0.0.10-beta.11","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.11","readme":"# ReflecType\n\nType support for javascript\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2022-03\" }]\n    ]\n}\n```\n\n## Usage\n\n### Type hint to class property\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n\n    constructor() {\n\n\n    }\n\n    @paramsType(Number, String)\n    @defaultArgs(2, 'foe')\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n\n\nconst obj = new A();\n\nobj.id = 1;\n\nobj.print(3, 'bar');\nobj.print();\n\nconsole.log(obj.id);\n\n// would throw Error \nobj.id = '123';\nobj.print('4', 'john');\n\n```\n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILog extends Interface {\n\n    log() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILog)\nclass SomeClass {\n\n    constructor() {\n\n\n    }\n}\n\n\n```\n\n","readmeFilename":"README.md","gitHead":"3258dedd14d57fd92ff6c9ccc159bf2a5b80d039","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-88MB7RJ+NoRPSxOM3CuH17z/KJzPaZII+y0ZGsnL+9YM01yFfZVZn2bfg6KZ6aMDsE7oFa8rytkKoqsucxHW7A==","shasum":"5a4cf2f3dbd07c50d40349909ace5a65b89ce60b","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.11.tgz","fileCount":119,"unpackedSize":159402,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRsgLl4L/lnvWH+kbv/OQxx8PeoodNjLVu8RIiIhL4NwIgA70uYhi5aF2fbrGciXTAFIfy9nzII1w7Nn5Mm7GEhwE="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.11_1705218763223_0.8596058460885829"},"_hasShrinkwrap":false},"0.0.10-beta.12":{"name":"reflectype","version":"0.0.10-beta.12","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.12","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\nBeside type checking, Reflectype provide Reflection API to help users understand about their classes.\n\n## Property Reflection\n\n### Reflect on static property\n### Reflect on prototype property\n\n","readmeFilename":"README.md","gitHead":"896e03d97eeea203cb84c011b0c090b9b96cad48","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-wP4ILiMuxFlDZjxkwHjjEjgcqtINut37PiA9+w+oCw8Q7ypi16Muv2px4V1c2VaynCDlelCelWGUsZptQYxbhA==","shasum":"b50320efef0a0ed22cf2c2da4e23ed7978d35201","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.12.tgz","fileCount":125,"unpackedSize":177009,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrlfBugTEh1Pa/DnIhH39uFvgpXczHftpTfKcN3BHulAIgbsgrC/LQfX//icJ9dbxMCTYKEeNr0xrUyjAkwY1pj8c="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.12_1705355856798_0.9009539599957979"},"_hasShrinkwrap":false},"0.0.10-beta.13":{"name":"reflectype","version":"0.0.10-beta.13","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.13","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\nBeside type checking, Reflectype provide Reflection API to help users understand about their classes.\n\n## Property Reflection\n\n### Reflect on static property\n### Reflect on prototype property\n\n","readmeFilename":"README.md","gitHead":"58409b428636f7fac2ec8aaa867da4044418714f","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-vHi0iBBYJEMeHvCBubIQRI8hzptvC0PRGCkJSyEGERSxyeqzygBMkcPJBXwzk4G9bN6KsCOm4dUNk1sl0hjQ6Q==","shasum":"1594b7964db8f84c4b745cced84fcdb40997505e","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.13.tgz","fileCount":125,"unpackedSize":177112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu7uFclX5NFtFYiHvSL1Wbko9ruAbnbA1Cov9C2JI8FAIhAPZSmt/b4J/6Ir1Tzo0QMOTR51S/qzeiqEUB75kOxGJY"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.13_1705356658649_0.01348570368974289"},"_hasShrinkwrap":false},"0.0.10-beta.14":{"name":"reflectype","version":"0.0.10-beta.14","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.14","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\nBeside type checking, Reflectype provide Reflection API to help users understand about their classes.\n\n## Property Reflection\n\n### Reflect on static property\n### Reflect on prototype property\n\n","readmeFilename":"README.md","gitHead":"57ef36b1b2cb803faf9c62e03d601f965490d219","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Drhyx5Q/HZP2upYh6uToC2naVZlNvuQfEhstQtbsWBsg7Tfxr//PMW3pQ8U6ATun9omEB81elbizJUtQtoZTIQ==","shasum":"0eda4910965e5ffcac72579b73239916db42b713","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.14.tgz","fileCount":130,"unpackedSize":188535,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwq76QcFiQ0uFEOnnJARyEAR1ZDZUf+i26IE4HMn6KnQIhAJFwzxlaOCW8mkbQphsHn7Kww6TWD0koFeZr4prKzsr8"}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.14_1705571198389_0.20881314302933252"},"_hasShrinkwrap":false},"0.0.10-beta.15":{"name":"reflectype","version":"0.0.10-beta.15","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","test-parameter":"npx babel ./test/parameter/class.js > ./test/parameter/compiled.js && node --trace-warnings ./test/parameter/","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.15","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n\nconst obj = new A;\n\nobj.id = 'foo'; // error\nobj.id = 1; // valid set\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n\nconst obj = new A();\nobj.logger = new SomeClass(); // no Error\n\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### We can add multiple metadata to parameter when using @parameters\n\n```js\nconst {parameters, allowNull} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({\n        param1: [Number, allowNull],\n        param2: String\n    })\n    foo(param1, param2) {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\nBeside type checking, Reflectype provide Reflection API to help users understand about their classes.\n\n## Property Reflection\n\n### Reflect on static property\n### Reflect on prototype property\n\n","readmeFilename":"README.md","gitHead":"c9f67011fe7bc76fcf5eccc1b24392870761048e","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-iIPbJABNOZeS2V3ytfIQYnI4M7/o+vP40ed4a5uuLo9BgME5ta666EekJXoczP2g97BPAS4ZQa78iRRJ64xikg==","shasum":"999471961630d79c635693a967e804b7b5d3a670","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.15.tgz","fileCount":135,"unpackedSize":202259,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtWPBhgYsHEpH5NOjXZJcaK9iJ6ZyMFVf1r6K5kUHz9gIgKz14SmQSX62onW2GL2GvMybwDXtjW71WVqL11K0I048="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.15_1705727249204_0.26837251573597953"},"_hasShrinkwrap":false},"0.0.10-beta.16":{"name":"reflectype","version":"0.0.10-beta.16","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"scripts":{"test":"echo \"Error: no test specified\" && exit 1","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","test-parameter":"npx babel ./test/parameter/class.js > ./test/parameter/compiled.js && node --trace-warnings ./test/parameter/","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4"},"_id":"reflectype@0.0.10-beta.16","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n\nconst obj = new A;\n\nobj.id = 'foo'; // error\nobj.id = 1; // valid set\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n\nconst obj = new A();\nobj.logger = new SomeClass(); // no Error\n\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### We can add multiple metadata to parameter when using @parameters\n\n```js\nconst {parameters, allowNull} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({\n        param1: [Number, allowNull],\n        param2: String\n    })\n    foo(param1, param2) {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\nBeside type checking, Reflectype provide Reflection API to help users understand about their classes.\n\n## Property Reflection\n\n### Reflect on static property\n### Reflect on prototype property\n\n","readmeFilename":"README.md","gitHead":"61efe3f893ecdb0c225361bad6f52f84cc33d1bf","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-ifC778IgibA23WTD/l7MZFa+uPZWZJExZjUGw6KytkwjGP5LZbukdS1IPRx5JKEPZH8vV4elXEjb5OZERxTK+g==","shasum":"3acabac1367e85aed1a31175990dc8d085402989","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.16.tgz","fileCount":138,"unpackedSize":208307,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGnseGxsJKI3ycpvSGckUF3lw3v+NcmHrGAf5a8NGkEAiEAkx6PrPGk6vgs4SvN+uCjKR2DgnbUUjyIfmHSiNcSawU="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.16_1705846384766_0.680039982288545"},"_hasShrinkwrap":false},"0.0.10-beta.17":{"name":"reflectype","version":"0.0.10-beta.17","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"engines":{"node":">=18.0.0"},"scripts":{"test":"npx babel ./test/testSuite/classes.js > ./test/testSuite/compiled.js && node --trace-warnings ./test/testSuite","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","test-parameter":"npx babel ./test/parameter/class.js > ./test/parameter/compiled.js && node --trace-warnings ./test/parameter/","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.4","@babel/core":"^7.23.5","@babel/node":"^7.22.19","@babel/plugin-proposal-decorators":"^7.23.5","@babel/preset-env":"^7.23.5","@babel/register":"^7.22.15","@types/node":"^20.10.4","babel-jest":"^29.7.0","jest":"^29.7.0"},"_id":"reflectype@0.0.10-beta.17","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n### Prerequisites\n\n#### Babel version\n\nTo achieve accurate transpilatio, this package needs the latest version of Babel dependencies after version 7.23 because since version 7.23, Babel add implementation for TC-39 proposal decorator metadata.\n\nThis is configuration dependencies when developing this pacakage\n\n```\n{\n    \"devDependencies\": {\n        \"@babel/core\": \"^7.23.5\",\n        \"@babel/node\": \"^7.22.19\",\n        \"@babel/plugin-proposal-decorators\": \"^7.23.5\",\n        \"@babel/preset-env\": \"^7.23.5\",\n        \"@babel/register\": \"^7.22.15\",\n        \"@types/node\": \"^20.10.4\",\n        \"babel-jest\": \"^29.7.0\",\n        \"jest\": \"^29.7.0\"\n    }\n}\n```\n\n#### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n\nconst obj = new A;\n\nobj.id = 'foo'; // error\nobj.id = 1; // valid set\n```\n#### Type with interfaces\n\n``` javascript\nconst {Interface} = require('reflectype/interface');\nconst {implement} = require('reflectype');\nconst {type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n\nconst obj = new A();\nobj.logger = new SomeClass(); // no Error\n\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /**\n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### We can add multiple metadata to parameter when using @parameters\n\n```js\nconst {parameters, allowNull} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({\n        param1: [Number, allowNull],\n        param2: String\n    })\n    foo(param1, param2) {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Reflection API\n\n","readmeFilename":"README.md","gitHead":"69a1b233d4a0a905782b5ff7fb857c1f31e6575f","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-XaelVDyM6DJ0g0atwp1Przu+qQMkLwPR7CFfdgh3MV7MSJAAi4UNCjILBRbcKcvHkfjFby1iZA/MOssXsrPaRQ==","shasum":"83e4df63f001370c5b628bf0a55e59fa97f312cf","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-0.0.10-beta.17.tgz","fileCount":129,"unpackedSize":206829,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb+un743qGIhlV8mPvpHJyBqffd8ZibXEOt5iRPnGY3gIgP7NwFyVyyJnQmQiuXPe//x/ksP2znwQi+wFwnsdw4Ek="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_0.0.10-beta.17_1706476654993_0.770839657144762"},"_hasShrinkwrap":false},"1.0.0-rc.1":{"name":"reflectype","version":"1.0.0-rc.1","description":"Support types for Javascript class's property using decorator feature","main":"./index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface"],"engines":{"node":">=18.0.0"},"scripts":{"test":"npx babel ./test/testSuite/classes.js > ./test/testSuite/compiled.js && node --trace-warnings ./test/testSuite","test-virtual-method":"npx babel ./test/virtualMethod/index.js > ./test/virtualMethod/compiled.js && node --trace-warnings ./test/virtualMethod/compiled","test-method-overloading-coercive-type":"npx babel ./test/methodOverloadingCoerciveType/index.js > ./test/methodOverloadingCoerciveType/compiled.js && node --trace-warnings ./test/methodOverloadingCoerciveType/compiled","test-method-overloading-static-type-cast":"npx babel ./test/methodOverloadingStaticTypeCast/index.js > ./test/methodOverloadingStaticTypeCast/compiled.js && node --trace-warnings ./test/methodOverloadingStaticTypeCast/compiled","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","test-parameter":"npx babel ./test/parameter/class.js > ./test/parameter/compiled.js && node --trace-warnings ./test/parameter/","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/node":"^7.23.9","@babel/plugin-proposal-decorators":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/register":"^7.23.7","@types/node":"^20.11.16","babel-jest":"^29.7.0","eslint":"^8.56.0","jest":"^29.7.0"},"dependencies":{"debug":"^4.3.4","dotenv":"^16.4.5"},"_id":"reflectype@1.0.0-rc.1","gitHead":"a2ab5b5f7bc2ecf7cd20b859c7520ef48cb34495","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-TLvhfNVvYbjBVvYTNWsRbo0ElmZGmpQrTWteINPSh2oA0D+q2EtUfCnyYN4+qdBwzicdcadeVTxs+g7/+AiFTw==","shasum":"5d4358fec1c5084b4fc385ce134a910eb219e83a","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-1.0.0-rc.1.tgz","fileCount":160,"unpackedSize":318770,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzVBPcY9KX2GpA4QeKKdj7+8Ulb8o27vP/qxlenzofRAIgJpkSYdl3BOXVSaWqnt96YKKKy3yJJkgMR3+BQCyF7qk="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_1.0.0-rc.1_1712166149509_0.11885214003332956"},"_hasShrinkwrap":false},"1.0.0-rc.2":{"name":"reflectype","version":"1.0.0-rc.2","description":"Support types for Javascript class's property using decorator feature","main":"./src/index.js","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"keywords":["type","types","decorator","reflection","metadata","type-metadata","interface","multimethod","overload","function overloading","multiple dispatch","dynamic dispatch","ad-hoc polymorphism","single dispatch","polymorphism"],"engines":{"node":">=18.0.0"},"scripts":{"test":"npx babel ./test/testSuite/classes.js > ./test/testSuite/compiled.js && node --trace-warnings ./test/testSuite","test-virtual-method":"npx babel ./test/virtualMethod/index.js > ./test/virtualMethod/compiled.js && node --trace-warnings ./test/virtualMethod/compiled","test-method-overloading-coercive-type":"npx babel ./test/methodOverloadingCoerciveType/index.js > ./test/methodOverloadingCoerciveType/compiled.js && node --trace-warnings ./test/methodOverloadingCoerciveType/compiled","test-method-overloading-static-type-cast":"npx babel ./test/methodOverloadingStaticTypeCast/index.js > ./test/methodOverloadingStaticTypeCast/compiled.js && node --trace-warnings ./test/methodOverloadingStaticTypeCast/compiled","test-reflect-query":"npx babel ./test/reflectionQuery/class.js > ./test/reflectionQuery/compiled.js && node --trace-warnings ./test/reflectionQuery","test-reflection":"npx babel ./test/reflection/class.js > ./test/reflection/compiled.js && node --trace-warnings ./test/reflection","test-footprint":"npx babel ./test/decoratorfootprint/class.js > ./test/decoratorfootprint/compiled.js && node --trace-warnings ./test/decoratorfootprint","test-interface":"npx babel ./test/interface/class.js > ./test/interface/compiled.js && node --trace-warnings ./test/interface","test-metadata":"npx babel ./test/classMetadata/class.js > ./test/classMetadata/compiled.js && node --trace-warnings ./test/classMetadata","test-resolution":"npx babel ./test/metadataResolution/class.js > ./test/metadataResolution/compiled.js && node --trace-warnings ./test/metadataResolution","test-parameter":"npx babel ./test/parameter/class.js > ./test/parameter/compiled.js && node --trace-warnings ./test/parameter/","pseudo":"node ./test/pseudoDecorator"},"author":{"name":"tanhuy998"},"license":"MIT","devDependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.23.9","@babel/node":"^7.23.9","@babel/plugin-proposal-decorators":"^7.23.9","@babel/preset-env":"^7.23.9","@babel/register":"^7.23.7","@types/node":"^20.11.16","babel-jest":"^29.7.0","eslint":"^8.56.0","jest":"^29.7.0"},"dependencies":{"debug":"^4.3.4","dotenv":"^16.4.5"},"_id":"reflectype@1.0.0-rc.2","gitHead":"bc94da4cdadf70e9be885db05d961f4cb037ea22","bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"},"homepage":"https://github.com/tanhuy998/reflectype#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-90NnPowjHblQE1cPiC3IpMercq8TwWCD+cicp8mKt04QuwgzdQEJPXACFq8lxPQnerwdD0UkxH8BmUNfjF1TGg==","shasum":"1fc151517438eb2c1faa57ec827407969107aeff","tarball":"https://registry.npmjs.org/reflectype/-/reflectype-1.0.0-rc.2.tgz","fileCount":160,"unpackedSize":318879,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8FvprEQBi+hX4xA8AGo4sbYx7O6EtjNNNMxUFvux+/AIgKVoLBOlpuVUIf45tORkY3eNJuVsNfLahrc3bxNdvd+4="}]},"_npmUser":{"name":"tanhuy998","email":"tanhuy998@gmail.com"},"directories":{},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reflectype_1.0.0-rc.2_1712214347837_0.522556382479535"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-06T23:57:16.081Z","0.0.1":"2023-10-06T23:57:16.388Z","modified":"2024-04-04T07:05:48.282Z","0.0.2":"2023-10-07T00:10:47.613Z","0.0.3":"2023-10-07T00:25:58.432Z","0.0.4":"2023-10-15T07:05:49.069Z","0.0.5":"2023-10-18T12:28:59.938Z","0.0.6":"2023-10-20T19:59:08.369Z","0.0.7":"2023-11-01T10:37:27.198Z","0.0.8":"2023-11-01T10:40:33.870Z","0.0.9":"2023-11-01T10:55:13.908Z","0.0.10-beta.1":"2023-12-18T02:07:26.966Z","0.0.10-beta.2":"2024-01-03T20:22:54.897Z","0.0.10-beta.3":"2024-01-04T14:18:57.384Z","0.0.10-beta.4":"2024-01-08T20:28:46.340Z","0.0.10-beta.5":"2024-01-09T13:59:18.334Z","0.0.10-beta.6":"2024-01-12T14:07:20.397Z","0.0.10-beta.7":"2024-01-12T20:21:18.860Z","0.0.10-beta.8":"2024-01-12T21:04:19.362Z","0.0.10-beta.9":"2024-01-13T01:10:33.847Z","0.0.10-beta.10":"2024-01-14T05:27:04.812Z","0.0.10-beta.11":"2024-01-14T07:52:43.376Z","0.0.10-beta.12":"2024-01-15T21:57:36.965Z","0.0.10-beta.13":"2024-01-15T22:10:58.796Z","0.0.10-beta.14":"2024-01-18T09:46:38.584Z","0.0.10-beta.15":"2024-01-20T05:07:29.348Z","0.0.10-beta.16":"2024-01-21T14:13:04.965Z","0.0.10-beta.17":"2024-01-28T21:17:35.235Z","1.0.0-rc.1":"2024-04-03T17:42:29.704Z","1.0.0-rc.2":"2024-04-04T07:05:48.107Z"},"maintainers":[{"name":"tanhuy998","email":"tanhuy998@gmail.com"}],"description":"Support types for Javascript class's property using decorator feature","keywords":["type","types","decorator","reflection","metadata","type-metadata","interface","multimethod","overload","function overloading","multiple dispatch","dynamic dispatch","ad-hoc polymorphism","single dispatch","polymorphism"],"author":{"name":"tanhuy998"},"license":"MIT","readme":"# ReflecType\n\n### Runtime type checking for Javascript.\n\n## Features\n\n- [Runtime type check](#type-checking)\n- [Interface](#interface)\n- [Method overloading](#method-overloading-multiple-dispatch)\n\n### Prerequisites\n\n#### Babel version\n\nTo achieve accurate transpilatio, this package needs the latest version of Babel dependencies after version 7.23 because since version 7.23, Babel add implementation for TC-39 proposal decorator metadata.\n\nThis is configuration dependencies when developing this pacakage\n\n```\n{\n    \"devDependencies\": {\n        \"@babel/core\": \"^7.23.5\",\n        \"@babel/node\": \"^7.22.19\",\n        \"@babel/plugin-proposal-decorators\": \"^7.23.5\",\n        \"@babel/preset-env\": \"^7.23.5\",\n        \"@babel/register\": \"^7.22.15\",\n        \"@types/node\": \"^20.10.4\",\n        \"babel-jest\": \"^29.7.0\",\n        \"jest\": \"^29.7.0\"\n    }\n}\n```\n\n#### .babelrc setup\n\n```json\n{\n    \"presets\": [\n        \"@babel/preset-env\"\n    ],\n    \"plugins\": [\n        [\"@babel/plugin-proposal-decorators\", { \"version\": \"2023-05\" }]\n    ]\n}\n```\n\n## Usage\n\n## Interface\n\nReflectype lets classes can implement Interface like other's strong typed language. To create an Interface, define a class that extends the `Interface` class which can be imported via two package's paths 'refletype/interface' and 'reflectype'.\n\nThe Interface class will prevent us from instantiating object on it's derived classes. \n\n### Implementing interfaces\n\n``` javascript\nconst {_implements, Interface} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@_implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n```\n\n## Type Checking\n\n## Class Attribute\n\nA class's property is determined as an attribute when the keyword `accessor` is added before the property indentifier. `accessor` is not official Javascript's keyword, It's come with the TC-39 Proposal decorator for Javascript.\n\n### Attribute type\n\n`@type` decorator to define type check for an attribute. when setting value to an attribute, Reflectype will check if the type is \n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @type(Number)\n    accessor id;\n}\n\nconst obj = new A;\n\nobj.id = 'foo'; // error\nobj.id = 1; // valid set\n```\n#### Type with interfaces\n\n``` javascript\nconst {_implement, Interface, type} = require('reflectype');\n\nclass ILoggable extends Interface {\n\n    /**\n     * Declare methods that we wish a derived class must implement.\n     * method body for an Interface class is useless\n     */\n    logConsole() {}\n    logFile() {}\n}\n\nclass IDisposable extends Interface {\n\n    dispose() {}\n}\n\n/**\n * would throw error because this class has not been defined log() method\n */\n@implement(ILoggable, IDisposable)\nclass SomeClass {\n\n    logConsole(msg) {\n\n    }\n\n    logFile(msg) {\n\n    }\n\n    dispose() {\n\n    }\n}\n\nclass A {\n\n    @type(ILoggable)\n    accessor logger;\n}\n\nconst obj = new A();\nobj.logger = new SomeClass(); // no Error\n\n```\n\n\n### Attribute nullable\n\nUse `@allowNull` to let the attribute can be setted as nullable (null or undefined)\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @type(Number)\n    accessor id;\n}\n```\n\n## Class Method\n\n### Method return type\n\nWe can use either `@returnType` or `@type` to type check return value's type of a method. The different between the two decorator is @type can be applied on both class accessor properties and @returnType just only be applied to methods.\n\n`Void` is a predefine class to help `@returnType` prevents method return anything (return nothing is similar to return undefined).\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n\n    }\n}\n```\n\n### Method returns nullable\n\nWe can apply `@allowNull` on class's methods to allow the method return nullale (null or undefined) when the method has return type.\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @allowNull\n    @returnType(Void)\n    print(id, name) {\n\n        console.log(id, name);\n    }\n}\n```\n### Method paramerters type list\n\nUse `@paramsType` to pass a list of method paramameters 's type.\n\n```js\nconst {paramsType} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    @paramsType(Number, String, String)\n    foo(param1, param2) {\n\n        /**\n         *  param1's type is [Number]\n         *  param2's type is [String]\n         *  arguments[2] 's type is [String]\n         */\n    }\n}\n```\n\n### Explicit method parameters type\n\nSince version 1.0.0 reflectype provide @parameters decorator to help method's parameter type hinting more explicitly. @parameters strictly read method's parameter list and then comparing. If we define parameter whose name didn't apear in the method definition, Error would be thrown.\n\n```js\nconst {parameters} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({param1: Number, param2: String})\n    foo(param1, param2) {\n\n    }\n\n    // valid \n    @parameters({b: Component})\n    bar(a, b, c) {\n        /** \n         * a's type is any\n         * b's type is [Component]\n         * c's type is any\n         */\n    }\n\n    // invalid\n    @parameters({param: Number})\n    anotherMethod() {\n\n    }\n}\n```\n\n### We can add multiple metadata to parameter when using @parameters\n\n```js\nconst {parameters, allowNull} = require('reflectype');\n\nclass Component {}\n\nclass A {\n\n    // valid\n    @parameters({\n        param1: [Number, allowNull],\n        param2: String\n    })\n    foo(param1, param2) {\n\n    }\n}\n```\n\n### Method default Arguments\n\n### Default argument list\n\n`@defaultArgumentList`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArgumentList(1, 'john', 'extra argument')\n    print(id, name) {\n\n        console.log(arguments);\n    /**\n     *  output similar to [1, 'john', 'extra argument']\n     */\n    }\n}\n```\n\n### Explicit default arguments \n\n`@defaultArguments`\n\n``` javascript\nconst {type, allowNull, returnType, defaultArgs, paramsType, Void} = require('reflectype');\n\nclass A {\n\n    @defaultArguments({id: 1, name: 'john'})\n    print(id, name) {\n\n        \n    }\n}\n```\n\n## Method Overloading (Multiple Dispatch)\n\nReflectype provides the ability to oeverloading methods like other object oriented languages (C++, C#, Java). The concept and keywords inspired mostly from C# language.\n\n### Multimethod concept\n\n\n\n### Usage\n\n### Generic and Pseudo Method\n\n```js\nconst {METHOD, returnType, parameters} = require('reflectype');\n\nclass A {\n\n    @returnType(Number)\n    func() {\n        /**\n         * this is origin method\n         */\n    }\n\n    @parameters({\n        param1: String\n    })\n    [METHOD('func')](param1) {\n\n        /**\n         * this is pseudo method that is an overloaded version \n         * of the A.func() method that has 1 parameter accepts \n         * string type.\n         */\n    }\n}\n```\n\n### Overloading Without Declaring Pseudo Method\n\n```js\nclass A {\n\n    @returnType(Number)\n    func() {\n        /**\n         * this is origin method\n         */\n    }\n\n    @overload('func')\n    @parameters({\n        param1: String\n    })\n    anotherMethod(param1) {\n\n        /**\n         * this is pseudo method that is an overloaded version \n         * of the A.func() method that has 1 parameter accepts \n         * string type.\n         */\n    }\n}\n```\n\nMaxium number of type hinted parameter for each method is 32 because part of the overall algorithm for method overloading designed in this package is heuristic approach, the decision for choosing the best match method signature for a particular argument list depends mostly on the statistic table that uses numbers (32 bit) to store indexes of a specific type which is potentially been declared.\n\n### Single Dispatch (Early Binding)\n\nCosider the following example written in C# \n\n```C#\nusing System;\n\n\npublic class A {\n\n    public virtual void foo() {\n\n        Console.WriteLine('A');\n    }\n}\n\npublic class B: A {\n\n    public override void foo() {\n\n        Console.WriteLine('B');\n    }\n}\n\npublic class Test {\n\n\n    public static void func(A o) {\n\n        Console.WriteLine(\"overloaded for A\");\n    }\n\n    public static void func(B o) {\n\n        Console.WriteLine(\"overloaded for B\");\n    }\n\n    public static void Main() {\n\n        A obj = new B();\n\n        Test.func(obj);\n        Test.func(new B());\n\n    // result in terminal will be\n    //\n    // overloaded for A\n    // overloaded for B\n    }\n}\n```\nThe two invocations of static method Test.func() print different result in the terminal because of the first ivocation \n\n```C#\nA obj = new B();\n\nTest.func(obj);\n```\nThe type of variable `obj` is determined at compile time is `A` no matter what the exact object is passed to the variable is an a polymorphic type of `A` and lead to the result that the method variant has signature `func(A o)` is the best candidate to be dispatched. This case is called _**Method Overloading**_.\n\nLook at the second invocation\n\n```C#\nTest.func(new B());\n```\n\nThe type of argument is supposedly determined at runtime, compiler couldn't detect arbitrary argument's types at compile without type casting. This case is called _**Multiple Dispacth**_ or either _**Multimethod**_.\n\n### In context of Javascript with Reflectype\n\nscript for test \n\n```\nnpm run test-method-overloading-static-type-cast\n```\n\n```js\nconst {METHOD, parameters, type} = require('reflectype');\n\nclass A {\n\n    foo() {}\n}\n\nclass B extends A {}\n\nclass T {\n\n    @type(A)\n    accessor prop;\n}\n\nclass Test {\n\n    @parameters({\n       param: A\n    })\n    static func(param) {\n\n        console.log('overloaded for A');\n    }\n\n    @parameters({\n        param1: B,\n    })\n    static [METHOD('func')](param1) {\n\n        console.log('overloaded for B');   \n    }\n}\n```\n```JS\nconst T_obj = new T();\nT_obj.prop = new B();\n\nT.func(T_obj.prop);\nT.func(new B());\n```\nresult\n\n```terminal\noverloaded for A\noverloaded for B\n```\n\nThe code above is the Javascript conversion of the illustative C# example before. As a result, contents printed to the console is the same as the C#'s version's. Any type hinted properties of object are `static_cast`ed to the type where they are stored. In the JS example, the object that is stored at `T_obj.prop` is type of `B` but T_obj.prop type if determined as `A` so that when passing literally `test_method_overload_obj.func(T_obj.prop);` the type of the object stored at `T_obj.prop` is casted down to `A` and therefore the method with signature `func(param: A)` is dispathed.\n\n### Context Based Argument Type\n\nLike other oop programming languages, arguments will be casted down as the declared static type on the method even thouugh they are subtype of the parameter type.\n\n```JS\nclass Base {}\n\nclass Derived extends Base {}\n\n\nclass A {\n\n    @parameter({\n        param: Base\n    })\n    func(param) {\n        /**\n         *  param is now considered as Base\n         */\n        console.log('base');\n        this.func(param);\n    }\n\n    @parameter({\n        a: Derived\n    })\n    [METHOD('func')](a) {\n\n        console.log('derived');\n    }\n}\n\nconst obj = new A();\n\nobj.func(new Derived());\n\n/**\n * this example's output will lead to stack overflow \n * because A.func(Base) is dispatched recursively.\n */\n```\n\n### Type Coercion Lookup\n\nThere are 2 special types would be \"casted down\":\n\n- Number -> String\n- Number -> Boolean\n\nEvery Type would be \"casted down\" as Object.\n\n### Nullable Parameter Branch\n\nNullable branch appears when there is nullable parameter defined on a specific method.\n\n```JS\nclass A {\n\n    @parameters({\n        param: [Number, allowNull]\n    })\n    func(param) {\n\n\n    }\n}\n\nclass B extends A {\n\n    @parameters({\n        a: [Number, allowNull]\n    })\n    func(a) {\n\n\n    }\n}\n```\nThe following example Illustrates ambigous definition of nullable overloading. When dispatching Nullable (null or undefined) to first parameter of A.func(), there are conflict between A.func(Number) and A.func(String) because they both accept nullable value as their first argument.\n\n```JS\nclass A {\n\n    @parameters({\n        param: [Number, allowNull]\n    })\n    func(param) {\n\n\n    }\n\n    @parameter({\n        a: [String, allowNull]\n    })\n    [METHOD('func')](a) {\n\n\n    }\n}\n```\n\n## Current Benchmark State\n\nscript tested\n\nTest directory {root}/test/reflectionQuery\n\n```bash\n# firstly, install dev packages\n\nnpm install --only=dev\n\n# then run \n\nnpm run test-reflect-query\n```\n\n*new benchmark\n\nThe new benchmark focused on operation's time of each phase of the algorithm. \n\nExecution time in detail when dispatching a 3 parameters empty body method for one hundred thousand times in 10x3 dimensions method space (when JIT do it's job in optimizing codes).\n\nBenchmatk machine\n\n- CPU: AMD Ryzen 5 5500U\n- Memory: 8GB\n\nEnvironment\n\n- Operating system: Ubuntu 23.10 linux kernel 6.5.0-25-generic (performance mode)\n- Node version: v20.11.1\n\n\nThe overall time for retrieving the most specific appplicable method for each request is around 0.005ms when requesting one hundred thousand method invocations.\n\noverral execution time (for each request one hundred thousand method invocations):\n\n- estimation phase: 0.005ms\n- retrieving most specific applicable signature (lookup signature using estimated datas): 0.001ms\n- extract vtable: 0.001ms\n- down cast arguments: 0.001ms\n\nIt seems like the operation time of the argument down casting phase approximately equal to the estimation's time because the two operation is identical. Time complexity of the two operation is O(mm) with m is number of arguments and n is the number of each argument's class inheritance chain.\n\nTime average for invoking such a method is 0.010ms.\n\ntime average for iterating a an one hundred thousand times empty for loop is 0.6ms.\n\n*Current development stateV\n- [x] Explicit type matched arguments\n- [x] Interface type matched arguments\n- [x] Single dispatch\n- [x] Dynamic dispatch\n- [x] Multiple dispatch\n- [x] Nullable parameters\n- [x] types coercion \n- [x] virtual method behavior\n\nNew approaches:\n- [ ] argument type caching\n- [x] static type binding (pure method overloading)\n- [x] evaluate Any type parameters\n- [x] interface method strict parameters\n","readmeFilename":"README.md","homepage":"https://github.com/tanhuy998/reflectype#readme","repository":{"type":"git","url":"git+https://github.com/tanhuy998/reflectype.git"},"bugs":{"url":"https://github.com/tanhuy998/reflectype/issues"}}