{"_id":"clone-class","_rev":"55-bb936b5589115c2fb5d47458c2068802","name":"clone-class","dist-tags":{"latest":"1.0.3","next":"1.1.2"},"versions":{"0.0.1":{"name":"clone-class","version":"0.0.1","description":"Clone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.","main":"dist/clone-class.js","typings":"dist/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"gitHead":"3eb9d2bd6795444205731e0b47a5063b43c112fb","_id":"clone-class@0.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"chatie","email":"dev@chatie.io"},"dist":{"integrity":"sha512-FCA0YyCcG41Tr/G/6zSg3e/xqLVKc829B/MBsX9vKFqVeEMJghsr5H/4jqss79CCUU87PTg/eskTPNRZT0Ry1A==","shasum":"cbfb104100330ee9a659c475bf7c3fba2f990498","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.0.1.tgz","fileCount":17,"unpackedSize":27180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3cLtCRA9TVsSAnZWagAAPGEP/1zdiVG9VFggZGwwHkNq\nnvc9EeisWso5TLUDgZvhCIqbFgSaTWTqTAr2LPSmvC0JDYjvA9m6NFzeynlv\n2++3PBd5+txHOIpw5iJoriiMSqihUsxP6YGd9l8kTdh4knKzRRGqx5zkr6x9\n3ao+ujs8xlHegl3pkNJYzVIPdaExjvTzbYJJhhgOX4w2BuK9Lbm0mtuTu484\nV2/V3QhZrTdMZ+ceTpz3Ig0xBM2ScB1mvgIf1fvHPHeLZAF6e5kZciUlvbOf\npw4cReP8IqIi17I+x36NilxsIYb5sLWqOA0CCuzabc1nARwPzM58ong7sdFe\nNuSya4czc6/cl2DOOnx9w7f/nyG+IsvPy0gL8MI5MaBb/lTQjmV+MVH3MxpG\ngKwR+zTx/Vm3DiwEXNVKOHtcgd2bWwG4ZSIsm6yeZSPQVdV7/PerZSbR0AHU\np0NTsDCOFPyHxsyanZ+259uIouOF0qFLNy607y67ApeL0XSAvoy41hPF8yws\n4NL/xfj/9SZV7wJ7xISEb7MzHkBie0Zp85kyX86MoV1OAyLvv70piHZ3gd3C\nFKOoZpVlXlWyaQBXFSTIbEtS5an60US3fbi71GtOAgcnZnTD1pmnRNrZZazB\n1MIbpw9Ft8Em8+9tloyt14RnoO5DMTaG+pwT3ot1OoNjbsCloSpSOSuQGD5A\nkOcl\r\n=Y77X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxqTRIz2f66JZ5XuxQugjgfHP3uK/rg+7OxUQKrnz1NAiEAscNn/CSS9XMzxAFp/pVkNW4ivQWXCA4+LZsbMVugCx8="}]},"maintainers":[{"name":"chatie","email":"dev@chatie.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.0.1_1524482797161_0.11619316925136292"},"_hasShrinkwrap":false},"0.0.4":{"name":"clone-class","version":"0.0.4","description":"Clone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n\nClone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.\n\n## EXAMPLE\n\n### Shell\n\n```shell\n$ npm i clone-class\n```\n\n### TypeScript\n\n```ts\nimport cloneClass from '../'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employee1 = new GoogleEmployee('Tom')\nconst employee2 = new MicrosoftEmployee('Jerry')\n\nemployee1.info()\n// Output: Employee Tom, Company Google\nemployee2.info()\n// Output: Employee Jerry, Company Microsoft\n```\n\n## CHANGELOG\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, seprecated from Project Wechaty.\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2016-2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n\n[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/wechaty\n","readmeFilename":"README.md","_id":"clone-class@0.0.4","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-4mwijHoSHHT+05b3IlyA1+SLS9vs9i9nriN/dE3RL3w1t8cmk/TWEcASBh4JM9QBAdqQEAxHNHy/El4tmgwdDQ==","shasum":"2986ee95b2498e3949883eb9a398706f06168731","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.0.4.tgz","fileCount":17,"unpackedSize":12192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3c2RCRA9TVsSAnZWagAA2kUP/RwFGZswrFhQTijXFksO\n+ltDbPDaV9Ar9f/2izyF1W8R1dVAK7L5MyGvHZYysxgUND14TNuwalx9v9E9\n+IGODxa3IU4uxfTfO8C5gXi2Uo3Exm6KiB37mxHmHww9SwewxxcIVu4WE4A4\nP+MU3rDFOPb2vsZhAOWJYt/GPsl3kIq/05GCWfHLEuV83LgzVBaiUZVgfx/E\nzyUrutGw6mU6OVSHDwhl4HVtMjfvetmcLegu0ThPXPO+mP3BPOn4U6YYINHF\ny7FcZZQMNoomRU+zWmmKaI8uZGmPe3G7W/txiKDHH4KKqqecEN2lUJdzQogX\n7wrZEMGIxz4CRvTc64ksLK7NtxQ0kegCBAn8UZ6/IdJiqfjG6AccLsZv04Vk\nPvrVmHIpKxa9dYhvnexQkC0Em3M/KeEe/+4WsJ9cxYcmhZmauw59BVlxEY6u\nHvX6XGDa9CzcNs61dBb9TV+oULZKyvPAnrdTM9g33uc9yvD0rgczvz8+0vDM\nO7/1f+vc9fiofyVuKKP0XnoV0nlNdAI9gSb+s0WnipHklVcDzCHK0USxiS9x\nNtA/0I46i8nCID0dxIdtu3FhJTE0vEGy5uQJTE/0Gr8pCjrbsH8HxfDYOGWk\ngm6draCc0+PJR5TSt2PFnDUgV1uiSxSBdfKGO8FItB3PbSCi/Yv02AtZpRyp\nuXRX\r\n=IrMc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlEZlzVvpvfGqX9NU7G8rRVUrdtxDmB4fJyl12NMCfDAIgElQOH57ngQnU6QExAhSFlXXM1ja+3j0pjiyclI+A4Do="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.0.4_1524485519748_0.08232386739300201"},"_hasShrinkwrap":false},"0.2.1":{"name":"clone-class","version":"0.2.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n\nClone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.\n\n## EXAMPLE\n\n### Shell\n\n```shell\n$ npm i clone-class\n```\n\n### TypeScript\n\n```ts\nimport cloneClass from '../'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employee1 = new GoogleEmployee('Tom')\nconst employee2 = new MicrosoftEmployee('Jerry')\n\nemployee1.info()\n// Output: Employee Tom, Company Google\nemployee2.info()\n// Output: Employee Jerry, Company Microsoft\n```\n\n## CHANGELOG\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, seprecated from Project Wechaty.\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2016-2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n\n[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/wechaty\n","readmeFilename":"README.md","_id":"clone-class@0.2.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-gHTy/wW+t/D7jXlHvH12rwtxvBpIpm6w1yk5h+8GsMYBj7YUFKUW9GH4zhTzI5zBE08xakySpKxRL06YD3K8KQ==","shasum":"1af44dc103c95dd7aa32a7d1aa2b5fc77fcdb048","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.2.1.tgz","fileCount":17,"unpackedSize":12183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dAFCRA9TVsSAnZWagAAww4P/RELeBBVXm5uimGAPZIg\nnUDZRwaKXCCU3LC3F1Dj3Y/U9B7qoDkPsOO/suVbqk4zLUSC7lYy+rOChFSF\nP78Y01BCtorsJffZ3VY6Mk/abyiT/PHMLMeFU79XgCR9wAufE1Us+AKeBy6D\nNXuGcQiEmGjdBbL+KK5IMkblLYwIlpm081LppGkK8NgVpIZb/ZecZ+PSFLS9\nXCfiE2W0mvS/0bwMZzKn/IvI5tuzNqCksB7XQ1w91bFQhDITrCWbkFsY3tuw\nAkneZTE0/Q7GWXlso1OWR6/HGfRzoQ3441bNiw8PcE6kjRscSk8/0EMca4HK\nvFy5JKqGoDO2/pFHPispp+lBOSOltjWklJrDFUqo9JCEK3OGFSurcgC7QetD\n5z0N3TEyKGyItVjXH68iHrSkX19SQy99ugY3zKxAgnowrImiyM5LA1e9LH9f\nbA8dMb9d9oHBfWwlf/Eqz1oFiztH/VRzux9LvvkHalVG4/MJLit3IasNK5te\nQ6dAM2wAHbwvrUMaicc7ImNpGOD8K8YSwISYQNcUQjjAmFdE9Dyn3v/PhyMT\ncDXjU0lYMZv9bzjz43vG0hhXLlxnXh+hD/1tRCtDTcpGDA4sm7rFsmjV8fHS\nBqD/lY+wrJauKVkjz1eHHAcKc26jGs7Fd4Urpo21saxFC4wGW4ExDrJsaRXC\ncsxq\r\n=og1m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFeanfRweu70Gg678lZ44Df7geri/zvDOCjJ/JliWUK3AiEA12GCu4xqdiWHsVNhnZCwoeCw0REV4a5THkLVexZmM+c="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.2.1_1524486149536_0.6598269584934062"},"_hasShrinkwrap":false},"0.2.2":{"name":"clone-class","version":"0.2.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.2.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-7m3RW3GTLYkB+t2REHUsSoT6kBNd5YVOZoLwNryLSXcFP2phlqCBzPyzg0C+rG3IGXF8HWd9vTs59/q2m5eC6w==","shasum":"71dd9c788baad86b3b2933f7fdc6d188cfdf1c86","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.2.2.tgz","fileCount":17,"unpackedSize":12233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dH6CRA9TVsSAnZWagAADLcP/3YGStGj3HKkZ4W6Vgab\n1z0NWDED8RGg8xMGxrW2YfcaN1c6TnggkOwFSSfyKuk4MBhqquR8Vc82nBpA\n1vqCyW13q+ySvzD13JE/MYD+0T/JnmuBMaCR3+5yUBxf5gfF5z+uWlMPXSMD\nNM388JCojB602euEhEknUCFKlXNesjy228NNHTOSQUg9+p3XNqH2onyy1K3S\nZFlWJwj2gHtMLs9NlDZfQ9523nSf19r1O7BRZ91zPuKzK5kefYO4h0PEYfAZ\n77WQb2BqlpIoRx+pAiOXiPPXg4C/w3maNi3e0OcYq+1nTkAp2HysQJF3rBs/\nuwhmNxx2Br9nHSMA8Z6Gt7GnLlKN5GkkgNSBME7D/jDvR6pmT/mMbXHvBhM5\n4tq7fY5st0jWv3FcSNo7dtTX2FtqCKPI+YBsPg/am8DZ6ma/GT4j07dYR9zl\nU5cbzrBn0vsbFSPQRsOz6HXJRZq3kEll4c73Sx3CZDj2kCS+Fe7D2gSE+sgR\nd8kJVAddHA4hSzt2akWv1vD0Mp0RSXu1KLij4oVojZmPvrPX8EhvHBCUhV3s\nrdfhLlK4mmQOQHB4P6aIWLaY+2RQ2uKEvsv7q5tJ9xf7/MC7n0fMsr9Vj75O\nCMNmIw+WdHttuh3mXr4MfVqsirbYZwSnoLQbffnGy1sBYqMrvauA/6jv3zVr\nsHT7\r\n=ozW/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHvdj1pOsOn4OJVcPdJQ7g1B/uoI0OzHi7bjLnJ/VKvwIhAKiLvO7axEUrkEolPNcynrkQlTJcta2ic/jeBapqR1z6"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.2.2_1524486648705_0.5690029002200079"},"_hasShrinkwrap":false},"0.3.1":{"name":"clone-class","version":"0.3.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n\nClone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.\n\n## EXAMPLE\n\n### Shell\n\n```shell\n$ npm i clone-class\n```\n\n### TypeScript\n\n```ts\nimport cloneClass from '../'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employee1 = new GoogleEmployee('Tom')\nconst employee2 = new MicrosoftEmployee('Jerry')\n\nemployee1.info()\n// Output: Employee Tom, Company Google\nemployee2.info()\n// Output: Employee Jerry, Company Microsoft\n```\n\n## CHANGELOG\n\n### v0.2.0 (Apr 2018)\n\nFirst publish version.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, seprecated from Project Wechaty.\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2016-2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n\n[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/wechaty\n","readmeFilename":"README.md","_id":"clone-class@0.3.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-ikPzPVI8QOo0VFSSahzk1W4EcuDLek7al3nMK5y6Tvrdzh+y741ISWcZ+gU8hKxKjfj2FilvZm+lLRSkRHarUg==","shasum":"31b5da7c650509a2351a41caa51dfa93ac0009c6","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.3.1.tgz","fileCount":17,"unpackedSize":12230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dNCCRA9TVsSAnZWagAAf/4P/ie8f4LM9X9DqIoGjlgc\nkkyVW5rD0fbqOaSZV9rgTAY2i/4vEvghMpN3oKg1t9mffnkDdJ1PGzvyLVco\n00HEzPjANImJrdrfN9Jx1ssmUlnWx0/J5vSQHfUXTohgEBMqMeAFvShzUfBp\n0KMTIDx6xMyerCvOU9rlGIxj9oajqLn6SEkBnSSccQ97/7Tf5uFb2+0rRp8h\n55RcLnj/AEsmdFWN/nwMmmMJanpoc6iELJ4ttVlsFH9b3kDZTFXNvEfQC5AM\nvi6ztILAVkRTpPBdQvD0T1dULlVpRFFw0C8N3+r8mtDCXSf/TLdVTi2+X4h+\nNA9Me0SqljmGaIvW+XBdjtfh/yKhf+3W04NP5UMBGzIqowgAi5IFIu6/95qJ\nPL8Ie7ZJiCcUcCi2g1skpglyetfJPSdll25PHQJD00/qllGR7yqzkCwbaX1u\nJfSYyezF5s3Aj4zFsu7CC1MDQFXvoU8RTd4c1XbeG0TaBj0Tp6PB2EtWVJGh\nyUoixcpN6QVJrWrTyeqV2QjfQGc+8QbOgyHi4F9Owd4kSwenfvueeBcgLb5e\nukCrNBPGryskjwUwv1Xo/AAl6CtygoZqfXsxZyztN+lQZsbTIFC1iDReEo4P\ntr9lfEw9SGtgukf3A6DsLYKXRWQpuzTjK2U9cI1MLDHDNckOzrOYE2TJiYCe\nncGN\r\n=d6zJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErp28xH+GjLwVbliABFhuSv90soHb4JsjEtIoLNfKWAAiBUVIFn5xNxLyGogcnXsAqQoMbpZNmG4WvxhQnzvnAwAg=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.3.1_1524486976552_0.24815923668021234"},"_hasShrinkwrap":false},"0.3.2":{"name":"clone-class","version":"0.3.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.org/zixia/node-clone-class.svg?branch=master)](https://travis-ci.org/zixia/node-clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n\nClone an ES6 Class as Another Class Name for Isolating Static Properties in the Classes.\n\n## EXAMPLE\n\n### Shell\n\n```shell\n$ npm i clone-class\n```\n\n### TypeScript\n\n```ts\nimport cloneClass from 'clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employee1 = new GoogleEmployee('Tom')\nconst employee2 = new MicrosoftEmployee('Jerry')\n\nemployee1.info()\n// Output: Employee Tom, Company Google\nemployee2.info()\n// Output: Employee Jerry, Company Microsoft\n```\n\n## CHANGELOG\n\n### v0.2.0 (Apr 2018)\n\nFirst publish version.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, seprecated from Project Wechaty.\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2016-2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n\n[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/wechaty\n","readmeFilename":"README.md","_id":"clone-class@0.3.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-A55E7Btf2Py13pH3du2V40CWqT/aLGrBlsKUCDAM6ovQ1BEmOqAmmjz/LP7YBafPaNHo+tg+aH2Rhlz2l95RxA==","shasum":"e78eb2ce65adc537afe4d295e8743bfafe6edf6c","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.3.2.tgz","fileCount":17,"unpackedSize":12577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dYgCRA9TVsSAnZWagAAIXcQAKQ9RZKdBlAzjQpupytQ\nympsGBdLGgtpL26VhW4sPgGoFl+TwYPlGrdFu8DxaE4shBd3O4jEI36KcamC\n8Apwg97y9ySNxOXg3d+Rh017b7FHVBU7UwuoPpV/vtAphz0UMyB2tN1P/4wu\nvxRQNhXiQXInPt0dqtvb/TgEIX1Wf2pKMz/vYpU/R0tlvgXQWGjqwWZOkVMl\ndzemM0ut7AlVEW2Le00pHiyOuJ3bE3WcEVjuEsfQlbrxOoeI7IP30AtR3M+h\np9eh6e2WnnTI9CIOvYds6Uvewhs38tQses8H7V8rH13VaUVCyMOhwZWh5mFg\nUJUZFgefTGUT2YWuzLw6eID2KwRpaj06IUfqJDXSp0e5BMrOkQOFx8kil+dT\nh6NiqJyPOT5DdjQV7zZF1OCPIR/fxDp30F66SWdHFBhHfisrdlxoBnVxnrmq\nRJj4cWgPdkt/++CiwFCwvn0ebp10KDwStt14i0cPEJXHDNgL2B+u0/YPLdos\n2a1/c0ySppSUKCbcufVPl4YsRndpr0UhBiRg+it0h6WnVO13/8p4s2blHkkP\nSPuOIFgeD/axyL9yi9OL3WmoAUcxu5sUOA/7pWV0iHJuBdH3imjEyNNPeBtN\n8PAT+RjNSBtv+akCoqSxbGKENs3Y1viWJSDbvKHyLGlabW52q8DDHx37SD0V\nIXIV\r\n=HZD5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhol4wMo+M/4pZZ1VaZz651/GUiHNNivl4u27HbiSTfAiAeXVlLf2W8DZ1+AJ4SKgXmQU3SJDnPEjQMggmUFHdYRg=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.3.2_1524487710877_0.3461325367728527"},"_hasShrinkwrap":false},"0.3.3":{"name":"clone-class","version":"0.3.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.org/zixia/node-clone-class.svg?branch=master)](https://travis-ci.org/zixia/node-clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\n### Shell\n\n```shell\n$ npm i clone-class\n```\n\n### TypeScript\n\n```ts\nimport cloneClass from 'clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employee1 = new GoogleEmployee('Tom')\nconst employee2 = new MicrosoftEmployee('Jerry')\n\nemployee1.info()\n// Output: Employee Tom, Company Google\nemployee2.info()\n// Output: Employee Jerry, Company Microsoft\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## CHANGELOG\n\n### v0.2.0 (Apr 2018)\n\nFirst publish version.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, seprecated from Project Wechaty.\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2016-2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n\n[downloads-image]: http://img.shields.io/npm/dm/wechaty.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/wechaty\n","readmeFilename":"README.md","_id":"clone-class@0.3.3","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-DEv9q2PTQFYlcwdIAECLUnyWcd8WoA3sA4mhdwO3JPjLpC8JMyBScCCTJrfePJaPVpb0oxbqc5ZNCa/H0DmG5g==","shasum":"df84b95bae7864a0cf8d10d3587f3bad8d4d4806","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.3.3.tgz","fileCount":17,"unpackedSize":13200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dgPCRA9TVsSAnZWagAA2qgP/2s0mga3s4TE2ELsVtx8\nbAw/UQyrNIrMKg7xgy8nAt2B5rKZr+gzGVoBV8YxrZQwLmuK5lv1Z577f/X9\nqqJqwWdRvNZDkUSJw8QaFyNH87tM7BKQXfHKHP/NPYwwdqOunY6edg/MQ2+s\nWfVmM3Cfo7r/Pxk3H5mNLDglqSBwJfOEMjBVk8WW9Y+8u86mzddqk8+qx0vL\nT/GuDkDtYpeJ/fDtsx5PAB941W/xn7e4D/A2mw26VivSAIIPEAFA9y2ZrVNS\nzBffxqBL/uQA6tf2DjAOgfBTsdx6BOhM1tcK4Cdkgq54q5uBnhNDVqDyUkU+\ntUG/+Ix2AdrWGaQk/cuWNWGJQJfOI431qNLKIXQIivC6xrNLOEJjW/txT6cB\njR4+o+8x2g8Mqrzew/dP6BlCk9eeUxOv1wcjKEOCi3P0aGW3zdX+K6nNII1A\nbpEQNVfYrTk3MAddhSGBSr/PPT331rp1I+Ic+GaR2tbAH1pD6HhtpbPIMb7g\nc00EGiBCSfbonOwLgtb2PpPyFjCsOBaWkmbJldTj8jGTVocQSSqcNaxGWf2m\nwlTEliTdgdJ3GeQWjSnpWGDs511N/f7i1UuwdXoXqhGjcsM1cZEGWmzQYyKR\nDTqk2XK6vvM+2YyW7/pLG9O1jQY7Z1bbf+4KQNrh1MRWxjynuWlFVV1xBdrK\nMj0R\r\n=BOqq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7XROZHWfvIiU2HBvYv3O07SkAuw44Y0yuqZOvRe7W2QIhAITMKJXQMa2nO6sPBEPWfdb6A2w4u1oqSF4UTUTBs790"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.3.3_1524488206405_0.6692019050640821"},"_hasShrinkwrap":false},"0.4.1":{"name":"clone-class","version":"0.4.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.4.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-i38DBncMCbM751YzgKBl4gqwGzLXXEvpiavr6qyULs0osZUdD+kE1TUwDZnPN75yCCmEtUKCWgx4IdRoxQY3sw==","shasum":"d8fd73cf6167331694a0fbb57dbffa465a6a327c","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.4.1.tgz","fileCount":17,"unpackedSize":13203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3dkZCRA9TVsSAnZWagAA0gcP/13Z87+egu63H3vUVk9y\n7sscZbWJi0k+nxrl/l9C5t4QkMzyINGsd4vSkpYxzOCCFtAKSejW/Jn9XB0X\nqgKS0rXXPOo7L/3BIWuuwqd5ACXsbfSd5uVGp93f7DSdrUjSk3ZHUakQ+DSL\nFhGD1Oi0gtrRU+veJG7eCGQydZdAyG8m3+sTbsOAj41nHqgcLtLir3k4DwF+\n6REsByORcuAxUBLa2EqyRJ3D9PamRN/UcQ71Ca8fWkL3b5AXhSyuNxsDAZqL\nwK9/wnIRPLW5jpvWFcl9H8YXxvP4VWQl/VuOBn0QfyHbq6KX1si7ZSYNNQAP\nwC1Az9JA691w+haLfX0tA1ZpjBoYZvSKoO7z71n4WALJzQ9NltVc06sEyxPG\nKcl/fx58KUhUoT5W+LattKeuHysdy7vDhYpc6PQnYL3fJRDEeV7USpho8a/I\n2D9Ub2KpoEmJ1ySAI/VMZGH+B7jVu/CHfHally/1RivkHbG4db7LdvJR+rAy\nFDUArARvWnX8b+YrqUQOz2vy4wNoPdDgrWmAmZRlSUUUKH9CsbQrJPMQueFd\nDVOBD0wiGKW5VXFAH/49LsSIcs4bXuXr19YSvnq1fcIbDDnx1AGB6knxCliy\n5yO3vxZeAUWbwa1eKCM3yGEvfl4FP2TEudAvarD6iwVPA3jaHCBRD5kh9pqE\nOQy8\r\n=9Sps\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxu3Uzw3H0l+ZYKEq35BJhEAnL2yBux/VLuyDGDoON8wIgK1cWBS/20KvIxdoQoFWxwtTjge6aTrObepbDlYc1gzw="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.4.1_1524488472360_0.889336516312621"},"_hasShrinkwrap":false},"0.4.2":{"name":"clone-class","version":"0.4.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.4.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-GKmH6mqeJn3SlpD8rPVSI3d3WDtKbpbGuGWWr4V1L+XHIyzLxeywQxRpa0Px/yWYYtWYN2OljcJV1HmkXL8xTQ==","shasum":"e7472d5117ca227f6e15105dce5d81d802bce94e","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.4.2.tgz","fileCount":17,"unpackedSize":13493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4BCrCRA9TVsSAnZWagAAfqUP/0eWu+96LTpvSgCsnI1/\nTStXP8dpNzXiPRvDHu58FTE3Vyal7z0IkWfi9qr2APVzd+aBvCxAev6qAsk9\n97DtzLTITvrVgIYPJAtK42gNPrJAzWudVLV7qLm+/rDP9ILvIOI3wDYs6+wq\nTp2Z6ILbnU0cqsIUBmIDKyb1/w14BeIK/3MNQmq8tKXAJAYZOoeCLm03gNwh\nz+4/r8vlH+ep1J3hdzPjIATwGwnBG3shuoL9d28+po17BdpcLf9U6yUqQR4y\nQKdvfGBNBQtXbo/0kKeB6ow2GoKMbIDDmNjeCF9vsK292XZJsqu6SEAA3WMB\ndSCwaSIs0p7r7IfQIhvQn4T/WiAZMPOvH9jwJQbE/ZqePBP7nFtLHGZ6bFRj\nTzLt/Vfeo66Ya9IvH8gHuSbvgbn5yWWZPZOKBun5wve8k6F+upXluTMyKsVr\nKztPqtRtqLHlFNgU7zXuqG3M8AM15d97NttUiRNGaWr5hPOcMLe4LPkywOvy\nK6jdwb42DY4X/9YN11OWlStmxuJXL+qz+vfZM4qpadSxOzyuNG2k8LDZqE2A\n6Rhd1eT51wfDVZxTg+wTAgYjPpY0c+QDg3TNFG1oYdlIY0gC/olMETqQeY0G\nS2aKIRw6rqQZmJkUSO+gl9CgtBpDvF6kTCgmIRmAqoi2Z2SYdEuOT/hypwQn\nmdoa\r\n=I3sk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGy+71OQrv3WpdUBY8g7AnZZJdjXQRydvcrvjj5VYf29AiEA0uVmb97J/ypbW/ynoURhOP1bnAU858qGb4AqrLMb9Lc="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.4.2_1524633770462_0.1277123034570884"},"_hasShrinkwrap":false},"0.4.3":{"name":"clone-class","version":"0.4.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.4.3","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-ZchXz61o91myLlgA9lp+5x2MreIu7UWMrXPjAcbrHOmJcYekPji8VoVpOSX6cI3RSFUWxqIit2TS6N9herBMgg==","shasum":"b21507db1ff10f729a10ecd8467be058921bd877","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.4.3.tgz","fileCount":17,"unpackedSize":13648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4BFwCRA9TVsSAnZWagAA0WAP/27FK+vfS2q9G40i74no\n1IjQMMyn4uczKsw086N8+Riif6N7/Az+DXjrsbILx9DpBr0tw1STo9zMeFWL\nF1ImsxIp2toyogMmwOMDTffVhfvrzbrmPbHTS62GGMuOTLnsVj7QAyaEJuv5\npdYVEnbaA1cGUOQUGDCn2vkX+/IEbd+MxigOm8QU9sgX5YoxScKUXzgRm/QH\nuoDxFFYbEcplsJSDBBHQWTbJYlN65JX+ORvcGdcfnchbnDxxUsRrTRsmQXZv\nciUo1qHiOvZ8eVPLvSEc90pShTxpW4fa8diLhOACLk4/mY2hwO53mgzDTeYC\nFRmRVauiwhbjviL63706reWcbu1QzlTvxTIpMdvnavgQYI84aU2DOOOHin8N\nR0/rb3QORU3WPTGABl7HckMmVIzZcKFDw5RM0ngTtB3iZHU18EEyHJmbbwIc\nhzXmeXGNXQfbffoxSj2wQreKmbuunA7JPRzwjnipiv4wncO6X4wzOxlfGUrB\nOWL9n+hyrQhyDg1oOiunZcKPnWBq6iuPqIbksd5rQDpDumCJkEFLZIgAGSSo\nIE8f4iH9u015//6bV3cHzZ889GKhwu57PfsMfWloD0bqUSdA0m7rLPZjypsS\nt5RaptH6zj3jUTlCV8C0aaf5wvR7yz0TZp2bxFwFXXfKCw5OapO9y6kS3UFM\nM/m+\r\n=FS/r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVcNigkGVmvdCEvEsqo7rXqbVB4e4O8zZO/6jbpJf1JgIhANRCLdXkugkG1ZeZKwyDB5tYrJG6Lzp8kb+Oi6v7EPJ+"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.4.3_1524633967619_0.11086623527648354"},"_hasShrinkwrap":false},"0.4.4":{"name":"clone-class","version":"0.4.4","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.4.4","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-yfijqnPYOcYRm7vgD+WNzBHnRWEoSqw0FdVj4+FTzeJUHyAiVbw42lMr94zNj242zLRZdeMU554o9+bZyvRzLw==","shasum":"f24df7666c2a9c8e590d1039823fe2bfe9917b9a","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.4.4.tgz","fileCount":17,"unpackedSize":13650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4VWJCRA9TVsSAnZWagAAFFcP/1oDVu9ZVP3sCebwkllz\nRCcB2COaqK4DBkPp5yVxof5cl6j7NpHjDniQLRcXPWKKKFX0JhYZQQxA12W/\njhAAdJPIDGy2XwZOhpKHbWn5zuHhBBRXZUaK1wJ7AxpMNJkJ5beGHhNtWPoZ\nNRZ2Uiv37YhcYLRpiVR5HSdIF2O35rOJgftxmBYV+ENVlEq7x5XoJIJ4lq+J\n/sHmfrvA0w9DTx+yOobwuZDaRKGY9TJgzOpyrKiROc5Y3eTrnRBKdEQImf7f\nqoirw0WvSPHWLpilb1wdfFJBu2/9iPwKxjg284pxvAWdgH7qG9gZaL5lpwm5\n7kmXLBxr3lCwP6nj3Iv02x5dkZDpgwqGOsS0fZ2teyEwGhFnoClSq8CPLP7v\n172TsLz8o2glMUVPOJv3Jl+K31iESX2bdQSzttoWbCn+yOiZ4aSgxQ7Sg+mS\nt48nwFGm58fRnU2sKI7ysoSYzaLaAzO0ZHk5UyWcMGVo9nKBCLNIotsIhNHr\nlXsGH6vMPSxyGKuIt4SjL/EU1N2v8KE9GOj+G5+Oh4QOFSkX5WR++A1FzGKn\nRTqzU01as0jWn0BKPxisRZGrrDsAI/wq+ssTgzc2S9nrXqdXKsAseWvpChGh\nHbcvowf60ytdavxJR9oUHuo8oJnyDGKqbfnQAKtp2YmD1agQVu5CA3o859f+\nLacT\r\n=gu06\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNsHut7QAPw5ciHfmS5dgh8otSOgohyriEpFGiWGp0xAiEA8ooSJ24apWNmkr32RPVaaVIwjR1HM3YQD5+mg8nM/hg="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.4.4_1524716936965_0.20220857673280412"},"_hasShrinkwrap":false},"0.4.5":{"name":"clone-class","version":"0.4.5","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.4.5","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-ID2X3ifm/eDx9KAaVJ1MHVQq3p8pk/sgXcuaj1iDOKAj/W7HSfeACE5Ur9PXAwNnC1NM1NPIksNvCWemuUs4HQ==","shasum":"7c1005a2f76e318768cf7ec2b4028de1177119a7","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.4.5.tgz","fileCount":17,"unpackedSize":13801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4VWxCRA9TVsSAnZWagAAmV0QAJfdgRo1esYiQ5myjZE2\nOVgbPfwA+t72B15zxKg6DwZgweelce6rNO4ZstyJV+Ld19u/nf08IeZEkjrA\nJeDOoY9dHchB8her6r6YDuhCILxkC9XAZ4jNwVQE6oyXlJn3QTBq2DJOvX1l\nAe/eUEYj7V3c66ZagoUZtgfqllJ/uhQRKU6ID9SN6+ZO+HIIaTlRY1aIIwvM\nhwzudb7MdwmEtCDU7D87YFLDm9ldDi6Cm03Fk39ooobobX0MLfvSGr8BKp+v\ni5fM6yyF6UtuD9zTPMaFo3NfXxwDFD13J4J3i7ILYWrygUbu2739yNZIDzJC\nknctazzel3MI+j4WY983S4sgE3eskd6X939BAR4Y2tZ3OSP+SU4JiBrsKPFZ\nfISfnJkWtqEhlGA6sVktHMqdt8oak69kEn+iYerQ0RMHTqRf9hYRKcsrvfkg\nqsrx+rJ6PrJnsjjNnFsTmgTAEEb5AF0kvyZJ3fCrjvqemneUdnzzArP4TSfJ\nD2KViqWAcfmLfIzAdR0IrKmjCatE6fLrs2kAIwRsw9RcWmiCWc7T3aJUYYUv\nI2EjG87bTHDvGjilAdfYdCMMVs3ieGfTRO7DJG3AnVj6CnyYiT9HTfIWWzYS\n2HzMWFH8XUpJNGTiHw4yU5Hf5kw3Q5U0HKIqSc0vOCjUP+nbCUE0+6NiPfy2\nsFRq\r\n=wpdB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFhL4moiTUcjVg2itSr/HeEUYyHgb1m4YNuk90d9zhcAiA/TmY3T5Cc7150xO42rAY15QCLXhl1Yu+XrjN2DfLWXQ=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.4.5_1524716976656_0.9907479759961875"},"_hasShrinkwrap":false},"0.5.1":{"name":"clone-class","version":"0.5.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/zixia/node-clone-class.svg)](https://greenkeeper.io/)\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.org/zixia/node-clone-class.svg?branch=master)](https://travis-ci.org/zixia/node-clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/node-clone-class.git\n$ cd node-clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\nSee: <https://github.com/zixia/node-clone-class/blob/master/examples/example.ts>\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n## CHANGELOG\n\n### v0.6.0 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n\n### v0.4.0 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","_id":"clone-class@0.5.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-urAY5NC2rzIdjpMvyTlOFA1uysyxbSqPLrFYKQLvHHMRGawYnvxdQJ+VHGPDQ2RN/n8AuwdyBfUcGT6I5lQzGw==","shasum":"dfe1a03211a2d2778727c77cc0829c36f9fb6adc","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.5.1.tgz","fileCount":17,"unpackedSize":18397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5HiACRA9TVsSAnZWagAAnFAQAIK8PDl03noK+YLzFiPK\niMQtxrVcab+eAw0UD42LmBZ9n3vKxi+xhFzvvnqPwl0LCKZxYYupo4C37Sbo\nz4n1iHse5NH9IcV+Nkg9LZWG275AO4HvdB1Qdy2BetHUNBwFqt5pUZBApgKB\nyyoa2iDELLKO6X5zhIKaMYMnkY1gkEvsV65U8Duwy9+KP8vO3ldPM3a/OA4q\n0FsUG6Y+kRg6ShOX0Sg0A77lJJb50QpdfiQWn1JRQn28QVpzULAa6M6kpJR4\ncZYnDVGdShnbA8P8mySkMB6UAS9an1FGQR8+uwq11rj+MSoCKJko8z4RY9Ys\nd/Gf4FAhCRLS4R7LOW0yeK40zDp3TnpEFoQGtzgAZptvyz/0X4IvZ+mkx0zp\npcv1E+2mmSXe7ZDSeNw4h/hsjg1YZENKOYONFU2DMF+cXM39Yb5SEaPIhs7S\n3TFT2XpWO+I5c5JmgZvIxSFdNbrhS1L4DY84kx9yrqCElFpcEVnLjw447nFf\njsX2g6AqCw5LSwt2WxoGKa2eB1UAjeJXSSEkcd/smwaI7iWaoDFKmwAKXW+g\nGOtHLHJlQaHt/fOjpvQez7kSnCQAFZIKLjChZhU59tnGsV7majxhs7V9mAxG\nXitGeA3GLf0P8/6xPXtJBdXkTEsVRiyAqHOEhQA6uwQGbMkK2V973EqvpgWr\npdgv\r\n=Kbkd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9sNhhRVCfrNkiiN+vrooGkws/gKEV6lMAV8T2KXFidAIgc+La9t+RSo1vMKzcmHW7ldTDGpN9Yo/W2ctTNDYZhhs="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.5.1_1524922495257_0.3124128587490409"},"_hasShrinkwrap":false},"0.6.1":{"name":"clone-class","version":"0.6.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-9M09qBX/B/VsDsB1ScBSWSaVvnbRzdIX2pimqFeOCWJMNeR/Ianap7uiSbiJR5EHgxIor7QC/5uer/PCbPE2xA==","shasum":"c4d00e3f34e2678a4c2251a4cf28d772ad9d2c17","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.1.tgz","fileCount":17,"unpackedSize":18499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5Ht6CRA9TVsSAnZWagAAtxYP/3vr6vdXDnQFDXzroG8D\nA6qHqK1R+ZF+gcMCZcO4lJ6A5JyUzR+fAGH3cPDVY+YynMQTBo9+n1ecGHui\ny15NWGrVmehJXUmOxbiiGp8SIS+yrytHPPekKKIdOOA1+jRxl4M2O5f6ir50\nItZjgzU/6ycE3vmxIt3+BxLqyiBLzPM2ieRk42o1r0ZaZeL0MrSaMZFsg4ZM\nCck+T16CvsmaHUkolUDqATy259iZ46ApFxX++3jmdjMbVlte3CxtlyRi/hk6\nqxBGyxJtOJ6LQrnRDiV35PyXHbMhPC5huIQZfX8ATtwHuORzAj8His4pTFze\nt7pT2D25fgm+dqpD50UIWTzgC4zE0BH/l/jgWxn0UClziqyfsCr3E8PvlgY6\njj5w6LPM8ZrGBKZCPTg8z0vsMQ3s/7iydO7TC3+Xj0lok0kAG7EtK3PG04Nz\nN2r52Yyrq6TYkUBaenVhZ81KsQZmYOAk8FvuX6XXj0LE4SSG4mGv2IRy08jq\n10tFjg7/e9r7A/FP67eB5T7EcVHLAEHmAC0hEsx/TaIO/MpjDtcn2IxlzhDY\n0AOkJXqopgEcKaIVRek4lbkLNxpGmHkpvXc90bQFXMqKco7GaY7I3ewYY2En\nGOkyH99YG7xPzv4dqmQOZrGQuKdyS8N9IKRN0aBeNXb32DkQTCjCg9Ulm6vz\niaVZ\r\n=2oCK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOCUZi0ttwply7bT/chM6hQxCA6D7HtN9Ve4b7l1HDUAiASmH/C24VwjNmfHZlkISr60aOEVElQ3RjPN3CqGm0/0A=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.1_1524923256345_0.6012282381124721"},"_hasShrinkwrap":false},"0.6.2":{"name":"clone-class","version":"0.6.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/clone-class.js","typings":"src/clone-class.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-OBGCM6KvWgVRdC6l6Rs0KGR2stGKkXVeNqd5Vaf64Henj5anWUus5lX3rI9bK75NIYDeLQf455+MUn1uhKN6sg==","shasum":"1352b88a93035d97bf81f9d129f134bb0171c4ce","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.2.tgz","fileCount":17,"unpackedSize":18909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5TgjCRA9TVsSAnZWagAACcoP/3hBKGnXAwDxSFx2u723\nHiD07FVlm1lQ3ET9rT9cNsKSj1xeXT5TiLj8Q0a5fpN26hcVLaCYvy2wYmFY\nrAp4ZQcrfTgOLbrHemlMUzdz4av8sT5/z/Jkl3NQS4F0ULZfaX9loK/wAp4V\neyEbomAcl3I3R9bCzvxuKTLggndZdXSsEAlo5ysygZ7aJg+2ryugJUNbxZ2e\n+gHtS+vtnIVV9I+bz3i0jpCbES089w1KRF7UJcAMeIBSL+3kQ5Gmes1AIeGn\nCIC/PF7/tGg1etEbPdGxzWANnQPkkIvg5QPC/HOxMGeatNoz8/Cy8YSBlmMM\nLIu6RMMUQ4GitM32lOw9un2z+2UHdk92Lhm1Dpogn2WC3HOENSDCNR/z49jU\nQWHF2m5hxn5oJXgm4gst/avr7WQxBIuRu71ySD9jDRWjQEKbOAvQANVLNC04\n1e+6Th5EOlIYA+a2OqOPHasR/VxGUmo5F+/leBCOjQXXvvzrFet5t1MugQJX\nR6/z4qtpchQufYQmoA6NOqmrOHkyLQWtIoAqiC4n795cz09n/EK34eA4oTCa\nMtqbelUBNTVKFKzNFG9sML6yqDuXP0FGXGp5iEZONCd+MujwNfqWorGGhb4M\nWSKY/nhQzDDdwoF+ti5HYkMEOKNv/FIUDol7IXzZc0J2WnIm9/KXXXltwXtm\n2Kjc\r\n=dYWt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt18e1kdfsAPyQyMtZq8E1RzlTQfuN4EKuGjT43LxSpAIhAJoyIlSXSoawMRPv6tjL0ZZmbVSFecY7daY/iLZWwIP8"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.2_1524971554910_0.9547708099892955"},"_hasShrinkwrap":false},"0.6.3":{"name":"clone-class","version":"0.6.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.3","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-4mVOeeTt/juM49PtOFSW86/KyY0zykCu7TTfwnhKSqkibfpVq83cV8zffXwwuIFWvywAbFIcCvbVdXchXOuqvw==","shasum":"b41b71799eb6fb56dc45ff355b4315de4a22198d","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.3.tgz","fileCount":38,"unpackedSize":24546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6SibCRA9TVsSAnZWagAAjRwQAKIrC5SyTPwtr0ri6+vY\nZUe0A7qQt7g1nCj2m4lUm+h8DJCGFnP8o4RdpCGrC7CB9pJLK94t7gGdaYL9\nSN+nCprp7Jy3QAWgLoqLePUrzN6FCSPCXs7ZRlWDV0qk3nxEG5kMzZbhng9i\nkDXytJSica1a5krrxiP3OCZPqFqn2s84NNgYbqUdje9GluiVwDxw+o3ND5TL\nxJqJpLyHH+Bu4EIZDk5z0MocgDkoF9xFIxKUobg1UXaE7sxzb+vO1rmfyIhH\nLTd/RLqvxGJeqEMPNrlnwMEw5Nf5JK/p880eygfRfDDCW+QHi3H58AnYDdW/\n1tkz/o/p5vFLq18P28TdAZlWbpWQ7DdMIsPjRWi1f6TnqYNf4l9tvRCdZnKi\nM5IyQ7hgbl7QjvHhfSOaNVGioK7MPWlHAd2OPdbv3SQ3aK9jJGGwPpdwXD1k\nyQbEHsarrzfSt2No6NyO5cbg7v6igXS9Z+7e2Jyhuld/ldPbPkOd/amDnGiR\n/Hj+Pj7iXXuBANv7K63ZWLp7BMgbsx2JkiT6dMjnjzQ5qxit37hIffB4a1PV\nOqDMoPT2Mlv9W5Ezte7WcW/StX2wWSCsuDziD/hPO/TE0t4yZKGTf+lpTu2x\nuj1mWWdROoqLusxn7MMi5JghTJfcVoOzpAllXj8zJXeKVYyKHDU8B8CSEBpq\nVsFc\r\n=54at\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDaud5W0EeokXxJThIvqOkEqKZP8a8KC9K5tdpoHRUNQIhAOxkCAV28yNbg3B8+NgFLRPOO6wju0dCO5c1R3G7x+7e"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.3_1525229721744_0.6844360836356551"},"_hasShrinkwrap":false},"0.6.4":{"name":"clone-class","version":"0.6.4","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.4","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-BCSJ+6FT23yDdd0aQ5Ed4kgK1zZXITz7jvpvVoIo4H5z3cSDTF1ECp8fuoZWxzw6swZk61j/lK5hD01CdUG5vw==","shasum":"c537edfd94c3d6c5b9f54a63dc6f405df15fed01","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.4.tgz","fileCount":38,"unpackedSize":24634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6Y1FCRA9TVsSAnZWagAATGoP/inIDLjoZHJZL2vnVFRc\n9BSpr1vp2pcbqP+MdldnHA4V+uVb6LAZFU9MPATMnVeugh5AvCMWftFJ3Eic\n2y8RK0tiUuibG4E/Vh76sz+r1eHJA1xG24V2WCSGX4UoCGSGPNrOCeQLSjBS\n99bq6MPzZWAFzMMqdm4TWZd9gVk+9/slG78So9wW0IFEkSqAKgMLQ1ND1Xxa\n7eBYzRYG97hr/1+h7Bhgrs89tjmzoCVbVCW1EbT1y2ddQW5+/mVOn78DS3sL\nlaW9Q7vbZZ/1wCufEPBWexdtSY3dfklG7RdGeBNUvkFcgxjfwKgIqAX0S/9t\n+vvP0HkfcI8PPwXSqy92q01pqIp0JBwdibIVw++071VK17Etng/e+SuWQG9f\nX6Jh2hpOisn9qR3CaxKoDvSYdwFtFwc4AU+5AwKiHMKcb7aqFYhg+lQkFhhP\nGLKd8nDhcVhHzdHE4sxeAqurQ6rf8nmDTWWEcbS7mgg/lQeRrD5sV5zleusd\neuxP24sMtkO6QKKdIs2AOqWkiNZcIXcUd5SKZi3G3kiZRuqT4x8jfJOguDhf\nvFnTTqscKNEMhAQCPiQ9O9IUbfHamp0H+VMjT14BpN7JgsIiqiWTTk27tvLE\nwWfFCtAdNrfSPPYY2DjJBvfiiVAKbYEqCeztmTJmPB+9P/uSjBoiBrfV4vj2\nAcgQ\r\n=AEtm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTZv9zPL/Ms/NIamkLnYzfJeLHvWGwGY5bTbeAocSfaAIgbt/S7/gwcvv4w3qHGCxfbUIuZiWF9iTFucfQnOFxtGI="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.4_1525255492671_0.8876577254948557"},"_hasShrinkwrap":false},"0.6.5":{"name":"clone-class","version":"0.6.5","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"npm run dist && export TMPDIR=/tmp/pack-testing.$$ && mkdir $TMPDIR && npm pack dist/ && mv *-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm install *-*.*.*.tgz && node smoke-testing.js"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^9.6.6","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.5","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-FskgLZuQv2CpeCi/HpcGtQ3MiuTr0x0K0iz8Vn3+SdRu1JcQ8DxbqHK4sNhwQyytqzaU4928go9BrKLGQyHKHA==","shasum":"78f803921aad2d0a1845345a7dcdba403b719aea","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.5.tgz","fileCount":38,"unpackedSize":24917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6auKCRA9TVsSAnZWagAAsRYP/3PijCFQLtd1I+uUSu4G\nR/xGGCjC2/p+d0YAPxw00VIxzaz2dKB+eHzzwAfxSbMuOPBQoRZdQ01XxsY3\nqPvy0lCV2qIojy3h2WZrm54e7CefT0mUrQJD0IO9Xl3h1UZyM2RNr6SePoox\nESfcyA3nXjpW5Wh5fU++0KVKOOxwv8Kn3qZtuX1tl7NtiLiRcf137q27Tm7K\nQebb8MS+uTeJYOFvYuzBqwWb/auiCvraqOtO1hR/vU9XiQn8Qg1MCT83ImML\npinhBdlFLgPIddt7Sb7HfJ9F269knM5kqYOFTwX4/4evXBB6YvSO/O7RMXIf\n6vh5jvs+PRcZixqRUn7kCkJ1jgjMROXBs14H4XLgrJm0s72QoMkTXk0qcNGf\ntQem1pdy6ltte4m3ElobrcgwAIbj/+xev6Jv3YYSyup4aXXt7rbFbLExclts\ncC8dyUgqoCDDJZoVJlYxh8c25ypAQEITqnpEV3uVQB2jjyiNlI41K8zyXh38\np4GRo/0qtRDUjaSHMtFroN7RZcVKshBX985iQV+3TgYPZ0GZpT2yG26zUkRP\nKn1FLf+d1yBnKz3ULCBRfbprgDFbiySMrezBk6TXK3hvzQ+mHiCANJyZV7OP\nHl3R5Y4lxUdrpt5GFXIN+s8fWWJFdykRz/dSA3Qq9ttozzf8iiZ2NNFqS6cz\nuIDJ\r\n=JYL7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRbseZAux9GPKsdLGRhhxBV0oe57Qac8Sh2+Xbmn9HuAiEAnKucm4qI1aWkuNYK3hIIq96Mlcji7/skKhL5BsmZJ6I="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.5_1525263242016_0.8292754859661327"},"_hasShrinkwrap":false},"0.6.7":{"name":"clone-class","version":"0.6.7","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.7","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-K8OzYuusnX0D3ZBqd4FiazGWMHzNuHOeRvH6msJeVtjYZObpWE4H0NtmML6AG8MJEEx1+fRt8D3K5DU2xF4oAQ==","shasum":"e2200d3b977939abac807602cb12956e6890990a","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.7.tgz","fileCount":38,"unpackedSize":24552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8ARUCRA9TVsSAnZWagAAOnMP/3Bz9I4aUjoWmo1+IhLD\nFULPCRJ8Ltr0kG2AnGnDy5gcZhmYlVjJAkFchhFKuC2EpIxnqIDRPfOZVOsc\nGJZm7kIgZ7H71uvpze0+7ZN8IrSxtweL50xwTwV1EnXc2V/O2oW1WCrM5qIh\njQL93N6bPgnqkjBRquZ8qMp/vV8tV8EiGkOe8BYCXXiSVG7k3bZZGCLdEpP6\nh6Ygt2SbGRPGTyW4WkrxjRHMqmZdG62WDPDlKlnFoJVjabSD9kxxPp1MRZIq\nRsJ4ETaTTN+vOLRZ3tdQesmCzdSzVhduFiwyl717h4CaELH+E6XrlsjbaVy7\nFxUULKSVLGSOH2d9a9XCcVBZM0gOWy/ZuFHyYAgB5Fjc/k0o6ZmQs/zmW1OX\nR0mlXXHwaRD2N0lJ05owzRrKAnQI9IQlEqgiKXsOeGJe3VGWm+208lFlQOZn\nu5mUBoKzzTMQE1lmUTlMVOMtoyo6SXYFs3GIMxGl6N3FjJBRuTO1iNrlRC19\nOefiL1A3gWn7XeYxxncwEBok4fXoC7PWqZWMLLENSilJp6jBjBUryrxpAXy8\nATq/ZZW+tT0uEm5aFtefGDIMv9nCpCU/ia5ytkLeOyTHxpISRqT2/ZDgIwap\ne3tCd+5kE0FMYdTvkGTK7co8zm8QCN1yAVykAZbhTVdT1Um/OUIM2VnOUyGU\nANmb\r\n=8VZw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDGV17hhHzypMONESHmQMpztbVO+FVMEi6BlSQR0w6qAiEA8vhpw05yLsTrzD8ZoNGnsSLCKZvjDcTOVrUVxbtAeBc="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.7_1525679187058_0.8212923250185358"},"_hasShrinkwrap":false},"0.6.8":{"name":"clone-class","version":"0.6.8","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.8","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-gRlf8uf64hFwQdJayS7yHv9lU8sp6ag+ADQvTo9tm6kGOwvQs4jZ386wjeuVrlXwtcjv9v+t2bgaM4Sg8CFngw==","shasum":"083e3c6e5dc19fc260fa557600520c5a73339682","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.8.tgz","fileCount":38,"unpackedSize":24634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBDvlCRA9TVsSAnZWagAAsG0P/i+SOb4znVJT0zZfJ7FO\n69AvrY9YDU+3EpG6D+riMr+QAivVlxpX+DF9Rk2nR5RCtnJS9q8Mhbbx4sgd\nxjWBdmVA29kSC6o1MpWgxM2TMfzgZukWKWhMf97YVZYy6AfTkD7mXXRJelcn\n+dyaKYahWP06/ebC2OL4e2//uD7Qimwr9rIONX8ou9xEwpf//Ojz0Uxm5wPb\nBzyPPek60YxuCQPOEeUDqqkBrrufoYAd18JVOcMsUWmppF7vVpZymcxAZlHe\nGm/i7+g2L/PVRvG4zOnAi7pCIUDyShI6limH/ARuq6dvVFqp7COy/5OgXFha\n+RmwVh8KQXxknx8stLc0fD93P/Tx9XwgYAbvLMGrfigkRM+84gBZGs7wToMI\n5Ki8qSwHWr+fpBdrPXqB3VIOiOLsTN6RjCDCKaZembcVFEQmA1MXs8SgHQyd\njRo7yKjZqnEQI9MmGcNPbdnNAxyyNQdTN7qlF4GKzPGaoq+PYjoq+JCXt3pI\nTyoJ/1sKfAD/gfcW0/ID355Q/YoFmKMWM2dyQ7c+wN1mgCgFwkwXONUxH6Sq\nB+m7CBso+QGXF4huq+HKsJ5OfeH4zVYq8a0VqsKpAFrE6IdOM/Zyofev8U0Z\nxs8KLGLh9xqSphr7eYJpEjDGXW2hrOxFI+BpEZSktrJjYMpNhDSuQ/Pdzbup\n5v9K\r\n=R3fq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtdE6OYxA6OZii5XH8X1QeweJh61XRyAynCgbIXbFG1AIgavAfBmR8jL9khuR7uPUAvBf5X+8Q7zdAf8+583Sj0po="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.8_1527004132184_0.7694648407380815"},"_hasShrinkwrap":false},"0.6.9":{"name":"clone-class","version":"0.6.9","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.9","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-zjaqwWtySf10GSzs70+wDdBM5H8vPHLQsNr65XSsoTb1miub9yJxx8UuCwegTEx6hOmukFVgZSr+2iYkoA4alA==","shasum":"8139915e8c4d1b4d11c751b5501e4abe4ef21516","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.9.tgz","fileCount":38,"unpackedSize":25819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBN41CRA9TVsSAnZWagAArFYP/Au+Fm2SYQ+5Is9Q7P6J\nYCJ9Tv7nBKcz3w9MygWbQW0cKGltD1iOVlXVSycy0DVFH2ra9HUUr0vJ3/8M\n9Bc6bkwW6IW16br0BfqgLt+sHdxfp2DMHYZGMMTS70DmLCjCogyDmuRpkVaE\nmh7BH0XLRGlNMsRUfORJLOpXFHEXKO0hNLR3Rgtxfam/JorrdAN/U8vbudXB\nxDgQzSpRTjiDsU0cAn5g+v7+h8M/5uJHs3chssSsRZiELmjzluIJ3sfEFna3\ncItX9iHehdVkDDvwWJn/nYCUGjHGfk6cIxE6N1+9oLx109W0XCgwn7PYq3Bo\niTaafHsTiH/5Vv+7y+Pv256OhmhzMQu3Sm+4r3ZZJERPyJ15Jt6mE+OXJGIt\neevfOgyaizPOR2uavEycmVj0phC2T/mS/q0s49IpBRAgHBSjQtZe4Iw/c8yH\n5DmR0VWOz83M1mjJA3gQJsrbolyg45D0LRx2afDVvau1cASJ53eccdrxYbAf\niApQcldiTHcM/oTBbXcHa+uNOc6cyhQUFxt0nRt5ZOA/aVB0Td2UeiVDG60K\nq99uXsRTJG3ie9cQdEbsut+RPnwBNkGGA7eCZvxf3eR67BtM2JbomLgF6BST\nZNOD9UqdyVDLJWGe0T7ucNUKZykO5xAB/w7AJ2EIxcDfn49Z8L0vzj4d3Vd3\n9AYm\r\n=qBLO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN1DpgTYbPAyNGM0LkI76CiYKQO4segax0eFa51R3PbwIgAeCYwVwdG/rx3qSDpteYaMX9rrRksfaq0++wHhnw0zc="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.9_1527045684648_0.6661370279777066"},"_hasShrinkwrap":false},"0.6.10":{"name":"clone-class","version":"0.6.10","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.10","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-7CO51fhAdekmVUTBpewrn3//Kqup99u16k7X1kCtgTkXTDRyoZ8k5gSCL9hPv96La9+WEp3/a/BvFOPodO29gw==","shasum":"4b516e83dd20d3324d64b0be387e43abad876faa","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.10.tgz","fileCount":38,"unpackedSize":26676,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBqVLCRA9TVsSAnZWagAA0kQP/iT5bjIuJRctxZJ4SBfC\nKe9nTah6DSeaIAhPS6Wh2GBg0CClFRw+V2xa+QZDH6cVr50XGTFOLunJbGWM\nnjvHNMq8QjgyPdD/u+pSRVA10nPzcQ0xFj4IqYBfpo5rORW0OYx1KSi7lRfe\n8RM69dwBhCcsZI85MbEdh0OX3LY5YTdA2/HhCd3TthdvRlQAYo6fo8nO9yNn\n1LCcLXFuJSXUkVnoxw3OVpfZWaxzWLrlCYLaakPEkFrBwCy8umxRoQzlhHJr\nz2jU7RDhZSAsDwmSlBxAUNl9aMYOpM0MVv6EKsPbuv8mEtIpDu8mqIiXnbw8\nD/E03bcRSzNBpI+iAd0g8iJnKVDW0+rV6slZ30ktcKtNll3OX17w8eNdQp2W\nT//0fewF52g1QFaljuUgoXrJRQmdI04mQMpMT3QqY3NGu1aab/a20/AVeW1c\nb4A3IN82fcGRvV9o1LkC3EP/bhVVqk0PC3gkP5m4zbycglJ5vLzDpPnn5A7l\nD7bTl+ctAwKVXhhPPdYNc3mGmpx1ecZR00G5ONEu9mpvBGBNTDKA6y+L8ZL6\n1zrH+M6TD7waxZZ+FkKYgj5jvk4nX1hPhHk4nWcLpBekmB0YELMj5Kip0ya2\n+O8qsMhV+yoWvvR/GnaR27RVnSQb7jcD5yQeLs9OtLpKVxnSEWlQAJtngi6i\nP6yG\r\n=7tq/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2PLv1NhdeGOA2ri37rS9eMyOvD1MD+OqeaFSZayJ3tAiEAjf6Hj/SAmjUUxEScJm7HQ5Go44JYrxXIad8AzCs1Dik="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.10_1527162185521_0.7299053132546722"},"_hasShrinkwrap":false},"0.6.11":{"name":"clone-class","version":"0.6.11","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/node-clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/node-clone-class/issues"},"homepage":"https://github.com/zixia/node-clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.11","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-flAWPfxOJhXgXohdBJb7UFbA61eGqNnsCreF2IU8lfkFvGIKTNgpDZjqKpTna3Mt2xpS6YaMfkQ3tC9OlFq4vQ==","shasum":"2a54403eadfa5d9d0bde4abd4a74faa681b2dc5c","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.11.tgz","fileCount":38,"unpackedSize":26480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBsGCCRA9TVsSAnZWagAAhFsQAIc1UCngRlyz9/8dULwy\nSh1mgqX2+0e56uYVVKOPqT9TzLd6cX831sJW6UUioNNtfS35RWGAIbxm82Pj\nkFTfl1JW4EgpvRN7R8bOdqoool1qDmpBY6lxrbs7MODREXBe0sjtbyy3FdMQ\nGwLXxyfNGcjLmat7SLOmY7w4Ml7ldRBd1IfJ1c8zsaGSU5DAlMmUbeyXwWSS\nP6nNHL/Hq3EpEm/7ul1LTy+tYiMox67pyaQ2NU0tlLAUFT3ILU8Z7TX8vcdF\noIfEBYqSwIo/GCVK1R4i96Jq8LbJReRla6dc37Pa9HbA6yPHIN55ap5OpebV\nwJp6jXBTGgYWCHR9oyL6pLOxEC8HbdCPceksdC5lM815huQTrkBnTmOw76C5\nqI4/TYIpeV6bUns6PwOBNjVUgQu86R/uGSsD8dzyHmFsvjBGjVRHdNi5j+fJ\ncPmlRuZYzyN2kwQWF5p/Tm6Wc3lf1HDuDN5ppMdb02hqY7zLQ9hNj2LTHaC9\nbczgWptHJRG2a+x9aoJudahXtUZQV807t7jOQ6UG3g4P/HQySVHZaEers87B\nIHBz5AA5CdkFWr6/weg9A0wPinCwl4XcaHX7eJilmdhnO12SLNed93FOj3h0\n+d9t8ctQWdj6f1ywO/ZgsZ9hQkDCunvvnyRtUbEW1PaJqDCDTLqNgOLbxM4A\n5bIA\r\n=vKnL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzdLXXrHZpdjtYYcfiGQar899OAjV4clzAgpVnxwE8EQIgQCEEoDHxhA65W/TWjXc3F9QSZUfrGBLkhvN0kIQID0o="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.11_1527169409505_0.0755241330419314"},"_hasShrinkwrap":false},"0.6.12":{"name":"clone-class","version":"0.6.12","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/clone-class/issues"},"homepage":"https://github.com/zixia/clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.12","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-1oI4GzEY4cilKqdPNHyMxUKEhpzZ07BA81wcQDQlB22sL+nkCFUqVEE8A5vzLJ1FQXZUwC67B62GdvID+ZaICw==","shasum":"862cd72d6791273d34a8b2d24dcbd4f2812f6c16","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.12.tgz","fileCount":38,"unpackedSize":26465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbD6AMCRA9TVsSAnZWagAAyecP/3bDN/gKsw32FF3oDHgF\nOSUqRw+HeuzyJwa1pCDuoiAQClN57/pPXGA7mrBx7t5iSZ8RdY+cDwl6ZD3F\ny0B3t/6XpqDc6zgykXs53/IoNpOQIH2uWRR14g4FzFHbbF6RFvtGsoCY93VX\nnMFmoH3Mqlar0BE2xZn0gihCihM8HdE4Y+XsODlKfO2q4a1R1ReaTKZxcb+j\nNjGgp+zhuuC2VIsjHpbg6HNm398N9ehHbtGPGjQCji/TSANA0+NemAClDlc+\nBJ2Xt2OhWMQeByVNsODCg6iTFbp6tbQaK7j3AM+JnqFYqfGd7Wb4TC7AyclD\n9cWmsh/J0omqiqqoLa98Vn9zid429+uTf3vZeVR7AUmbHiuH8acaftV/eiEg\nX2xMA2NcfoY9zQIBRAnUKMdnCMi9P8Vx9VnABgdPn44p61uXUhRR7SbboZHi\n/Fk/MuQrFGkqEHBtG3PQkcbNl6jbPe8WYhtEoVmqWfiIlzrHY1IUfnCbKxYb\nPRr28jyzntevwKcOftSPNNqZiIABWZKOjgGGeJU6/3dq3OvOmVn7EN1fhfCs\nN3/azTxu8fOeP/zUNkpgAnRPCEZPk5htDsSxGri7coBbgq2pQYfR8n5BZSd5\noM6K54OBB+vc3JJhrV66pM3zYUAyNxx00d0ysI330OUxb2RRPjJl9PPOaxbn\n5N6i\r\n=eREF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH9Cf3IdIUyAXKTZlZJfsag4R2xFTmmp+0EQE2rAyabTAiA/RnnCDBQZlIX19OYP9duSO70SSNxJkBkXMQLE+x2t7g=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.12_1527750666514_0.508679864936515"},"_hasShrinkwrap":false},"0.6.18":{"name":"clone-class","version":"0.6.18","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","pack":"npm pack dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/clone-class/issues"},"homepage":"https://github.com/zixia/clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.2.2","ts-node":"^6.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.18","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-GwsrHguBn7YL1QaehyKeElMXQxGNA5gL3TCEVC86A4W81A+Xc9ZtXxwCMxiNUJ+Z+BvUd/Js+wNkDBCrNaSRcw==","shasum":"87151e6023dad740647dbe605b610bfd9deebf97","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.18.tgz","fileCount":38,"unpackedSize":26543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFWr3CRA9TVsSAnZWagAAXe8P/RuzkBXL/0G2BmG5/SMF\nrV0GeRt1ANi2ntElqPBWB6+vqoJGYjufqNOAzaR4dmVlAetbMkqZOFu4hy45\nGvSx7roG2Ys+BguzdNFQwBYI3oNdoiw1qAyjGksfNsCGQZLzL/rnmNYlNu/W\n/KbEpJ7sQ7PQG+92OZd8BNvI5I+ohEnBc3p3DlAQ/NbeYSlQ0qHcc3knvT26\nzXPvYmcbcnQsQieypRKQ8a5qWhCvvkkUUolbDUu4Hs4MRnGimQKDWF40yYP2\nkUWdBLJC8mmkV2RBcpKAhl0KR/y4dKkYtbAzz6H3pM9jt645i0JtTeDLbUCF\n7y+2euWBTabVCWR9KhHlaaSyFEpmUGrANauzcobb5yE93cu7oSOb/U6AKANp\nJ2Qnc52eR52LcgXmAAWtPeoWdRk1t3ybpsWm1y9QEanji7EWOs/Acv4scMXF\nFF6PN5CByOwMcJ4VV1AqV9KaypKtTy8De92rPOlzV7xsGsAkKo9pW0UdBLio\n2sS3Qk1zutEcufspuIf4iYTZyZ/LkIhitLWtXCrqzLeV94g0wy0ur6B+ao9q\n6ZWSK3uPu8QHKcJjsOFnHuq3gx5TIlWvSmUmYDYFYm1DNUL1kZepdT+qkDNN\nH4j+M7XntuI7+6/FR7SMiufAsf3D9LX3RMVYEPP0ju9Y2/Goqtl/Eeq/S8Ev\n/zDI\r\n=22gJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsgQFLKDNe+M+kuLg3QAqTZ1RYu2FZZeLFhrBZPbMxNAiEAtJ9gn69d2wa3oYiMNe+Izz4K5s9Zt+g09taSCCbsLT0="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.18_1528130294621_0.5982161385784919"},"_hasShrinkwrap":false},"0.6.19":{"name":"clone-class","version":"0.6.19","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","pack":"npm pack dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/zixia/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/zixia/clone-class/issues"},"homepage":"https://github.com/zixia/clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.3.0","ts-node":"^7.0.0","tslint":"^5.9.1","typescript":"^2.8.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.19","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-Kp1aai587Kb7dVqYIV1nH6g/qrZZzZB1qat4CXURWQGlmK65/y8FQIwace3pD9j+ZG66TVcqggthZ0NB4sP9Xw==","shasum":"90e22c820c3be06eb33503e53f1457e47f17f391","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.19.tgz","fileCount":38,"unpackedSize":26543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbM+IACRA9TVsSAnZWagAAw4wQAKJeUROt3sTOoVkzr85m\nUKtsnHWgugbrCCb4XmXKqc2epuqC+1MQW39ujrBzAtz2ogfAiThwrT9nrAFP\npLtpZSzEelqMEWM+Sf3Lwlbp7LVxNqx4Hgzj1J1fvVjKZh6/jl6eWiqYPNoi\nYfNNTakHFkvcmJAzA6/Zy5Hn1hSubhjMEeE+YlEzuVk3DsYL41FJ3ZDw1YuQ\nS7Hslz4Oz3vCR5sUHZ8C+fWLaT3h6gKmKMHPCNYs2d9xh9apH+g8eHyO9KK8\nNRHeCxLLCqVA0WwtjhYxN+Lf0AG4FcF9FpFe+/zd58yIuQWSTm241Bv44ey5\n3CgIH5igLdKQWNqXCeIFBgqp1o3S+glK/Bibzp6a8BsQhNWUTLA+cSJoy3JN\ntPX4uOC2SVsooa6bUMBINV/fPbMqkB2rH5qDh3u6tZDYC+dGoubIKA+aZ2w/\nZsH3TIM9YLgE8SYF9xn3JQzs8BR/i+zg9ZiHeMgvTtcpXb8wqA2aW9ydETU9\n3WHLZg1er+q8xq2tF4Mc1K42uqlglbUbK2MrKaPgOK3VeycMFZ7HK+wGC6iM\n8If6lysMzr4UF9EwkbcjV1GAM9MNvIP/KVIWUQhUFnfe3eFGUFzqB361SvKB\nGTWILRcjReV8MxRuAX0kb8W6p/CR4wf9Vjor9fpmVIxIoTeGIN1vdMQ3kQEb\n+FfS\r\n=JQ//\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDX2NMz+dpP+h6JJCcSnqlKAA7CTeDV1JjgWTSUt6fa3AiEA3fSOZ7U3CHU7GtHleBZSxnXNjvX8XrPBHNIylToXeMA="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.19_1530126847999_0.17821166966848812"},"_hasShrinkwrap":false},"0.6.20":{"name":"clone-class","version":"0.6.20","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","pack":"npm pack dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/node":"^10.0.3","@types/semver":"^5.5.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^5.5.0","shx":"^0.3.0","ts-node":"^7.0.0","tslint":"^5.9.1","typescript":"^3.0.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"latest"},"_id":"clone-class@0.6.20","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-h5ZvC7K0wptqIamtMkRF3LPoIr0bz0f60G3u5KkUhtRRz0PKJG8BnjiUyK4xgJ1FO+YS8muadU0r1J981CluBw==","shasum":"b199a51f1e7466d3f544fe1de74b6b8d97ca007e","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.6.20.tgz","fileCount":38,"unpackedSize":26603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/WW9CRA9TVsSAnZWagAAfBgP/1cydzyv310wvifkq4ci\nBdXMYwTsY7K1OFT550wCjAB4o7sGKQUh3jMlJBgM7L6P89wfVUurjzQ/Mezy\nAaCoSAiP4RoosaXgnEwsGisbiOSY1/7D4SPOqlKQimfs19n8GEaeUiPV3tQw\nCV8KnMRyw57+O9ix2KvU2P4XXRnClyAcFRLUex7QA56qufeTEkopm7PYcTBN\n6mlIyjwI/wmB996lVbAFRLuk+zOFG+U0BNELxFo+8vgWyDgJF8lFtBbw448D\nRSqSmWSRG/uvG68aVeOx+3sA63PGY+euV9DrQVPG72KOzMy6CLHjueJVjTQN\nSpTY87/dRABCqVt/Mc4SxT08HD7BPPrKOi7EvmVvhZWABcALJz+a7xGDqRxE\nLpxNMAN4vNJuXvcNT5Osc1aLbCWXTUm4gvqS1q+3ho2l26aJ5aYSDJE4Q8tO\nCURZd3cA4Qn3KB67H5nvuZx8Vz6wD3XMbWnuafDtSft03hFD/aglMwY5HDB3\n5QY9bqWftkeewamaJx7NLXVkR9gxPR4759y87b8libkyoXBckitHZ34hq0QR\nro40D2AG6Ky59+ERTKyKsT2O//TBZtywxzhDXi/54wdrxynpRtvclm7/Sgi9\nTB2qKnNguNrvb4r8+U3PMhDO9GqI63XyWYu/WbZPqaIFlJ1O8q7nH0vcnvjm\nPggp\r\n=Po5n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrV6wP3SSqpkxqAaGAubGXvTQGZLHS1tzhflPe6xCciAIhAMuKm0z6vi46rY/vGKYi771aWzw8ZJbWWvZ1v01hYa8v"}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.6.20_1543333308885_0.2918576565051554"},"_hasShrinkwrap":false},"0.7.3":{"name":"clone-class","version":"0.7.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","main":"src/index.js","typings":"src/index.d.ts","scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && shx cp {README.md,package.json} dist/","pack":"npm pack dist/","example":"ts-node examples/example.ts","lint":"npm run lint:ts","lint:ts":"tslint --project tsconfig.json && tsc --noEmit","test":"npm run test:unit","test:unit":"blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@types/blue-tape":"^0.1.31","@types/semver":"^6.0.0","@types/node":"^11.9.0","blue-tape":"^1.0.0","git-scripts":"^0.2.1","semver":"^6.0.0","shx":"^0.3.0","ts-node":"^8.0.3","tslint":"^5.9.1","typescript":"^3.0.3"},"git":{"scripts":{"pre-push":"./scripts/pre-push.sh"}},"publishConfig":{"access":"public","tag":"next"},"readme":"# CLONE CLASS\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/huan/clone-class.svg)](https://greenkeeper.io/)\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","_id":"clone-class@0.7.3","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"dist":{"integrity":"sha512-cTtf+SSsd/LUnhjmUQKxBHdB7MWnCrJ+rs69ERhZ7w04gR7Ycqd37QRu6jFbBWurX7igtVW43bItS5BefknVdQ==","shasum":"df67a29327e7e360e2d7a9e0c7e62eb483bb1959","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.7.3.tgz","fileCount":38,"unpackedSize":28395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYmdtCRA9TVsSAnZWagAA9sYQAJwlzkWuSVKuTtKKcjnM\n/MHzJP42vPA+nL07FURHseY9zO4tNXz2uqkPH8FZbnoc5oER/y1ntzhc2Gh5\nuxcaQx/9p9nBqGd0yA6dGlOAz5UEwJezxIbkvMErtDEGxuVJysr89SmjxOCI\n9j0LhNU3sjW64te4Q9447oi9o9VzuOUCRMouN2cyH+CjFq2vtbOXUniXh+1h\nmmH/DK+/Mhhm6nRthRWNwWccSTJa5PoEtnppuq49U8Y+//8bV035xURUoXPA\n5uI1SlS1Uo8OiZWuxyfdaB90XS6Cwv20VZyadZi2PklyetmHLG14NVL7MVK1\nIqEhJkYXWmXYzodL8Kiqb5Pcm9P+ZbojFl92oEMdin7j4xBOVuJpfV7AFVUa\n1W394+rHIFEgrMEYffz7VUFESaCYfbsy1ekchpAgftL57IqO4d1LzqI0WFCc\nY9eyA4RcTzZ6MOPsqabcKdAbxuNMqw3zfG23SicL4mh86ah3ud/RS/bDXjHa\ndVX/TSYfSvoMFaZqVrvYjy/g/rEZjHbn//5g4wkhZCmqvSGE09mjlxWg3l1u\nMk57RSqA3m6K91rZs1TQptKJ/R7q9GKfuO1n4AlzGK/4HyEpOauqCyASPDNf\nuTQ+Kxs9nEyMgN9tGlAI7OvzqKXICweG6ydw1EZI+1/J6+XPmoksRp8mBhuZ\ncYw/\r\n=3fFX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEz5GY5rKyMqJ+apk6aN/y4aebreOYa2HHG2BHii6QwTAiBiCffno34hMQL9EGKfAsj1i1oIKicCS8nBkajSMa6uNQ=="}]},"maintainers":[{"email":"dev@chatie.io","name":"chatie"},{"email":"zixia@zixia.net","name":"zixia"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.7.3_1583507308850_0.09154673392469825"},"_hasShrinkwrap":false},"0.9.2":{"name":"clone-class","version":"0.9.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.13.5","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.17.2","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16","typescript":"^4.3"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"8ee5c32ec68cd15e6f3cbfbdb157c0c536f4b0bf","_id":"clone-class@0.9.2","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-lhEm+Q9a2sF7UftGIGi5va9byLn5CGn0n+9jetfQS5DsfCd+IEeSd+e0tLJzOAL0lDlij9sREXKh8ABT3tSI8A==","shasum":"f3a8b29f279116fd975b4e200004756b528d17c3","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.2.tgz","fileCount":120,"unpackedSize":77394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJyVtCRA9TVsSAnZWagAA2BMP/1usMpWuURCqmjCJ5jX4\nJscl3//W97hVjKrcjN2eohqozn2CFPEerarsG8oR/dHGTabkmSFs+Ya4zHv0\n1imxM6kB7taelxd28lIXNIyS4b1moBAidk2eAAWQntNM363q5gD+y9q/l8G4\nTV07deTLWKRsugGtioF4DQx1fYtdxJ0yZR5qX6NGPsdT32Yq/67pkn8fDEC7\nejtdnKzHGAiHzsdfhY5meCMGekWj87b9EJQ86PfPm7nBhYVsUloAKvGY1FtV\nrjUwu30MC/f5A7a9FGZmA/cS0d/N5ViJtEO6TYI4aFzL/pVjDj93DO8Sx+Cp\nH89UvHSTIp8EPpYMwEoJCnwuWYBJsxw/K9xNt0pg+wXOCKfYj0OqTZb7JcSz\nVYnswUP48LebYyU85nrs6211x5PgoH1WSquj5XR76LC7y3DBfwIRGgPwSzjf\nxfakFGUKwlJm9Fb8hQNu5HYJCkZNxhpCWw75VzMc0X8k7C+ZGdMC+/MhYJG3\nOtCJdK86x88+mpKPusDLvy98QqUiTZxea8CZlUAGftamtcRaRBlfQ8SacJnj\ncPjfBoRRaiEwk2kL+S4em01buk2ofMmJqYmzeAVkYMx4NP6+++jK5d5tGIEK\n3LKJAl0WoCiHNHw0grlgE2Ky1Ws/oCqTUMKjZLF7P1St8zcV2O4vfz+Cqslj\nmE8Y\r\n=5nNX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLwjHvTVczv+2wFMCv2wqI9egzr9v2VMQ3BKHAWbLdTgIhAJR1ZxFf4rV4oqNRBeREi5qc7BK5V9ngZX7uIV6XTLF1"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.2_1629955437728_0.3245932675885512"},"_hasShrinkwrap":false},"0.9.3":{"name":"clone-class","version":"0.9.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.13.5","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.17.2","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16","typescript":"^4.3"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"a45f25cb09c09acf5056cf03385f389bab6fe090","_id":"clone-class@0.9.3","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-vTBCj+Rwetjo/517NKH4kuELl9I89lOtWLnjAAyd1RdAdXRXaNybvXEk8YHDXacRJxGKKxDaI2J3Y+N5S2lnxA==","shasum":"31cb39476bb0d8662338138a657c6885af8ae8ec","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.3.tgz","fileCount":120,"unpackedSize":77394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJyWVCRA9TVsSAnZWagAAE8IP/iBOc2atToVDrDRv27WV\nq5ZmPn0jkoBBsngnp+7s8YP65xeGQI7oRPAVo2OfVF2jPFr4yhbN5XJnHAXO\nMxQodROAm/NiZLwphbRqiOGuFN8zbLkhZLwcQY34Xm+OSfF2S+5xMs3UEHZc\nmobYdOmMcpgtL43rd/1YbovJ1f0m8ZZ4r6UE5EIAXYwn8jCwJksaLda/NiNk\nRuW1A+Ks2eWa7XPfSSwwtb/KPNmlJtF3nbAc8pJvwNg5aTQUkQ4bOZjyLXeW\n/KC4pBaBBKrAjbCppplQZO//j3YZvQjUFIDFFmpZypA0Dx3j630MP2zHZwD4\nri6/8UYYetAHsJxR6iRvM6CflrrbkD4JxcLpF59b4yVeG0OcmpENxvMOVDoD\nmQvEf1TAUYSivHnRcHrEfbaffqO6UEynmuOM3uPArUqqtP4gkEasbVlD5KJs\nYyJO1LIelgU+3L52KAbXC3OlBzqgIaV4NOTwJyM6a89yUJlemSMG8j6Os09G\nnApEWbp2PEseSEXsTAXKGnB+H4gFjbroiHYFrNAd0Nokij7Jru7drqrpgtb/\n5+8diN4vntwf2p9Gy1638ti1yQNb0r6CSPQtAAbyhw/fIsxfPZ6l7PsBQdVa\nivYTT4DhTLdez5T9uw/fU+Es6Fq0Yd2kqUZenWDv5xZRDpwNqEJT6hZsgxCi\nr0Ii\r\n=y+x9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHK0jJ0GLDQV9m8ajti9pYfWF78jWZ6eLodlnSzYLPwAiEAvja8NLT6SR1ccQAuVqZ9R2bibSFyW41wU6q6goT0E+E="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.3_1629955476932_0.5538921243706731"},"_hasShrinkwrap":false},"0.9.5":{"name":"clone-class","version":"0.9.5","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.13.5","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.17.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16","typescript":"^4.3"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"8fd8b78fa7affb186242e6d520e2566b47e0d1f8","_id":"clone-class@0.9.5","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-+WMhOZGSDMGEbHSbwBGBKCTF0GbD8oROzNpLdwbdM3ZQ57R4/t482RBcOpBaUKjtjGB4dpxrGZcu89t0bp4OqQ==","shasum":"b8960192e808ffeaa0f6681fb80fc7e9185cb037","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.5.tgz","fileCount":138,"unpackedSize":95074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKg1tCRA9TVsSAnZWagAAis4P/0WpmllUv2141cfwo4Da\ncKf8L5V78PWQxa4NPlFjMoDBbGQWokc5gtojo9daZOvYwdO5x0q3ZC30/HFN\nupNCy7PfgG+KkwiP9qcHNyWKbbC4zgjzO3X1AuOxjpoLBEw2vY+X5qW8ajE0\nKd3p/YEhA7YfG+4Z4ZXsytAfv0Wurp2dFQxeUpmVyYly1vUMVj12hnBw05+8\nBBvbzYS2Ws9LBeqLEiERcMK+HbtE4WCHNKIsR5lAcpjep+ktr6vuN1YttW8T\na9UaN4iUnplq4al/PDKo9wzsAjgld8au08vssi6Fhzkn0nKA+29GUzEtndU1\nhwcDoZ1t4a5kJ+yxSykVoYmfQpKVE1t0WhNLSsLbx4ZMhIGLy9NNi69J1ail\nUudvWvsb3yrqgHippNe2Pdk33mTcepE3+2CXO5GuZ+rCKHDqo4aGkrBOkB+M\njSpbujCOaiXR44ShP5AKswzk+nXUQwsO6N+qHs8xldYjwxEPH3a93z/m2vWm\n7g0B4lP8drRtIIpR0SsmM9qFMtBSirftgfYgj5IB1YG/Tdm8CXsYg9ZPtwqT\n2s8dXfudNR4o8ngcZFY7V+rSXqrbly3PsA0lEGol7BmznN9yOzP5MqFooi7a\n5VpLNZ/TnTWCIJC9iXBya5+YWK+Hm5N8NrWAuMUX+FBey0B3liQZwcmAUO1E\nYCRJ\r\n=RAxS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICH2QsWi51L5zy9nGex+bB/KGDKDOk4gbImu5o0Uj44NAiBovjW8GJdYjpmg2WVl4EINoMafT1SClnKZbpR281LGig=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.5_1630145901053_0.36257274525444005"},"_hasShrinkwrap":false},"0.9.6":{"name":"clone-class","version":"0.9.6","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.13.5","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.17.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16","typescript":"^4.3"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"3be11f295c206e6cd846e36df70f026ddb6b9f40","_id":"clone-class@0.9.6","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-xGhCYKdxLi5S/iliFwKVYRGkmCEKUZHNXmBQEGk0xWGtJwIkgJPNt9pcHp0F+jUzJ7QjOcjGaMS3+ONyA18IEw==","shasum":"064ef7e3e40cf9d52994ed65561c95e1293f318d","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.6.tgz","fileCount":138,"unpackedSize":101224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKj1ZCRA9TVsSAnZWagAAdF4P/RZGJ50dIxt/s7bpOP7X\nxFgW5DygxlDcDe85GOnWnxzQ9qSZiBd6oZuYqIqqqX4+0ar5iKvI/UoZJtey\nGBZ78vb8TyNFDP8Qj30FZyV4fWnFz8YUYPEDYr0eZrHNs/tVbTSF/9ARMMr7\n6Rlujj28OXYjroNZD0LHv6VVTAQX7GYvdS0TaDf4RdUMkFtVx29WIUxeAR3w\ngmGML7q3iigsS0uABjEW4sClpWNmZcvotkvUp6hiyNjnhCUghgRxz+HXTUkZ\nRQiVIslKc3y3/Ohq02IpZjHA9ttxYDXvGZSnNfJYNcnuaSoKCFw2sqJMT7jj\niEQguce5kFUUYBVXKlSklLLttJJazlf8dbZEFdv4pkGqWkldkMFXD6rgaKqP\nOjJ4noDV5aNXPq9s8o0CpDvQv53blH3KWW/uBp+34Y43RnPU5McPidFSG0U6\nt8LyoUEBIY2A7r3G4zDf9ykaxzM51hI9mYuYmqZ1xnPVuM7fYdvNtlXAEub+\n2Hdw0scT8BG/yw6M2xBIozFXx4b0SJtvM+zU2mK9+X3SvPoe6thQoSt2lqye\nEZycRWHflR3WBUble7rOtDC6+mNz07tcAuby5UVDWAwfg3Rrm0k69ap2vpyw\nqTUy29mq2+3i8kydBnMquYf/XnbObIem+qOT4HMUBYujnFoQvRZ4ru1SCsg9\nwy5T\r\n=QPvi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0SiW4qZFAPWYxblRd1WmWApDssFIx4mTsU6LOSGSaNQIhAKsNLw6bFtjKhGE16jQ+Tzg4O4FhjXWlD4Xol7hfxIOt"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.6_1630158168849_0.49595143767918515"},"_hasShrinkwrap":false},"0.9.7":{"name":"clone-class","version":"0.9.7","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.13.5","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.17.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16","typescript":"^4.3"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"a06b4b85de1eca7977e2e47b7a7fd1333154449f","_id":"clone-class@0.9.7","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-odVzPq3owChfE8DtCAWuoYYyLj/99tZlUjRGuKAcyR6NYBAn5KC6282VxJO8QKEj4XEnYmjBjkNhMEC/DL47XA==","shasum":"05f3fb908f7826cdce005f3c78d5728512fb5f30","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.7.tgz","fileCount":138,"unpackedSize":102302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKu8PCRA9TVsSAnZWagAAQjkP+gP6LKe0DGg1ABFWLvcs\nyLNL2hoSZ0LvPxT7m59ubp1Zt3DBXzilPwzDe9c0519afrvQtQMgyJbNTB47\nIxxAATx5aXBXsC262QvyPgMgIZHaCojrznysqAfIn1Yc+5DbkeSk6q8FPeEz\nzNH0qq1V2dcYrQbAPOY88j+Df2PHpRrKupXzVCvlkaIjCnAEov5yJKvrd7oq\nwSoPtt0r31NE+kkSpNTo8njPh3BfEM4YamQpL3bVpvf8dFrs4t782fKT+C/s\nJ4JPpuIKbjoVZ6EHts22GnA4lvRCM4FhpHem4hfwlLtHkUrsfTJDsFzEiVmb\n0XvquSb0qZN3FuB3WnHF7hbsrQbb8q9EpKTAyPIoqXh1xGVrmC0ADXDlIYZG\n04ZeOHX3ZRypzmp3thlKE0RWL90UyT6vm23NSOyfPpPBebY6euArt/BysMvx\nSXYWc45383okbWedYexFFAEokHb54WpPXBbTWa5qQmsrNmnOyjKo0Ksp4SZ2\nl68yz1tndLThS8yf8ScmEqi7NnCp4BgbzDzW4futIE7tdtqsNo8wXHi8cavc\npVYtDA6tcxFJnj5n7JAuOUTLj+TXjBR9IA3egfoC6u2qQ4ANFVNCtP+oqMvk\nvgq9aQukpSUeoPzBXCrkG7GX+bWWCfii5CMBBcCFTWhlmSyeh2zsARvyERIn\nZ2WS\r\n=FmlW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwhX6HYyDT+Arc9tN8aXfLxNqRfyRH44+hKFM4QJeJEAiAUTaPNyK3vz+8qZRVYs7Lji+eiS3hUdMukhLkW3JkTsw=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.7_1630203663389_0.40736229990259454"},"_hasShrinkwrap":false},"0.9.8":{"name":"clone-class","version":"0.9.8","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"ff41998b800302e49e4e22fe24756fc06be086a5","_id":"clone-class@0.9.8","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-6IeXKWL1+EBBPSlGec/1OYcMOUCp1PR9IS8XSDc/7e3JbfSsNNQ6QeULL6uv9q+IKcnPnTIK5LuFS/Eqpb9awQ==","shasum":"3081eb829960570a69ea7cb0d9d0af6970c14c2e","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.8.tgz","fileCount":138,"unpackedSize":103813,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHeYt/Irt6t7ec07gOltRS1Hqmp4p5LBHB8o4jjHrjYRAiAVZSEPHh15x8KjUZth7rF+PFXRATp+gbBtv08D9lUC1A=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.8_1632332341506_0.1492409364264793"},"_hasShrinkwrap":false},"0.9.9":{"name":"clone-class","version":"0.9.9","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.5.16"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"2ef8f5ce43d27460fd2680493d7704f6c9bab6c4","_id":"clone-class@0.9.9","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-iQLLdCkgRzJX7v+lO5ZCrjzc7YxSPiMwVHcFZZIFkFu8gsFK0v27cBGcCsS7y7tsdGibGvofFekMU+WpNdHV9g==","shasum":"ffe09c9113afc14de71f6a8f37326f71f129d76b","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.9.tgz","fileCount":138,"unpackedSize":110185,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPEJRzw7aRgizcJc6VX4xh8P3SEgAE0RmdLt4fKRdakgIgVeeia/DeaSxXohE2CkO7bg7leqynNHep/Kv8PdRsCw8="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.9_1632334280498_0.9703533172537251"},"_hasShrinkwrap":false},"0.9.12":{"name":"clone-class","version":"0.9.12","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.7.2"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"75d9d378cfe6f8124b2ca87868ff0977a9fa92f5","_id":"clone-class@0.9.12","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-F+wGpc7wXi3wnUKLTcgF4RFacmrvt3FLOiPi4bzJCpKphsSMhGvaZSrYsh76RaDT9yQ3a2HFOrGEzntcNubGHg==","shasum":"82cd7001ae935f6a7690d523db621008392a981f","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.12.tgz","fileCount":138,"unpackedSize":112821,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCQjGSjJ8OzIbtK3y5b0vFGWrxTtJHzHWE/7EDn35NjAiAsQgOhpb4xhCIeF01ZPqncmTs8BGC2DJwWnHhluZAMrw=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.12_1632391472268_0.7448175172822689"},"_hasShrinkwrap":false},"0.9.13":{"name":"clone-class","version":"0.9.13","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=14"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.16.8","semver":"^7.3.2","shx":"^0.3.0","tstest":"^0.7.2"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"922afa7a8d1d4e771b44e618f0baca805ba6b5ab","_id":"clone-class@0.9.13","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"integrity":"sha512-yn1kipdwx8dAbGFY3bIO+OYfSwBN3edtPcqc7iRmAusNJaU2cJQuHGwYZiqdtHhXmOlAYbp9Qh4iA6RTL+PbSA==","shasum":"256185f8171aacb82d98ff539b7fed9d094d270b","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.13.tgz","fileCount":138,"unpackedSize":112821,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvs7GrvODAcTg9iLiSCq+9gBt8AS8pMaRxTnekGjlOCAIgeZ3pkAEjB0vQQeDv1JFPT0cec4NKBhqfvCgJTX6tZS0="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.13_1632391622358_0.013114231681410793"},"_hasShrinkwrap":false},"0.9.14":{"name":"clone-class","version":"0.9.14","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.17.12","shx":"^0.3.3","tstest":"^0.7.1"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\n$ git clone git@github.com:zixia/clone-class.git\n$ cd clone-class\n$ npm install\n$ npm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### `cloneClass()`\n\n```ts\nconst AnotherClass = cloneClass(OrignalClass)\nconst instance = new AnotherClass()\n```\n\n### `instanceToClass()`\n\n```ts\nconst RestoredClass = instanceToClass(instance, OrignalClass)\nassert(RestoredClass === AnotherClass, 'because `instance` was created by `new AnotherClass()`')\n```\n\n### `Constructor<T>`\n\n```ts\nconst NewableClass: typeof AbstractClass & Constructor<AbstractClass>\nconst instance = new NewableClass()\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"d4599de8e67d0108e62ac53a5c99cc9c5a7e13f6","_id":"clone-class@0.9.14","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-ALxo6wyMuKV40LrxOzEOjDzZeNuEGtwVnADDLBRKfwY04Ex5EnGZf6UainKTtKRKDotZ0Wnnu/dnGChvD0Ro8A==","shasum":"32ee5fa96a9d3b2b368ee33edb505a5baa8eb2fb","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.14.tgz","fileCount":138,"unpackedSize":112561,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCU3BgdpfQB4Za2bmgOBYapdJsownwsBVcZoTxH6j+QxwIhAI5XGT+ntNzml5rSrWW4G/szxgMrCPe5Wy1nDuv/Gb/I"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.14_1633185217210_0.3225920807586147"},"_hasShrinkwrap":false},"0.9.15":{"name":"clone-class","version":"0.9.15","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"clean":"shx rm -fr dist/*","dist":"npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/","fixup":"echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json","example":"ts-node examples/example.ts","lint":"npm run lint:es && npm run lint:ts","lint:ts":"tsc --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm run lint && npm run test:unit","test:unit":"tap --node-arg=--no-warnings --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","file-box":"^0.17.12","shx":"^0.3.3","tstest":"^0.7.1"},"publishConfig":{"access":"public","tag":"next"},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"5effe40df362c13b4e018a4543faa6ba9c04e90d","_id":"clone-class@0.9.15","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-78WA4z9ZLHDENCVhoO7zbNV0FuqXRoKwf0zy7eGdSozRz711Z8Bq3t03FKM9Le8Gb9pnMpbxRAsM0TN8Jnck4Q==","shasum":"35dfaf27b165535a8328a3d318a6612629ce44f4","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.15.tgz","fileCount":138,"unpackedSize":113301,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlPFu58ZEz9bsyBdq/GHi+oj5rOkBcoJVdH6JRheUPpAiEAjUAKdbuA2xybbzcJ80s9D5aXFMu9mA6c/tjkEcEYquU="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.15_1633188121231_0.39607404374142896"},"_hasShrinkwrap":false},"0.9.18":{"name":"clone-class","version":"0.9.18","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.14.1","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"next"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"d3333b4385e006e7a15c658bd0a11387fb9865c8","_id":"clone-class@0.9.18","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-fIn0ed4SrDuCx7sN2CM6ph8UnNOcsfguvGusMGvyQ9EeFb//tG9hnNMSiDlp7uDjktPKEYBFrF6vqNLKjz9RpA==","shasum":"78162f6856ad321b6a9fff04bd76e1b49795d2e3","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.18.tgz","fileCount":136,"unpackedSize":109200,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuS2cPeAYgBC7CbDEc1xgZMYkYeoIET1rp6uQa2CEp3AiEAjTlfKjZZ78sHY8p7HYTmr3D8NS5XcIbIzkKIbRrlM5k="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.18_1633449962163_0.13973095913528488"},"_hasShrinkwrap":false},"0.9.19":{"name":"clone-class","version":"0.9.19","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"next"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n## CHANGELOG\n\n### master v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"c2ff50c3fe3d5fe7d0e57a8d909c79aad7f449d0","_id":"clone-class@0.9.19","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-kZ2H/pCMNyt4DQAnj7o0vMLzk2PfThER6kwzKkauKYPTyVUSoI5uX+oEaNTU8vX0tOi6SClqFtcbPhk7iely2g==","shasum":"398d39cca930cea2e31e2bc6323ba22a30df034e","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.9.19.tgz","fileCount":136,"unpackedSize":110271,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHl+cEFXO78hR3rvvgFNVmz+4imkEQ4zW1vbFZixkaD6AiAwYM6Snj2h7fvHKoZb17fdwdRVOqwRGGe4McujgS8aIg=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.9.19_1634114445734_0.24035230890275683"},"_hasShrinkwrap":false},"0.10.2":{"name":"clone-class","version":"0.10.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"4379ac4e238c7529577950f04c75482051ec5be5","_id":"clone-class@0.10.2","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-oHHZgjdXW4DYfLQ3EHt7if4Z+zMXoX/xLvdkQGixo6lmgQ2Lvo4tJPu7jKmgWxNijlOGdPmdoYaAf2DFE/07QA==","shasum":"040bc9ecabf44774d46429ac6140c3ffa3dcdb1c","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.2.tgz","fileCount":154,"unpackedSize":127264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDnnSj4bBQN5v0xiZHUodnfRZURZUbVplX4c8slVAB6AiEAgwYNnW7/KoBiWeseTEu4pSDywf8IQr8b29kOkMECxMc="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.2_1634710441165_0.9949322401491447"},"_hasShrinkwrap":false},"0.10.3":{"name":"clone-class","version":"0.10.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"ea38d76a19700d4e0fab2aa62a76df09ac359905","_id":"clone-class@0.10.3","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-7I2EVGwGjdbdhlxPY9Hz6JvfiK5a7smAexiurc2Deds8MDRLV4vwDLwOJGfkIOjoznBCz8BC5UgaeO2e5gCsqQ==","shasum":"3143db6f303dbf3152490911965c6b548023de38","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.3.tgz","fileCount":154,"unpackedSize":127884,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdKxAMaQQPxpzenP7C3KN6W5UYJ7YeeyvtAhe4meTvhAiEAvJ9rTJaHeNxWrk0gxidVIESIXJZGG8lsnweIMf7LSQs="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.3_1634710795151_0.6949159477352673"},"_hasShrinkwrap":false},"0.10.4":{"name":"clone-class","version":"0.10.4","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"39f31e317b2aff3c80a48034aa35eb2afdd6d6f3","_id":"clone-class@0.10.4","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-CgzvVm9g+2ewGC2vHHW8tkvapSoK9SYJ9tk8jUaVCOgruJLIqmMC59IoPiV3nIGlFaEIVNudvJtO7RPgx91sCQ==","shasum":"43e7fa7f43a700546bcfec9bb332658fdc403746","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.4.tgz","fileCount":154,"unpackedSize":127880,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/NFXXlgV9X4boaxk7OF9avEyP0pBFndQgYcX/vJFCcAiBsmAXEixvE9ogioqmN8BfLNCLxOox4theG4g2ZZHtuIg=="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.4_1634711304670_0.7066391447308371"},"_hasShrinkwrap":false},"0.10.5":{"name":"clone-class","version":"0.10.5","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"e8479001b280e018b0e413a5cf428ad90b4a6943","_id":"clone-class@0.10.5","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-e1DDEmNYhdKczsz6dgoNXCkJ6+csLt6eAOTIpoYZwa6col7vQ+SmlvkokAR/hDPLGz+msi5UvlZN66xuEOZ6Yg==","shasum":"2f58688eab54aaaff2378ffae821efbc303c1709","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.5.tgz","fileCount":154,"unpackedSize":127778,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2uhX4tdExXcoN8iE3926WVFVYO/HS+36VPu/5S9X5bQIhAN1attnBZNq0ejKpFwY+7p/lYZ+IpffDrCzfU/XSPxeC"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.5_1634711383241_0.8591448668089516"},"_hasShrinkwrap":false},"0.10.6":{"name":"clone-class","version":"0.10.6","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"cbdd0a3dca8256eaf76fd49f5d5933f1581063ff","_id":"clone-class@0.10.6","_nodeVersion":"16.11.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-LaMVjgtS5hFkCkdq3eL1M+jehnhVubV/2dP4/BhpApJ0GPKYr0mtVvuLyQGbQnZZfELTW1fxqu9Fhex/0Ijavw==","shasum":"15927bc607b7f50735a7441275b099942a50f9e8","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.6.tgz","fileCount":154,"unpackedSize":130525,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8zE/4yIX5SpqGWtmDXdf+2dv+FtRAGkmfbz1yySpivAIgAPGCImOp/qHqOSvNqibJvzugWEAt+46N2QCymXyPnbk="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.6_1634744117335_0.8278977160349485"},"_hasShrinkwrap":false},"0.10.7":{"name":"clone-class","version":"0.10.7","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"2838f6be4e1b14b6ec1d73337e5bc4935886e3b0","_id":"clone-class@0.10.7","_nodeVersion":"16.12.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-4710T5/PJ4UnvwWbHiLfJ9NMkc+YTH/Hw882KO6KlJHKepwF4A0K3Ou3lF+xKiHA3GvXqTryqB/DGTqNAh/f1w==","shasum":"2faebb7e5a2f776077a79b1c4d65cc1414a7095c","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.7.tgz","fileCount":154,"unpackedSize":132522,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNzMAm1HKHjqSvklREmfaUA7ky57v9UO4efwXjQU5nMgIgPoHZhu2EWw+RTOL9SLcjDkkZE15w+/qc9hSXE3MqW34="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.7_1634996403751_0.0958831893481833"},"_hasShrinkwrap":false},"0.10.8":{"name":"clone-class","version":"0.10.8","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"36d2112bea836718e2f60f3730f7b4bfbcacb2b2","_id":"clone-class@0.10.8","_nodeVersion":"16.12.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-fYYlnVSPeufhVei3eELwIykmrbqk5NLxr0mzWkZhbb5PxCNmODBQDYA2xt/9exb88/GQAoOf92hOxsc96li4HA==","shasum":"bac5d402e2fb0ae68bd6299c5d0366a293d0c352","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-0.10.8.tgz","fileCount":154,"unpackedSize":135280,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWjhCN9uuMfFLR+npzE0iZmeA2kFrsujn+UNqFi8m9AQIgXW8msqSfOSfmPkWflGtxHszzz19HJ4x43dIDLiROGDw="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_0.10.8_1634997709550_0.46521449954144956"},"_hasShrinkwrap":false},"1.0.1":{"name":"clone-class","version":"1.0.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"8daff2d0ac2ce145abdd1b2c07da3d7dcd50168d","_id":"clone-class@1.0.1","_nodeVersion":"16.12.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-wRLR2yHG9xv7fL1LDO1U8ZY8au/Uf0Rwhw/mUoCINq0obHOf7KUzlx2JHhDeYFO9y6jlZXltWTspTHnErSxL7A==","shasum":"52421685c7e20c41edf4a4a5ac72a1a86398d2c4","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.0.1.tgz","fileCount":154,"unpackedSize":135275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH16o8vNLAJ2wyPOWMxkV7NWf5aiYZwOCCMEhuTxxRxSAiEA+rN/5srXrQLrRbcLj1vprrXqKNMGrg2a9WL/YhIhzA4="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.0.1_1634998285015_0.9425722843825921"},"_hasShrinkwrap":false},"1.0.2":{"name":"clone-class","version":"1.0.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"5d52cf0ea868daf8eba6267b138315a46821ef4e","_id":"clone-class@1.0.2","_nodeVersion":"16.12.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-R+my/CTYzX889jwYK+ljcCJL09SMg/yNqK4oHXQ3IGrrZEzLS7KMVVTn92+lUGfaSMYMFXHAQm+g/HJviWK5dg==","shasum":"b68dac24243d86e2b004ef79fe683b0a64d36a39","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.0.2.tgz","fileCount":154,"unpackedSize":141135,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBfekhBK+XiMlqt9LMh+sfOHIrowlT9GYkYL77u+ZcaAiEA/cU/kiYaj1TtOKTyIFF+AT3UTGtiWRv3f2xWTndzrCQ="}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.0.2_1634999486597_0.4237055236536673"},"_hasShrinkwrap":false},"1.0.3":{"name":"clone-class","version":"1.0.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^0.16.2","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^0.20.2","cross-env":"^7.0.3","file-box":"^0.19.5","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^0.7.3"},"publishConfig":{"access":"public","tag":"latest"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"gitHead":"3909645ce7a9371c61c2bdc985bf7ca483c52ddf","_id":"clone-class@1.0.3","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-w61XkwjxiT3ZRKIO8ENg4btl4qScSUU9tjdcLrUO16d7uiKA9reJK4bBgZZT5iFII06E/WsV3rAyEnxq4njmOw==","shasum":"5ba84a165878e11600f14e1fcf7e61265a576485","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.0.3.tgz","fileCount":154,"unpackedSize":145734,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhYpaMHvdp3ahiiOi3RJE0Tr9/Fp97yGrErgnM3gJKbAIhAI3+CC8wOZAwBkOm/WzW8Xcjt5dYBLSdv0Q90b8lUbq/"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.0.3_1636888568293_0.9569578111937567"},"_hasShrinkwrap":false},"1.1.1":{"name":"clone-class","version":"1.1.1","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^1.0.4","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^4.5.3","cross-env":"^7.0.3","file-box":"^1.4.3","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^1.0.1"},"publishConfig":{"access":"public","tag":"next"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n### 4. `looseInstanceOfClass(Klass)(target)`\n\nuse it to check whether a class instance is:\n\n1. `instanceof` the class `Klass`\n1. `instanceof` the class `Klass`'s child class\n1. the `constructor.name` is the same as the class `Klass`\n\nUsage:\n\n```ts\nlooseInstanceOfClass = <C extends Constructor> (Klass: C) => (target: any): target is InstanceType<C>\n```\n\n### 5. `interfaceOfClass(Klass)<Interface>()(target)`\n\nuse it to check where a target object has all the same properties from class `Klass`\n\nUsage:\n\n```ts\ninterfaceOfClass = <C extends Constructor> (Klass: C) => <I extends {}> () => (target: any): target is I\n```\n\n## CHANGELOG\n\n### master v1.0 (Oct 20, 2021)\n\n1. Add `interfaceOfClass()` method to check whether a object satisfy a class interface.\n\n#### v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"6f2635abd337a966436369d18fa73f99510de3f2","_id":"clone-class@1.1.1","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-KYDe3/0Qu2UfsExppOGNbE2LUM9HLAijNde/DCYdndnyfcqKx2mlnW1J/YpcADgq6tvnVbHWx33NY4B/3WyGxw==","shasum":"2d093db4c8e204d895bffbaae11da32feb8fd2ec","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.1.1.tgz","fileCount":154,"unpackedSize":144773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnB/+CRA9TVsSAnZWagAAgO0P/1oAyjj6GbPIqP3qzHlM\nHOqkZGcmJXGECzCSfi0fS4TD8C3g5o9Rgz3Rd0NiXOKSWuJ+eNcky8Svt+J1\nT1TGNtmshhId/+1bafgf6IsrWeVLhfv5QH6spJW87AhHCsYNP7dVREgj7o7R\n4rS3/wqEzq+uuAyg9GW4knC64f+B7CEUL59/BIJsaMlY4OcsymhheUi1M4mg\nj4nRcpYShJAZa/WpvSNAc6jwhpZExbm5hv6lOFjIn+ukQ6uqa6OqWaaJziRF\nGTUHCVyEU2zefl+SzgCGiZKqyzJUSknkdadtyFAkmcJeIU9JOjgHvd0Aklbg\nalWI9zTu7JyRsxMXZcq6T44H+H1qpqyoApnQqGTRT10nI3bp6Nmv7umwqUYK\nzVlKoABjGH4HB7ff0XNEeBCA8Z3EZaqOxHHXcieJdvw9ghpTGgy1b/LJI63+\nRwV/u4B0PQ104xzjLYFWklYlqWNCcYO7T+r/iXZtkwcHkV7IiTMUrr7n8GAo\ndt7edtm8uCmumdg8XrLmfvd+fszLxxMy2fUIJjF2YgwnAB5AEgbZcj2nVq8T\n3kim6HfCPF3tcvOHTSLWvxUuUqJXaeXNXqll2Ud5ATsQMjSH9bfoj33g8hRL\njVXBYpWhcOGy43bNUVCN572Yjhw1sf5nttH/S+RXkVWgXfXJiHUT8Z2thgHh\n0pm5\r\n=crNP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZc4xgXyBMiLab1EjeF2oVmhKpcu1NzGoPS+Lqfrhx9gIhANiMV1iVRJY+XOVwtNMlDy1r8dwj7IFf2ER9ADBc3lAy"}]},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.1.1_1637621758528_0.8726212855945559"},"_hasShrinkwrap":false},"1.1.3":{"name":"clone-class","version":"1.1.3","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^1.0.4","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^4.5.3","cross-env":"^7.0.3","file-box":"^1.4.3","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^1.0.1"},"publishConfig":{"access":"public","tag":"next"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n### 4. `looseInstanceOfClass(Klass)(target)`\n\nuse it to check whether a class instance is:\n\n1. `instanceof` the class `Klass`\n1. `instanceof` the class `Klass`'s child class\n1. the `constructor.name` is the same as the class `Klass`\n\nUsage:\n\n```ts\nlooseInstanceOfClass = <C extends Constructor> (Klass: C) => (target: any): target is InstanceType<C>\n```\n\n### 5. `interfaceOfClass(Klass)<Interface>()(target)`\n\nuse it to check where a target object has all the same properties from class `Klass`\n\nUsage:\n\n```ts\ninterfaceOfClass = <C extends Constructor> (Klass: C) => <I extends {}> () => (target: any): target is I\n```\n\n## CHANGELOG\n\n### master v1.0 (Oct 20, 2021)\n\n1. Add `interfaceOfClass()` method to check whether a object satisfy a class interface.\n\n#### v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"83953f28228a364f7e0271a48a6f757919e0e247","_id":"clone-class@1.1.3","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Ysivmcmx+6+YcWsVK7GS5n+zf4vbF8QtrC5oZYXOB1EbqlraGebsks51WqP2HjPZe40rnZpVI/l9EVXEUmN3Vg==","shasum":"917945489175cd4dbfacecb4ab142bbc1e5c301d","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.1.3.tgz","fileCount":154,"unpackedSize":148262,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFg2iE3KGzBHAUOpBDe9e0NuXz/okpTgNHjEkciycsHHAiEAkFiVRAAoYAApQysMkCYkkJmQaJa8F+SjJA1RaWT0AJs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJif7aPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDXg//dJqCvQ8FeRN5x6xGnmJ8MkykPYmyIxjQWCFf4M7ll3+FdI+B\r\nAdKbnEMSdGEXOrSK5Ozr8UmjfLQgnMRymx1FsCIc6xMTT6t/xSdSRkGO8Pxf\r\nvoZg2zODYzcOj4vNrxFrGwghE3lu1sS9/uC/ZdK5IWlaZxF7lttXgPPK180w\r\nuELwBslDVpGAycc22ZQkCENEH46J3C0TKoZztQHj9Trc/gE4wh3sJUC0LzG9\r\nUcmJnmJvoJDUl6ANEUeTKeJandqB7aLSsfqe+FiVU/zNuNZc9biVbO4DkSDr\r\nP9yJBvxSI0hTLim2c5kFVCLjoOFKpKO5A1R93xSM1v/fKwud/59hoilVmnHi\r\nrXSlRhaC7xJeCZSy1oeRqXzn+UvTHFkr2599YWL0vkdtNqQtqOkMTXaq6FrC\r\n37abxOLp0jox4nAwV7x0ONrUQQpr1A4IkZpg1UqMQEbPVTkqfmaKLK/zc76G\r\nKmrm80UeP9qPfd2HpYeEmPPPhkxpz0EFXYKEnF4UV+sPO+gjRnPKN+U+pVfr\r\nxmTP6pDdriFL8eRf7kbomJWvBv/lCGMZTwEurLxNlxM33A2braWxGcQpQ2oc\r\np2DkKGsJUpqYbU3zVoutI0qzuAtl3WMXd+tWfGAmewymT7MV2SP2oJAy8njz\r\nm/zRx8v3Xu8rpfrOgEwF0Ijdxe6Xiky/5mY=\r\n=yA5I\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.1.3_1652536975252_0.6035292330108992"},"_hasShrinkwrap":false},"1.1.2":{"name":"clone-class","version":"1.1.2","description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","type":"module","exports":{".":{"import":"./dist/esm/src/mod.js","require":"./dist/cjs/src/mod.js"}},"typings":"./dist/esm/src/mod.d.ts","engines":{"node":">=16","npm":">=7"},"scripts":{"build":"tsc && tsc -p tsconfig.cjs.json","clean":"shx rm -fr dist/*","dist":"npm-run-all clean build dist:commonjs","dist:commonjs":"jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json","example":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" node examples/example.ts","lint":"npm-run-all lint:es lint:ts","lint:ts":"tsc --isolatedModules --noEmit","lint:es":"eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"","test":"npm-run-all lint test:unit","test:unit":"cross-env NODE_OPTIONS=\"--no-warnings --loader=ts-node/esm\" tap \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"","test:pack":"bash -x scripts/npm-pack-testing.sh"},"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"keywords":["clone","class","es6","static"],"author":{"name":"Huan LI","email":"zixia@zixia.net"},"license":"Apache-2.0","bugs":{"url":"https://github.com/huan/clone-class/issues"},"homepage":"https://github.com/huan/clone-class#readme","devDependencies":{"@chatie/eslint-config":"^1.0.4","@chatie/git-scripts":"^0.6.2","@chatie/tsconfig":"^4.5.3","cross-env":"^7.0.3","file-box":"^1.4.3","npm-run-all":"^4.1.5","shx":"^0.3.3","tstest":"^1.0.1"},"publishConfig":{"access":"public","tag":"next"},"tap":{"check-coverage":false},"git":{"scripts":{"pre-push":"npx git-scripts-pre-push"}},"readme":"# CLONE CLASS\n\n[![NPM Version](https://badge.fury.io/js/clone-class.svg)](https://badge.fury.io/js/clone-class)\n[![Build Status](https://api.travis-ci.com/huan/clone-class.svg?branch=master)](https://travis-ci.com/huan/clone-class)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Clone Class](https://huan.github.io/clone-class/images/clone-class-logo.png)\n\nClone an ES6 Class as Another Class Name for Isolating Class Static Properties. \n\n## EXAMPLE\n\nRun the following example by:\n\n```shell\ngit clone git@github.com:zixia/clone-class.git\ncd clone-class\nnpm install\nnpm run example\n```\n\n### TypeScript\n\n**[Example Source Code](https://github.com/huan/clone-class/blob/master/examples/example.ts):**\n\n```ts\nimport * as assert from 'assert'\n\nimport {\n  cloneClass,\n  instanceToClass,\n}                   from '../src/clone-class'\n\nclass Employee {\n  public static company: string\n\n  constructor(\n    public name: string,\n  ) {\n  }\n\n  public info() {\n    console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`)\n  }\n}\n\n/**\n * Example 1: `cloneClass()`\n */\nconst GoogleEmployee = cloneClass(Employee)\nGoogleEmployee.company = 'Google'\n\nconst MicrosoftEmployee = cloneClass(Employee)\nMicrosoftEmployee.company = 'Microsoft'\n\nconst employeeGg = new GoogleEmployee('Tom')\nconst employeeMs = new MicrosoftEmployee('Jerry')\n\nemployeeGg.info()\n// Output: Employee Tom, Company Google\nemployeeMs.info()\n// Output: Employee Jerry, Company Microsoft\n\n/**\n * Example 2: `instanceToClass()`\n */\nconst RestoreGoogleEmployee = instanceToClass(employeeGg, Employee)\nassert(RestoreGoogleEmployee === GoogleEmployee, 'Should get back the Class which instanciated the instance)\nassert(RestoreGoogleEmployee !== Employee, 'Should be different with the parent Class')\n\nconst anotherEmployee = new RestoreGoogleEmployee('Mary')\nanotherEmployee.info()\n// Output: Employee Mary, Company Google\n```\n\nThe most tricky part of this code is `(this.constructor as any).company`.\n\nIt will be very clear after we break down it as the following steps:\n\n1. `this.constructor` is the constructor function of the class, which shuold be the _class function_ itself.\n1. `company` is a static properity defined in `Employee` class, which will be set as a property on the _class function_.\n1. So `this.constructor.company` is equal to `Employee.company`, except that we will not need to know the exact name of the class, `Employee` in this case. We use this pattern is because we need to visit the _class function_ even we do not know it's name.\n\n## API\n\nWe have two APIs for dealing with the classes:\n\n1. `cloneClass(OriginalClass)`: create a new Class that is `extend` from the `OriginalClass` which can isolate static properties for stored values, and return the new Class. \n1. `instanceToClass(instance, BaseClass)`: get the Class which had instanciated the `instance`, which is the `BaseClass`, or the child class of `BaseClass`, and return it.\n\n### 1. `cloneClass()`\n\n```ts\nconst GoogleEmployee = cloneClass(Employee)\nconst instance = new GoogleEmployee()\n\nassert(instance instanceof GoogleEmployee)\nassert(instance instanceof Employee)\nassert(GoogleEmployee.name === Employee.name, 'Should be the same class name')\n```\n\n### 2. `instanceToClass()`\n\n```ts\nconst instance = new GoogleEmployee()\nconst RestoredClass = instanceToClass(instance, Employee)\nassert(RestoredClass === GoogleEmployee, 'because `instance` was created by `new GoogleEmployee()`')\n```\n\n### 3. `Constructor<T>`\n\n```ts\nclass PrivateConstructorClass {\n  private constructor() {\n    console.info('private constructor called')\n  }\n}\n\nconst NewableClass = PrivateConstructorClass as any as Constructor<PrivateConstructorClass>\nconst instance = new NewableClass()\n// Output: private constructor called\n```\n\nIt seems useless at first, but if you want to use manage many Child Class for a Abstract Class with typings, then it will be a must have tool.\n\n### 4. `looseInstanceOfClass(Klass)(target)`\n\nuse it to check whether a class instance is:\n\n1. `instanceof` the class `Klass`\n1. `instanceof` the class `Klass`'s child class\n1. the `constructor.name` is the same as the class `Klass`\n\nUsage:\n\n```ts\nlooseInstanceOfClass = <C extends Constructor> (Klass: C) => (target: any): target is InstanceType<C>\n```\n\n### 5. `interfaceOfClass(Klass)<Interface>()(target)`\n\nuse it to check where a target object has all the same properties from class `Klass`\n\nUsage:\n\n```ts\ninterfaceOfClass = <C extends Constructor> (Klass: C) => <I extends {}> () => (target: any): target is I\n```\n\n## CHANGELOG\n\n### master v1.0 (Oct 20, 2021)\n\n1. Add `interfaceOfClass()` method to check whether a object satisfy a class interface.\n\n#### v0.9 (Aug 26, 2021)\n\n1. ESM Support\n2. GitHub Action enabled\n3. add `looseInstanceOfClass()` method to check whether two class has the same name (See ([wechaty/wechaty#2090](https://github.com/wechaty/wechaty/issues/2090)))\n\n### v0.6 (May 2018)\n\n1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`.\n1. add new type: `Constructor<T>` for adding `new (): T` to abstract class declaration.\n\n### v0.4 (Apr 2018)\n\nFirst publish version.\n\n1. `cloneClass()` work as expected.\n\n### v0.0.1 (Apr 23, 2018)\n\nInitial version, code comes from Project Wechaty.\n\nLearn more about the full story at Chatie blog: [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n\n## SEE ALSO\n\nAn UseCase of `clone-class` can be found in an article writen by me from Chatie blog, it's also the place where this module comes from. It's Worth to spent some time to have a look if you are interested.\n\n* [New Feature: Multi-Instance Support for Wechaty v0.16(WIP)](https://blog.chatie.io/blessed-twins-bot/)\n* [TypeScript 2.1 keyof and Lookup Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html)\n* [TypeScript Evolution](https://blog.mariusschulz.com/series/typescript-evolution)\n* [TypeScript Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)\n\n## AUTHOR\n\n[Huan LI](http://linkedin.com/in/zixia) \\<zixia@zixia.net\\>\n\n<a href=\"https://stackexchange.com/users/265499\">\n  <img src=\"https://stackexchange.com/users/flair/265499.png\" width=\"208\" height=\"58\" alt=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for zixia on Stack Exchange, a network of free, community-driven Q&amp;A sites\">\n</a>\n\n## COPYRIGHT & LICENSE\n\n* Code & Docs © 2018 Huan LI \\<zixia@zixia.net\\>\n* Code released under the Apache-2.0 License\n* Docs released under Creative Commons\n","readmeFilename":"README.md","gitHead":"ea949b654469ff95a2f32154592f6546fa22e0a0","_id":"clone-class@1.1.2","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-c+uTsx4TslS/3ynrmgazRPwX+3MRS/PZ1K8p/6r4Q145KVRHs5cMWjgpERHPR4x8b/kp5o8cPrlDiFAyweJhig==","shasum":"355840ba37cfe015324dece45dadcee3d4b316af","tarball":"https://registry.npmjs.org/clone-class/-/clone-class-1.1.2.tgz","fileCount":154,"unpackedSize":148252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIASTAp4Xnab6VCwMfUmiC6x8amM2mZC7DvR1oDAitI7NAiAtPAj7SnYM6St7f6INF9ZwNwr+CZ4hD7J/FG3hDAYVNQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJif7akACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0NhAAlpMx1wzuswHSZnT5tWLMfE2dgEXdNXqSEcHb/y7PAETcGAac\r\nLM/dHvoH+v+WlXbrupGr29UfNrOje5U4FDcZvPuWyWk8n1G74Ag+SxtRTtFd\r\n1CvSnJslnLIHl02D/Z6nngOlyuBTEgyY9tacRryHhZbKcaddaJYkS3J3U6oG\r\nssDuBiNQ7e8dm9fP2ZPES0m2MVw/7c6++7jidUhCH/3dXI1nSKk9AC83N3oV\r\nqGU1tsHMHdcg48q3PjejP3v9mir0on2cU+nSJI/gSeBwozfRlN+DKqBE8emQ\r\nZWNCthn3HFQ5lpKGldlkTX7K78C6utKKc880hyLA3ZR6/qh5u6kuuweupywH\r\n9KltL1HeuqSjoXkeNyskXP3KTF0hqTW6ReqACgoUIx9OzyTgttM6hmDe1pWx\r\npC5N7xClwoG65xxhSCcaEhA8xGJIzQ3i84IRgpapc8/nWKOhgDG+3amczIY0\r\nrPqDiW3rpY57Vul/IS19Syp/1E4CVRVtWZUJKLaXSAPIau73G9AC9aUkb3vq\r\nEClDth6WO9AnltizK6FuRS0/F6Qko9wBT27AirlU+4QdiqLrglkrXj5UEWKj\r\nEFEz33UpcQEA6HlXIrBaf9toUQzcYrlW04O+lxY9l0wbCBFn+pCXOJ5uoO0g\r\nphu2LC3FpJBRzkZ2VUbuaD5nL+15ss/YBo0=\r\n=mkhy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"zixia","email":"zixia@zixia.net"},"directories":{},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clone-class_1.1.2_1652536996267_0.24936350257530804"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-23T11:26:37.161Z","0.0.1":"2018-04-23T11:26:37.281Z","modified":"2022-05-14T14:03:16.504Z","0.0.4":"2018-04-23T12:12:00.385Z","0.2.1":"2018-04-23T12:22:29.670Z","0.2.2":"2018-04-23T12:30:48.761Z","0.3.1":"2018-04-23T12:36:16.640Z","0.3.2":"2018-04-23T12:48:31.002Z","0.3.3":"2018-04-23T12:56:46.483Z","0.4.1":"2018-04-23T13:01:12.476Z","0.4.2":"2018-04-25T05:22:50.562Z","0.4.3":"2018-04-25T05:26:07.669Z","0.4.4":"2018-04-26T04:28:57.054Z","0.4.5":"2018-04-26T04:29:36.701Z","0.5.1":"2018-04-28T13:34:55.345Z","0.6.1":"2018-04-28T13:47:36.486Z","0.6.2":"2018-04-29T03:12:35.039Z","0.6.3":"2018-05-02T02:55:21.849Z","0.6.4":"2018-05-02T10:04:52.738Z","0.6.5":"2018-05-02T12:14:02.108Z","0.6.7":"2018-05-07T07:46:27.116Z","0.6.8":"2018-05-22T15:48:52.237Z","0.6.9":"2018-05-23T03:21:24.710Z","0.6.10":"2018-05-24T11:43:05.859Z","0.6.11":"2018-05-24T13:43:29.592Z","0.6.12":"2018-05-31T07:11:06.598Z","0.6.18":"2018-06-04T16:38:14.752Z","0.6.19":"2018-06-27T19:14:08.122Z","0.6.20":"2018-11-27T15:41:49.056Z","0.7.3":"2020-03-06T15:08:28.989Z","0.9.2":"2021-08-26T05:23:57.930Z","0.9.3":"2021-08-26T05:24:37.129Z","0.9.5":"2021-08-28T10:18:21.261Z","0.9.6":"2021-08-28T13:42:49.007Z","0.9.7":"2021-08-29T02:21:03.559Z","0.9.8":"2021-09-22T17:39:01.702Z","0.9.9":"2021-09-22T18:11:20.675Z","0.9.12":"2021-09-23T10:04:32.433Z","0.9.13":"2021-09-23T10:07:02.801Z","0.9.14":"2021-10-02T14:33:37.393Z","0.9.15":"2021-10-02T15:22:01.434Z","0.9.18":"2021-10-05T16:06:02.368Z","0.9.19":"2021-10-13T08:40:45.864Z","0.10.2":"2021-10-20T06:14:01.364Z","0.10.3":"2021-10-20T06:19:55.280Z","0.10.4":"2021-10-20T06:28:24.802Z","0.10.5":"2021-10-20T06:29:43.407Z","0.10.6":"2021-10-20T15:35:17.487Z","0.10.7":"2021-10-23T13:40:03.944Z","0.10.8":"2021-10-23T14:01:49.681Z","1.0.1":"2021-10-23T14:11:25.221Z","1.0.2":"2021-10-23T14:31:26.803Z","1.0.3":"2021-11-14T11:16:08.464Z","1.1.1":"2021-11-22T22:55:58.680Z","1.1.3":"2022-05-14T14:02:55.427Z","1.1.2":"2022-05-14T14:03:16.437Z"},"maintainers":[{"name":"zixia","email":"zixia@zixia.net"},{"name":"chatie","email":"dev@chatie.io"}],"description":"Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.","homepage":"https://github.com/huan/clone-class#readme","keywords":["clone","class","es6","static"],"repository":{"type":"git","url":"git+https://github.com/huan/clone-class.git"},"author":{"name":"Huan LI","email":"zixia@zixia.net"},"bugs":{"url":"https://github.com/huan/clone-class/issues"},"license":"Apache-2.0","readme":"","readmeFilename":""}