{"_id":"@prunus/mixin","_rev":"30-370c7f8f15e5190f4f1c6732174c487c","name":"@prunus/mixin","description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","dist-tags":{"alpha":"0.0.0-alpha.0","experimental":"0.0.0-experimental-647051e","latest":"0.0.0-experimental-0e11f82"},"versions":{"0.0.0-experimental-25d94ca":{"name":"@prunus/mixin","version":"0.0.0-experimental-25d94ca","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-25d94ca","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"5d65a8d0ad4086b7f2aa85c47cf4d9e2da596da9","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-25d94ca.tgz","fileCount":42,"integrity":"sha512-JyIoxkW2gWB1QC2n+DXmxOO9YIU+HebOAS1B8OmBA67ZuFIUVC7lYZm2qONE8sRJa0/UKjYBEAyrsfp4I5gVfA==","signatures":[{"sig":"MEUCIQCLO5gtDByqyzp+uBa47/w7M1tVc6wHE4XJNXhCmLEIkgIgKj9fTMYZtLVq/7VDLHkBcwwZRBMq8fSHsxvCx5tmXAk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUJTuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPPA/+M18+ThDXZril17cYsS1WsN/jZBAU6ihLbTDi6Tk2a33KN49x\r\nXb3olw2McFWpErhIqDBKLrF3HFsKUzqE+qRygv48VyubM03+LM/Y0FTZxMEq\r\nGzF5R2Ol8N73Xi3aAOnaXk+y5JBaCIztGVgnKG0h7Gj98/Vt0Eq58RiVv27X\r\n8ZnH70kL5aQPAdFB3zCMOWQPZzCQ0dLB1iQ7aLeF3iiIyKETsRybklY7iKG8\r\nlLK3Bcm0jEc488Kd4I6hnwi8zGOgVdYihdG+NNzEUjvy+/na/8dSSdBg9jlu\r\ntCzvrjH6M0/sUcs0odUrH1Uyyep+umC51B23EZbtSFboScwInnxn3tdzSojM\r\n01rdO+jpfpo3eJx6Nczn94FAaGjB9SSYOSS2OfqVS52KCm59H9iqiNc1vpuK\r\nkuR2Pzecg9h+aSYSrodNxMcmABYsqmPf7gUZAQnmggxKWi5848SnpRTODwgS\r\nSKmcpDK1GfxEqff7dWsBblVLjLqoDqm4onyzFXdm6c5HxezMxJN5iA8hvWP9\r\nWUkf+aiCJIZNlwD9NwXdfWV5IAOJm3iZuqRdy/ausU4IFxEIn+nW6jXSlTqm\r\nJzCMnxsqpR/uOGwSg4z/RMgLn+SBGSKQoEyaVKHA/rVMO9bxX4S4qu4+pSJU\r\nLosGuaHizcQaoAR5vUpykjDhZbiM2ZIk8ug=\r\n=5ARZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-25d94ca_1649448174458_0.379661274689147","host":"s3://npm-registry-packages"}},"0.0.0-alpha.0":{"name":"@prunus/mixin","version":"0.0.0-alpha.0","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-alpha.0","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"61576b126904d2f882b5550796a5fcb51f8aa9b5","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-alpha.0.tgz","fileCount":42,"integrity":"sha512-RB0cQQI71kFKy6VHuv8iDNtGgopUQOLDRHlZTYkG7K7r+kHk1HFxcbhpOR7LRxxedX+zxgVr1A1s2mBeDt+kZA==","signatures":[{"sig":"MEUCIAoo4N0PeLVaEkhbt6sKC79Rgzhmz10LllZX6KmFTYOGAiEAwXtboRfc/lYZrMSS8IGzegSPoOQlHv9UvhY/Nwa6CI4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUJXJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohwA/9HXj8zUpKjDCPWsjNSOeqehWM8G0xEoE+tpIPmQEC9w7fqtho\r\nU+kfTZU292een3D+TQYZy9JHt+hpuC0/5F/W/1vHbOnwNUbH0Faqzs/s/cc1\r\nV60excpuOzGo6yUl+buypPIhmHuHs7nnjLo2i7EXCWsd48zd5PLtNIgo44gS\r\nlZH/jYMHvZSPw9nsMDoLP4W8lss4E4Wio6fkO7RCypwMmap4wyR+FYlZ6xDS\r\njdwz27JOs7mPdaXVzJb4t4ARXySYERtxUVEhKNzHP9MfixdAhex6xyspmFfg\r\nvD/Sc6Z5Ezg84gFw/KkuGt5DvDMC1ekuxQwC3JCT1b7yOU8i4QpKMJCOubJr\r\nRN4strWLJW1m2hhzZsMixjZA6hX14KES2ko56Pim+XGHlbIat2HcnFM/pTB6\r\n3X4ZtLXrIpJkVZ6SnsIh14jhilqNHU2VgrkoN2ki2hqEqEhktNZHGcoiVeLz\r\nKjiB28aP/9+fMr1WaYgtwmeI7NmbWpyGY2JMXpnj0cCKBlD2OHHOedXukhog\r\n4NI1hElsqb0nxpd3UKDXPYGj9wttTsvc7fJOIe0RD33NA1+oNHAJCEEzApUu\r\na9IiNvwuRwJPOxOtTX2ZpkG5TH09lunBQghvoe140XPxkvMBj1oEoev4jEoT\r\nf8uWqavMmJ1SjYy7TVjWlQjMWYehieYrDWk=\r\n=BdKq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```json\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-alpha.0_1649448393281_0.3199119692098342","host":"s3://npm-registry-packages"}},"0.0.0":{"name":"@prunus/mixin","version":"0.0.0","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"7462bd65cf7784227ccc0132dc0082b89b9d2e00","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0.tgz","fileCount":42,"integrity":"sha512-J8VXD4nk9jtvZiD4+vu63mpynngxV9OjuQujBEQajJj21NhufjMo/FHahPLO5epqCvAe1QQMKTGKzeOQVmJcNw==","signatures":[{"sig":"MEUCIDhLbkyOWsAEYckiENs22izdLkjVi3x/FejjeYt4OrHfAiEA3uHP6JRXA5m0ZgebyQe6HQLpdNfsW0Ysl8UGJH4HTMQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUJZGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWUg/8D5HH4zT8xA136QPaBRo+zou14ruhaTyadsBXbscQwWrZQlyB\r\ncgtU4gkQTTUFUj1+sN1RH5VJBtzqut1b/6PipSEpatjfLc9HNULojZiBBbxJ\r\nNQeqJR3gLmtKVmZToNeXF63PeGQGvUw4Er7vHyEcBtbAsD8PfrC34wtAToBA\r\nfWU9WxJSJ3VfdS5Q2P8RCPinRAgK3cUkW/futj72k+aPDE8NfJ+5veXEDfK2\r\nv365yEGifxZGoeuS6bgTM0Au3tcBhAMm1YScEWFtEJ5NrXsORWMWWdOLKbIj\r\n5smn2ABCl9jkbWSXPhhicPbmzZquIAoGuiJ6qWn0QMJ8cHOLIXXsTJM8Qkow\r\na2HA4i8Y3Kj7gbAltX+yrk8QXCwcjJjkOpJH2rLF2dQ3sNM1f9aQz5XwCQ/U\r\nkqjgNUSFKeu97WQ6XczdugZNV/UJIhbbTPlGCK4KpHcGP2xpM77Y76zsthpM\r\n2g06nBTZWYHK3M4UVg/otwVo96UjhSjJRlwDMx4neh+yTOFXO7iTk4cwp0eC\r\ncb9N7psiKOlyspEEItWfU67Q358BypcqACTZX8bs0W8PmvUYJ/pXKQckJ1fV\r\nwf5k3IlFNpJ5gdogP9tr4QeAeizyJVP+8DOt+ISLsklKvpwjyGmsPfveuuiq\r\nAqxDo3sAaG9FZoebGztDY11cBUTaJl00ZqE=\r\n=0zWE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0_1649448518811_0.09318724808138734","host":"s3://npm-registry-packages"}},"0.0.1":{"name":"@prunus/mixin","version":"0.0.1","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.1","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"2e8ce8e73342d7adc3274e434c9852efe9b20282","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.1.tgz","fileCount":56,"integrity":"sha512-8tqVEI09GSjRobeLgKaZYZIz64ybCh4cbcIh6z5xyIswHozaCVSKclMjkjk8iNC+zhuxwdoEoTd+tVXWq1jWTA==","signatures":[{"sig":"MEUCIE13bB50u19Iva5dAExRY7HiB1AAwACq+NlPF1ScnIb+AiEAo3XZ3hjqXaEj22qraTu6gmiMZXeGtdCFhB1r2yK0LFU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUKNoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7qg/9GNblawoMX2SUBg2EcGeundROm6k+k8hiu1Z9maWrTxkGJ5Hv\r\n/aJeJcUtwZo25Nn158afJ0QuCPvOdxmV7WeoOVHUR7FhugS/7t+LZFza98pU\r\njfmaFFMFIeEz77vtC6tTs0lATXih0+Xp2ztxAaauUZoISkb+vj0QPF+GcgRV\r\nC0su1yB3T5MacW9ImV+rooz6nyhFohaEWQG84laPvDTGf3pRvjGM78DcQ4Dj\r\nzs+wEkgIhA0TvbGrdnMhfrjbVrN949TYXj+7NyHk4PiWlIEfPeMzHe4TpeUY\r\nH/ETldeIeJ7ohcZZV8TTSPXvisVzBOfzg/xMvh09IH4DDp4r44xnnbbDrDJe\r\nsgMZyotTtEzhRrhefmxgpq+j9AzLoy/EWKFr/ywKeQOsb180IEF8xMaqvjGu\r\nkE1zVaLHwCNAS5av3pjXk/oDmVTdI91cPCifSRuDAnrC2E0Agg6LyJH9TKIq\r\nJSj1zCsHztjFXD3p2BIGYGMkJWMOBqG1Ytj+4OlXhJwK+rFGrSADpgCu65sb\r\nuurk3VEY91C+IK2sZ5i9lNx+dHdiAb5X0XXUvGg1eY4alirpSM8IWr+3BVVj\r\nxF5Ev6nyxJ/qt/CasKNspT5ITLu8jScoGHFIQjWGCCDXMka6jrjboT5AwH9Z\r\nj2lqrkiUsz2yVvQtTguzcHz91In6DqSTCnU=\r\n=tFeS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"prepublishOnly":"yarn tsc"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.1_1649451880451_0.6430962612262408","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@prunus/mixin","version":"0.0.3","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.3","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"b20ea918f19c01c25db32784a3c77daf86ef1356","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.3.tgz","fileCount":42,"integrity":"sha512-W+Yy5CLNg7QB+oYl1Yf60JHb8NU0v+CStjcdxC0teg8olgZF8UGt58NWGe0z56FraLQblM2mgYJUCQ4kZylsXA==","signatures":[{"sig":"MEUCIFz9MMz5P/mU27L1/31V7VocjSqKdMziXIYEuV5TjG3XAiEAuhVd/O0AZs/x5CSAusm6nld/OHDZBQ9Imo5vmfb1uTg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVeX5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhPg/8DpTfwxfAtO/6Ijh+671FDj2nh85j3RmHF72pD/esL24wYQbF\r\nmk4SNEpa/BzSpne+MgbPYo2v2yPeE6YfVhBBAGdO225btn9WFjD/0lnqnGTF\r\nznBrg+9mofueI5/3QfC5ZFySabmMl4MrTZcfDeM69lV4bCTKuLHMl7wNl23/\r\nzYJ0YANmpeh0j8InoxENqqSsUDuwiLIjRsvM4v9tLtkotSTpWsAY8Z5wO1Be\r\nIpvYAn0zLjWBkIS8kcwsN0QxoPY5t3IzD9an2oWtBzIj+ICYuxzlImUgac7E\r\n8U9dbPeuibalK7m/UO44ufdJnoaZ8w25BT9W4l99r+worapyPTa4LtYI5umV\r\nNwQwYcFPB6OFVhzokckWYbEBct0yNfNcNgCsOJuNX4mJvCC4o/rze6ZV60pM\r\nAGrvp66NQqK7tmdYGXmRPdRqpCWFDWw1/EOzLeOJgdpN2FvoZZN4SmbI3cua\r\nUC8ncyEOOJbIKIODgWuFD+/gODzz1+2PhHTEpsdac4abyeCVdgfqNJoNIk6N\r\n1Bu3+mA1X1xxENesjpn+IgF+rsmYsJU2KbsidkjCTQZkicQpQFbsO1AD+/TF\r\n8f2oCvyuXs3phtViBVRq+MV3iZj/5LlfURnvjDYnfuQz5Qy4qlmf1iaIAeFN\r\nzFgIS5EUvNUbcIAYbcEEPg/tXUIMLDYwNyU=\r\n=UGPc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.3_1649796601664_0.8318815173331435","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@prunus/mixin","version":"0.0.4","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.4","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"51cd2c90be9985fbd399f02542726fef747eb8f6","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.4.tgz","fileCount":42,"integrity":"sha512-j+KXfuAk8/CdQGGgf2dG7k7nTNnQIAIe1TdTR/Ixm+bAqXH2Q5SjPuPFY5aXFzu85FXHTYjmXyt4FMXO1D3MDQ==","signatures":[{"sig":"MEUCIQCUXCUluYNgB1dIHOnXgir6miYfz5PWiGdUsq488NO5vgIgAQiZbJgPN57IKVueQNhT/shXLMsmz1UBo5ihsTqx3PE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVfZfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtyA//fbP4W0wRUDEB7YKZ2ABzG5EkirfSrPhh2g7PPxP63KNPhUI8\r\npKWElIlKCxNIVJbIjXlj+7jvArP9ZR/5hi5otJpFYXO1/R5OdyQrOdaNN9wK\r\n8kwmVhEgNoEFvdHvs2i/56BYELL6xcP6/ITcu9O4wxyVb77FJc7fUQpgRPTw\r\n4PEESwxcRDO7TIqcIZVFnypYR6RsuGagUTuf9y321TrXiDFmOxZPs5YDbfxA\r\nuNyZWYoPJcZecwEh7Z/MR6PHZtBPddurbkJ++Kvd45ZdrXPs5tvZl97WX4CQ\r\nGNkwbY2UUhXPWoCBE1HycktQTrYmCSCFeS+PXpZBQe57PLCj7Vll4L4JYAIV\r\nVvUBxLAPR6rRCpc6JUrHjaq0SXsfSptem90veKzSAHoMrAloo+aY8yZbqCWJ\r\n6UYhLXoNCcEJbBmawaanTx0mmVXL9RnT4IIlRfupjfYr1EZfgSt4fck7oR8r\r\nkCfHmh3CBWcwd7PcMzY02QsmKI5BGL8iGRYBeNHMiL4dLV6ZWKXLk/tmTmlm\r\nyOllZe8d1JofMX5S1rcGxD6Akn67UEVwXkZ6JqWNES5t0iV3U5Wg95x6tM9U\r\nmHTgRbfQtwOQ9hMLactngChu/10bRZtoM8cjyEEN8FcCiOokiL3TDM5lRP9R\r\nett2ciMVe536clJ26KxQw7J4H2Zji6hWb+E=\r\n=MU50\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.4_1649800799074_0.3961214752602029","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@prunus/mixin","version":"0.0.5","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.5","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"957680566b9dfbf1e8bf2e26374ceb66ba8b2745","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.5.tgz","fileCount":42,"integrity":"sha512-3KiMM7XY6qlnTKnud3bbNCT2O6xtueK/ztqjbsZNUHixBa1MeEFk0Sa2GjMYCHE1LOoYheT4cYFFEBxIVqtikA==","signatures":[{"sig":"MEUCIQC6nVLieugUF91q5NRScYn4u9TU0EbbFwbYizQ89mxakQIgV+6HCdtI54aMpJBw/dP59ZawSUW6Ko1mxIRVJumEj80=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVfciACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNRxAAh7cr7iSe34TKXVnR83chH8hBxcc5UoyzN1eCW9K6YHn4yzIC\r\n/tLqVaqQ7MgweffNyKYNpc72qnct+RXLlhxSwWTWwPfWtoohvYpTFTIxz7g3\r\nVL151VHQSqIAApRsJDBP/Yv7Cp7NqsYDfdoA1tQOy8CWfiNJdDYo/oeyMxiZ\r\niDbCABuC0O0LUgmT1oiEkorrqRntuYkR6T7THzsG6b8dStNqRNd7lEkEvBJf\r\nltYVpqBnXLQ2kGXkyO32tg9F7/hPVlLchBz39f+PJCMnUvU1Z6VE1lfml83i\r\nANscq465603r/Kb7aY3A3I5knYfZnUPnqCVHZLoiSwtyTFBWYFqF9x9Q4Ppf\r\nGEi0SMelLt81ic7nBREome1j9ZwS6KVgPDI7RGzSOiX5pg0uQRqdkWHLaCKn\r\nMKH7ZmCeyDzrJcWbnd6P5Cg6GW/KFodb3nhUTjQQiOIBm9iNDBBtqKfG8TZe\r\nzbmkMpeOLWH4SjoikYLmL4zKvurILQVatJQQdQpykg0g2nXSrJ5gNdYIBs3w\r\nIyQ/oN3GCxYM4V7AMmqgTsjnUNtxNwGfru2qBm8O8Nelxez6rOdHAehnncSS\r\nt7N2RfOGLrpfJEhCZ74aemtMuIMeMGE8oGCdkNlZlKl0c37cGCEpJFVlNA0z\r\n0arFpQqWXOcHPEnGJHs+Uvjl0y+fvYj7BTw=\r\n=SjHB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.5_1649800993765_0.7918850613279309","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@prunus/mixin","version":"0.0.6","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.6","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"8d2bf14b85cd43d5c2c5ceef9d90dd58be40d136","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.6.tgz","fileCount":42,"integrity":"sha512-d2hDIKbQzBYcHr3zolpD8DhEBnSZOcONVRuOO7dOghD9JLE/pZSv0kjuoR67hIajx9RaRC7pN93n2VY9xqYfRw==","signatures":[{"sig":"MEYCIQCHeni/GBEEZaBEBCL++t1kIw2Qtf+PPF+KGbXF5b7b7gIhAKZQ8WGc/T7CT/vzopFbrNzxd/6bqZjEBqnlR9O+pcy4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXYv/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUGQ//dTNo4JKMMcdH3Aye/rl2cjH8AyGb2miT4YizDQFOSr7H48Sj\r\nDH0Py725h4dq9+aGOyRI7PM9kDjux2IOolPvz8MN2EjsdH8b1RlDyC3oMzyQ\r\n9gHo4ipvM49oEfvbec+p413PquiIUr8jkFgGH5WpmindUVJPqzskUfhjl7Gy\r\n+Ez8a4wrUAX2UxHrE3Gkogac/CJovVPkKlWrocYVCn2fnki8xZu/cegEgdZf\r\nxhxm4kb7s5xECECQEtBeBR6CN+R11MMGAGwd8Vbn/qfp0fqs3EyNbVevn/YE\r\nESbOcXfyQjClVoIc9+GMWejiG9Ncztwlq6fRwrC/Wfb6Jlyge3v5afhL1zaM\r\nFB6raFZFH6mvGk/XlUso+CFUEcaVAGTve3a3E8rhbaTqcOieIqBeWrarNdmr\r\nRGTQnbFsm7i7nWlyURlLMLP7BuPaVD70GtXYlARMLCjUY8G/yF6qVxVg1nG+\r\nMCNyIMomGtOYLkaGePwyCWpoN8k/U0QezgxBfwPPhnzpwkNAJqG58kGDmQAg\r\nmm5TiKPq8CMZMvq8QMy2QA5uSDTm4MnH/aW+EuQBniDPmH/4f3ll+yTciKi5\r\nvNE156C0600Of9Vr7U+WevtaNhVdEta59kAp1JshFE1SrxBQRMuSgRcGkw6L\r\nprUmcPRWVSNBhxdr4aTDfDx3bMKc6D2W3BA=\r\n=y9ie\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.6_1650297855162_0.16248678454480325","host":"s3://npm-registry-packages"}},"0.0.7":{"name":"@prunus/mixin","version":"0.0.7","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.7","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"4bbdf82ada969f4333ebcb9efff8754694a14e88","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.7.tgz","fileCount":44,"integrity":"sha512-QP0B7YJndDD/UFFnI/DYxYxMdl9jfqK22/8n1cK3XDWa6Neevz77QYDxSuc1izyg9jHanQ91ZNhCYHKNqRASTw==","signatures":[{"sig":"MEUCIQDMuBi7lENGsiSTTkUVa+LwZipc3+X7bMhT0y2BZId2OgIgIqEDdWdFMmp+ZFE1yvzxoYS6AK4Xcea6LVYvqYNn9lI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicFDJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWRA/+ID/X1ADtvL/hM56ULdCATQvV8qmZT/IJLM2IuUA18QV3u+we\r\n0TUzPIKYKJiadfIBF3gw6S2LM63wNDnmLW3lab4NwjgBP2TKe/RGAq8IJ6gp\r\n1pA363NrJYLJ73SJnWgs54B83DmcibA/yDKe804sA0mZq4l0b3J7PvTQnqtI\r\njxwWIMMLF26U6co9NMwhu3D90uanGVCnWajLCXowR4veszwf9rNyLWYvKyaK\r\n5tFvHh3BPGU6pEqh0gGDbu2D/8mMWYoa3BISEi8zlOj1COXP/FpphS9u28Fb\r\nV9EL1mF4DhFTdNIFZMxlqmTnYmq1pXgFP+aNArrX3Ag4knHezXId0Z5wpB3l\r\nEIff0+JNnYTctWiAR0X/FcLAeyQZy99XWYlkhqZPiTqOlzUPo+u3aO+fTqeM\r\nk4ZntY9qY1BPqqX+W0yCM3nOVHSGs4sdmhWKJWx+oWgKoIszT37WEtJg+o+o\r\nULLyeKpTdSxpW95nvU84IC6KFmRFfcVI+OWTzgq65sTIomdEnuL4sp9nGSPC\r\nUsv2xS0W3+0xqLUB5Z8athhy13UzYvFoyqvGCMnurClXeZSUULaYT8lfjyIF\r\n1j61kNSqXVbnxA8RSwGT99zL3V/oWHk6mlxX2iv0DpkQh3yinWXBC+F2OPtu\r\nw394e6I4WW4SyvhH9dh98mzCabnNP20uWtk=\r\n=WZvo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.7_1651527881780_0.4068248422791998","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@prunus/mixin","version":"0.0.8","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.8","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"42473d66eec6bb0af0d70cfc176efc8eedadd260","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.8.tgz","fileCount":44,"integrity":"sha512-fR0u0M3b9GTrbLkzG7+uE+E7sg5Q+c5M0eaeBJcyULrQhVycDo40XDiydp1I8oqzDg3aMsMwvTCkkhV2klJ1Mg==","signatures":[{"sig":"MEUCIHPOuOCOyL8lZ7YN6X5fy8ctuemLbKdrBItjZSVsaa33AiEA7HZSwqpy4FNxJf/uyMbHnvEmwMYsv/WLrmIt5nqvhec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihlyuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpheQ//Sn6dZIAuiWYa3dVva+roQ2MSV+Z2BMRxS2aBBl+HbDpTUlD9\r\n0/TkjYGuW2GEcDuQE5N57yd0VdyXLRoxYAuWIFN1yOlW5fzXTKibTEdxdHYH\r\nDZ/Jr3daYXsEKU4RV9Ff2OWqK6dqFzKYiUqWelygyWq4w2HCmHy/oI5Fvtqo\r\nYcbS3L0mEd9qP9NYlzXunPo+4IQ+F7qUkSiz7UY35frW1b7aitta0oMQrjMz\r\nEiZPDvuVfq3Xr3n0PTycksDSQHWeygsP4sojQdnfNt7E8P7ahU6tgMEh5znR\r\n9Mn2ZGvo5qcpFo++vpC9iia9LXsob0nQgcViwCU/FWE+UWlJVdpCvYwDA9U9\r\nOxfFCmoE/PAtPK7hhH2CgkL+MM9qpNb0JGs8UG2uwPPXVSR/yOHrglWz6Cq5\r\nTsSLmpSnCERuescTHeEFy9qgG7vWhoJQa8+mcwiSDRBeGEbb0nY973NK15Eq\r\nNNWqh2bJeDcyFngSUvnVPQRBVpLw9cp7HP+vg+tQgrkWM0AO28wM4I3M0SxJ\r\n5Blv3H4Pk3v1e/cRQLSu3BdVTX7qqzgtOqDBhjehJ1RE/JVu0OcnOkb4R6eJ\r\nb+bgiO0QaOgmNLVdtV32DbGOQ4ACXfMc8oKhzx5311CokNi4eSJJHn1CHzJj\r\noWDGgKzw8EVQ3OL7kmllfectB8uenLs2sRQ=\r\n=QGrV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.8_1652972718076_0.9367713667041273","host":"s3://npm-registry-packages"}},"0.0.9":{"name":"@prunus/mixin","version":"0.0.9","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.9","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"34564dc34d07c5be92da13b154dc6fe9bfb85cbf","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.9.tgz","fileCount":44,"integrity":"sha512-jzbWDfJcCDPEZxrmJcWLLzEuJ/jZdiw1hRUdfJXFuM0ab3tVqBe/4LdwmbcC/tsd3pd3RRMfe6I7WNaDjov3WA==","signatures":[{"sig":"MEQCIBIlrmptQZnabJb9EeJwjyEXp83qCR176fno4TcK6uCiAiA3PwCP2zVPZ1joW295bUhMGTGmlpBDGheI0ZKMF/6yVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihl8XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUhA//SKoMvXY7dyl7MdmH4WZ3THSyJtYUi3+3vGOTHXi1gkdx56AN\r\nCPRqr9Uad2dge70//wxjxFlXwXCyOnsYQ/o4uuSqVunhpZ6QFWbC++GBjSHT\r\nlTimcACSyAyfBRHl0bbsuuuHbeuirfaYGo/2iLBGoWFkARLdyJpk66v4i00z\r\nqje6W0iH1qtYw8F2We1vDhSSxaFRnv+1AyQhd7wiV6BRlYVMAlxQExtMXzjw\r\n/iqkUNm99MjGghcWTdC0OrNTXb79BcrRvwMUgjjQFhN7jv75X5k3BQZWHihV\r\nSQ8vtlSWilaZtEYZhubQd0OXbv1L25cplKWdu44x3aU5TmNd4MNa/ViKfGc3\r\ndehFCLJ7Zs9NYLsoZKbGIP8uhnXZA+eiiZEVll52wyzb2JMLy9Jqnn4U7klp\r\nLQdLlxlf+PGpZNnJ5opb3RUg3XU99pS3yAru5Yv9WVVSclDNPtYHxBdcIJAz\r\ngP59/ornFN5rG8dWgMCG+uHlixTV4pj653d2qztu+uGguXQhCc7TRxPFrB2p\r\n4TXI11xyalKNNfv5gqsPuuppOXv31nVWmLC29mHKoJAnHDdsmn4GT/4kJTVN\r\nqfrblVolpaEvgToi4+dtBVMfEFNDekBEPn3Lwy19Nw0MOeQmIA/kher+sDrY\r\n1oNtmxh/ZZOp9XqoBsEitxyooeo1SgUYcYw=\r\n=RKqd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{"@prunus/is":"^0.0.0-alpha.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.9_1652973335544_0.2702437325545377","host":"s3://npm-registry-packages"}},"0.0.0-experimental-6376996":{"name":"@prunus/mixin","version":"0.0.0-experimental-6376996","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-6376996","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"a61b6d07a6da115c3d2adf33e9f8875dcc0161e7","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-6376996.tgz","fileCount":50,"integrity":"sha512-dq90ceupMBebnwunSkUYDr8ZnAkeL5dG8f1aO8dQyzo/dMRIqiQH4Y3T+n83oqNmYwWoHrW61ufA8k/PFIp6uw==","signatures":[{"sig":"MEYCIQD4OaEbbWKjZqIV9nxa5TqERSUOlGsyNmAMSVa1ltppXAIhAK5rFJjvtwnMcpwfhWnu0FQZnzjEHXT3Sjdlz+lGpUYe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilSsUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQTQ/9FSnphOMjE5DVx0Z7OfJsTUo84OdKuacj+FRHYwiYhT4nOi9o\r\nwOCcLGx85DyYy4TtWN0bPgDfdaoPvxLaaCWCg67tPwBCCYYkoxfRkiylp/f4\r\nI1NPjfSqEuow9x7DeVcWussjvR0EvNpddahVPieZ27gc3L0Pw1qXDgxuhoCG\r\nmbTH+6iGMB18QonOH1qq3WhyY7QWZ109xiO0/QQ1xze8d6fX/69eDpcHAR+i\r\nCafQIyFKUGV83gFYRhJPTHmLV4nbTTIHuWHS2ey18BS4qJFBJImVNPkLhvER\r\nAuqzPQVUMaxYKQM1wRDvxTY3bpLyxJbTKBuy63NGV4p8W867crIP5tJpq6Na\r\nlUwMQ+BB7l4+cTONLpvW0vFgMc5sM7raTQh6TpLgv9w2DxTRggz1TMOw3DrB\r\netIvu9I2UB1l+7Kyd+CR/hSasgg21r90BWBvcGhgRfCqCTVqfzEyCZ4qV0C3\r\nD4C81TIdPdjdV3EsC3nQpcifhFem/KskPRwXtwnmfLgPD/l6H3rv4qhgVLOf\r\nhRImF38H9sulnKwDlZgPUaiQEB+HksYOIEuqQiyNHyBmrAL12u4sYxUx4YjF\r\nzE29I3q4v2HwD515c2fzo3VaBEU4r1esIhBRwMmhDwMeogeqNDXtR7R+h5r7\r\nJkrGS5FpXmZfjGModIq/MTNmzfFvo2EUB+o=\r\n=uRHj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-6376996_1653943059895_0.3314595834680092","host":"s3://npm-registry-packages"}},"0.0.0-experimental-5d6f5a7":{"name":"@prunus/mixin","version":"0.0.0-experimental-5d6f5a7","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-5d6f5a7","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"b49031d0cba9d6ddddeb4c81feb12597997a490e","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-5d6f5a7.tgz","fileCount":52,"integrity":"sha512-zDzlJSjOBvvDMivvWGIm6MDOiWdF29rM1uwxJ4PRKgEFlD94M16SEf5F2JXyBkkHT0LkbylcUlM0OZBGJRukDg==","signatures":[{"sig":"MEQCIFUStITRNIeAVJaNuBoOgfezpz4Uy+y/EKPQxPfxmFEiAiBgHDuIGLawdVvEHWR444qgjJSu3ZFjmaG646zK8A+uXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiljuEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg0A//YM0CR9k31J5hxU6T4Qjvb6Orzm1dv83Uv7EGFVUuFCMtlCR+\r\nkHyJp9JSIL3uWj/nE7hJrP3yTPMk6vS4YtlKL6/yvLf7UFUL0mmPdy45Is6F\r\nYaL191S/2m3D0798b4IwexXmPxIPokbKy+1ldjWOXdqqosfdKBetaawZDtm3\r\n2OWV3HW9xYFjnQFPUO8bxdCrDLZj2zOIS/wu8+hAQreEaf5tC3LJAScfqF0n\r\nyY6+dCYahGSigKPM5LrgXnM/VQzvvqJOlfV/bvCVK7FJEwK7aCdwPBtqLRFM\r\nyxxH7BTYhzvhtPDsrBg6GwXdBXpOFwH704CTVHHoc9Dbh9wF816WgGdlChns\r\n/U3t/DATR5LhIPCMzgzggZuHHDisqJBltyk2rPw2jMgLFb27C7G4M4DvVR3E\r\nvE/WxB2lDO7wV+gs5gycM03S8D1F1PmN+SQDZqU0KtG9Y2zyLaKbVob6MR7P\r\nvwoaNVIcmTkKg6BuAjSM/DcUaBWsh/VaF3xizZIb1cOwICzMlnYGkMvZLM2N\r\nk25Z0TJFBqMNgi1eCg0HaMjwWU3BSSCnHDEiQ4mnim9RE+sh2Cb7opVGAHlg\r\nTxc4LcARfKaBvMF8S0ERWrPnwgvRIw/T0gAsqonqQjcjSxUhalEOsc2ajshx\r\n8kHSMszDyB+Cdb5hbUiUsOmG+94CCcU1lKw=\r\n=wLbh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-5d6f5a7_1654012804649_0.8234141783917697","host":"s3://npm-registry-packages"}},"0.0.0-experimental-6fbfc86":{"name":"@prunus/mixin","version":"0.0.0-experimental-6fbfc86","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-6fbfc86","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"d56fe6547686ad53036fedca2bc72ebd02b3f3b4","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-6fbfc86.tgz","fileCount":52,"integrity":"sha512-v3Tie/4aVDn9i0CCc3AFCJrFje4dCHBF2/vIRqlbnt9NlsWAMztZy2ZTfPoEVwO6PRETDWiIoDPjjTcOhqfj2A==","signatures":[{"sig":"MEUCIQDiBloffsB6Or80NENe5ORER2uZvR328n2/vuXF629lAAIgNqXZCzdsTXeJBCcxNNfjynBKXt9n3JNpc2McUzkp3OU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":58097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJil6UOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZzg/9H1sH+34YvgsQKBF6nmU2spOHMAExWfPbccG88R0uGNyuHKVI\r\nVepfmKMMo8AXaSQNyQI7n5/Aznwb4FmQzJJ2axKBh7ZCDKgGaSCP3esObuE/\r\nUHGsvoMR2iq/NyamiAFdSx4sr8tiKMaVV7Ddr4RH0h0/JAs50o0x7Ig74aCt\r\nodIlCRM69HjruDNaEasIW5Jdw+kENZEHtJSTjA5J72TK2CE9ltMCVJflsCbc\r\nncXg+4xNoy9Z/M62fT9rnvzV6+TO7ySp27lCB4H+JUQHiI+C7RlVSlik5iGc\r\nyBVHh7/ctqq4g7tFmiNIlAj3EUvv/tFMPpw63ALfqfBiL80uzmzqJFRGxhs1\r\nJW52mlpIRBucOIa4jIpfib1KsFvuSsz2RE+ZZ/aKsYfsAn1e/qvqDWm8U/vU\r\n0vK6yQln38In8Jk9IS5b33LkEshQCPBZBQ1WDwIzV0sdwppmPDIleSxcRjHz\r\nLxbj+jxm187ACSI9nWaN+QKdTQ6JopQ1pyVvZbhe/u6pZKA4wSYZ0xaztFm0\r\nC88ePLYIqtPIYJJ4nYfBSIDuTPxosXeWdAGdch+GX0hV+fjuMC8+IAImV+X2\r\ne8GwK7ZNra9/9DQIgWleDQ2SipmTWBi6lH5Di047iPHdxM+PFaSo5uk8+lVr\r\nxP1DZMe5zd2uIV6giqnoFX4H3Mw4wIq6p+U=\r\n=5mbM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-6fbfc86_1654105358303_0.12611138643092956","host":"s3://npm-registry-packages"}},"0.0.0-experimental-df512e2":{"name":"@prunus/mixin","version":"0.0.0-experimental-df512e2","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-df512e2","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"2d3152a849a29f04d53e1487e238148cc3065b36","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-df512e2.tgz","fileCount":52,"integrity":"sha512-+Lc7rN07KEK86jeWOvXm1sU81dsbZGFm1f12aQplDNoLrciCENWIsssE3m5rkTTQtEnXKuzn5SQwuk/Q8KWPEA==","signatures":[{"sig":"MEUCIQCaQbYaFj8jusWw/gku6VLYMqPtiS+EMYjVLSw/Tfqv5wIgFE93B/aqhW4pU36wEmtmsfHD+lIqOJqhikyyUIq6+4k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivHTfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohFg//S54FFdG3ny7rGopIIpJFMgQqPH3tPMX4KEpQ1RecAROn9Oyv\r\ntRn2FBXCliu7zCkKbwq6f7aHSGSgkS7i4BCQ5zv22MPfOlxosM1z704g6JEF\r\nuvoyxDXsK8wsNaflrvkEj8O8Hmrm+HQyYZcLf13O3nkB1yt6YtzGLO9gxP5e\r\nzO8boz+G8vcP/ZMlKZarsrvr/YNEp1LbdDnloETJ78PtQKYcmdqxs8NLF/LB\r\nAjfM7DsTD8t7jDmqXgxZS6u3ETlpfcwvUSz+DpdzI+2pbJk5mQcomqYad1dE\r\nhSsEunoqezzJVjRhTZYXwItiD1fVHXlTfpFuXMcJ0uRajOhrlBfMxiwY1c6a\r\n7Y1m4nhzI5RgZN3E2rOvfGI5lSDceRXJYX+FeUfidGCdlypbuIgw14b5G4Hy\r\np2KUQM23+8E/27CVCGH2Uhb2WQnQ1LA5fLCrMvwv1pFVAlG1/Sd8GcW0GhbF\r\noXmSp8h6zkMuVrJf45btlKKQbiKfYn+FsG6Ltwy/6cXdSF9hRs82bh+tshtv\r\nx/ZXjTwo0DXsJF0M9EAh1alxVBPZ/nhDcNAvinOvm9IxrW0Y3mUW4ETXnVSG\r\n2IXP91wdTO5RiMmh582agetspQeXOb9ehZR3f+ZsGSen3SiOuW+UZrHN5dsD\r\nOGWseaophJ3RDCSneeXmmAw/cxlwD2ztcxY=\r\n=9bWU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-df512e2_1656517855049_0.4829637293244242","host":"s3://npm-registry-packages"}},"0.0.0-experimental-054eab0":{"name":"@prunus/mixin","version":"0.0.0-experimental-054eab0","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-054eab0","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"2b0b2333f1189167e991037732c58a503886287e","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-054eab0.tgz","fileCount":52,"integrity":"sha512-Z4tg5opce/GzpoYs2IZ3wsnlCk6sG4C7wsEsgASH4h5+uIodX05kyqcFHM/xEjdnFbtsKLCmQj6ADn1y6cJQZw==","signatures":[{"sig":"MEYCIQDNfH96Kcp4qxOO9Wo780UNQIuo6AyPWzGki4mTHcOz+gIhAICCNfrwxNYK3KUCQltRr4mgBRhZj8teS2xNBZxP/Env","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivH3DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8Og/+LlwQGsZB4r7GfkmqxzlSnauUTDaWpramoBT6Bi4eaAS2B7FJ\r\n8iqGadXPr4/Q5YBjHeDlxRN3s6RO9rW3OkQQ1tYDFx9PjcoIw5CCt0r1Xht/\r\npFY5goIFruvyZNoW25C+7WjOxpq3BXVOdlSdfaaqK97+42GiArN0R1aDv54R\r\nrawHNBo8nJRRoU0JykABCEHzmpB+J3rBsSIPSg5/MKJ5FXRSihF16PZJqT0t\r\nCmtdqKI4Xt8H+eENvSa7dbL028cKJycObhpqytV/vQY7kGoH+5cJYF5S5MBP\r\nDBNYy3exyK5OrraRaGBE5Z40coMuMe92fTFvbGN9VP7jJRHK3veTpIJRBR/G\r\ndI3eRNoRArcTOm+cLyvhbN8bYNg25PQHI66hHe157nradiL928uyBBbeB1Pv\r\nShwqB84CsSl6VUKNla2w3tqE2P6cE6OFrSuLpBg/5viKifxT7SSBb2Ck5kAe\r\n+pMRhnVu7qO0lIRULxMOofbj63U/2b1pq6wpApNTcvt2VGjBCEIJLrrx4OTg\r\n+ZJrOwv5Dl4pED8QUIvPMcQJt6NY9PI3Zrie4SYiJaLZCnzcJ2q98DvqI0RZ\r\nhnUxSEG7czFr63ffkmX+dqKcKUuC2IzY+4vj/Z8HawFBBW6w0beo647sjeom\r\nK+BQNDx6hnlFrul3vV1k0R+kZnxIi8Tb09Q=\r\n=M9lP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-054eab0_1656520131735_0.43543918679888494","host":"s3://npm-registry-packages"}},"0.0.0-experimental-068f9a8":{"name":"@prunus/mixin","version":"0.0.0-experimental-068f9a8","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-068f9a8","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"4b3c8142a40bae7f18a656bbc8bb55a370bf1713","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-068f9a8.tgz","fileCount":54,"integrity":"sha512-rwrMCj1Gy/1Ke+KZkYQaN7rZteLIse7bIlTfXsCnd+bR7Y9VGujImQdMcohe5WFpDOMqMOz2228Ni/Nm9qlt2w==","signatures":[{"sig":"MEUCIQD5L1WJuPo6XTemkTAP4nY4EZQIj6zCYWk1v8JYRt2P7QIgGVMAem7z/wUIVtiDBot7e689TOVUPTHDw+oE2C5ZDcA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63403,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2vrCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3Xw//ecxScwflyYmB90R0DrXDlAQWgEMjznF3304qBhXEf8lK/ZHF\r\nty8nJIrqnY9T+go6rjSl8YyqBGNeeyz7dFDYMZDkz5zC/pR8nfuXbFwSKGCo\r\njSaCBCmxtI1EhXa3B2RG6xQRUXHLhOLoabjUBLgEBwY6v0hvHyEewrtGWhqC\r\nKftTtfmOWRgrSUY0OALWsiW4IJQ8eFhqEDubnZeSe7l5CkU35FA92039pIaa\r\nPfoar4OnYht8c2a1Juq/WN8EY8iYm9LIHcdzFM7om10qbQ8zc1ku8h6GUqfc\r\nnzBBDmM5TWX7gSs5iFkiMYeUGk4u4ymMbiRx4+2eRMxDyoZ05AAAGiv/CuaE\r\nXOeSLrIgIzq0Txzn18QQzL7m0hx8buYVcl8wIjb61FSBcYnT4uaD2xotbkVd\r\nQWgHAxD0vJXALVxxOZplrVXE5Bc5wmEGQNJtH2DK686Q8LgPe4nA4dgLieGV\r\n5wZ4xEw2EAMb/oH5tnq2XxKrmHurIZVE8uVZ2bClMEUUPWwfYEqCcNZmqZJ2\r\nUIlZ9jQEyy7ct7mrTSaqlaHEkgUtsj1jQY+Iy3yCcdLbrjdG8In1ZUYrD/+I\r\nxb7UaJ1zB0a2YXyKexOGdouQJ+S3eAyU2NEhVhch8nEpnm6TDh1RFzfs9rQr\r\nbjcug/2EmvJjqgsamL/STyl/WuT8SnjMtv4=\r\n=G9l4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.super.say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\ninterface Class extends Trait {\n  super: this\n}\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { mixin } from '@prunus/mixin'\n\nconst MixinClass = mixin(class Class {})(...traits)\n\nconst MixinFunction = mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"test":"jest","build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn test && yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-068f9a8_1658518210520_0.511317099728885","host":"s3://npm-registry-packages"}},"0.0.0-experimental-4f805f0":{"name":"@prunus/mixin","version":"0.0.0-experimental-4f805f0","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-4f805f0","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"0b4db5f2b56b752f25a4e78185a067a52ab10e3b","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-4f805f0.tgz","fileCount":16,"integrity":"sha512-X3cLtybjDtYJRXsUuxcSttDahH3UP3O8zAGe+Cj3gf+4zyzDkwUjAJgY1KgqkRC2g+uSB6ycckzIw5GSDEHnhQ==","signatures":[{"sig":"MEUCIQC4nXVMaz2x3ovL/29zOuYMzqpqhPXM2LC5pMcZiAKv5wIgIMOY5tRlEYd9XdZxSXvDIu/3rQySdvOJ4X2Bl7rXE08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLKvuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvuQ/8D5j1SQgKwDnmlwGv/QqQMP5slmxeQXw2kpwcQ6omrDrb7lTF\r\nVbj7fh1WwjHExQXyCJtA056pAzcmveMqlwMV0S/+Ds+gTzOuA2pIT0XQIUAy\r\nmLWAqQORhr00syPzWUD4Pi6OH7Eaw9IHasgOrLoOTYU4+ng45UJpxZhPPPAm\r\nml4ThVp61q8oje6olSmgM3JFx4SdxSblmDDCjhyhYEjBVgEzF3W5h2W80/t9\r\n3zWySYeDuJghsGTlqIJesK8E0DWVdRSTfDh1Vlm4K4Cq7QKLtUDrEyZ8eFDf\r\nmAgQHtvy4nirLhXp8vfKQ+/h+iDJZNUx0uhtuDrXj6+49mLGbooU9yxnmUY4\r\ntX3XX5BLnuemmSP+n+VvvEp+jEsXjPF45IH+9Kv3j8zPvhS7QX8darghUB7Q\r\nmabknXLMfogRgWCBlpwm1TJwTnU2ZuaogYX/Ez/5fcSktvfYgxyOLb2aRt6y\r\nXTd7ye0xqJEL2UuhqZZU2ehbyebIo3tg4DQxN1r8eS0DfU1Cd1YuXWCHfgk3\r\n6qcBBhxYa0n0ydPyshDhL963+UsmWEwcSkPoEbqlfaV7xgNXY8LhHz8M7JKl\r\nTifaohvN6+lxU+IFe2VfeyFtUQxNW2uhq8UZgLxmIzaFyLlN6ljUZ6rVFNMH\r\nUe+yolJnqYfZCfSOnU+hc0cqx/GODW+lTNs=\r\n=TBEA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin, Mixed } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\nclass Class extends Mixed(Trait) {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\n#or\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\ninterface Class extends Trait {\n  super: this\n}\n\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nconst MixinClass = Mixin(class Class {})(...traits)\n\nconst MixinFunction = Mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-4f805f0_1663871982392_0.6845664153953546","host":"s3://npm-registry-packages"}},"0.0.0-experimental-26799c7":{"name":"@prunus/mixin","version":"0.0.0-experimental-26799c7","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-26799c7","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"451511498035e2725779243aa2c5b733fec76ea3","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-26799c7.tgz","fileCount":16,"integrity":"sha512-p1xM2sYmlWvhfNMGNQ++qYhX4VF0kpTsdV9ZmXKicJuoFBgRDLvBF9WUPOS9BNfFCW7qZjIGOuQ0YWJK71IRxw==","signatures":[{"sig":"MEUCIQDAsKG0zTP3FxzVubKQg1ElpmR92EfWQNaifuvRgqWn9gIgOwIZgRHhdTlKQK9xUD3SIMUeBm5h3j/h7zCrvTrbxWs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLK6RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZnhAAjtyr7staPViTI7YpFOEixeeNDN7x997VqmdRu8QcxTpsQBoT\r\ntyKb4JjsQGjtW1KbNGmsM8fGBsBhfcEgqicHwTGJZcNr24CAPSo6a8IytxC3\r\nkKZ6Icl/TIZ1KqtrIOw+9biSshakYyyiPV/xTpo5f0nJijTNMNQqJnnKGFdo\r\nwqJ5VoBtTRi5TIhG/i/NIjonDMly7znVV7jCOAjPse0+uNzm06IB/QOb0a2L\r\njnP4ao34Y2D0B64M4AGm7ciiOFcuwv2aAn6ov4JUpLn1jpRgwVXLQ4CiR8eD\r\nWINuYgbY7X4PUrVl4l2ty0rqcHkmePBzCavcsk8h3sOi5GxQsyXu9uEuHT10\r\nsT8IDTVOp3K2bQb0mYf5o4TDw/x7y5H3iZz4ic5vvFh/wGW+rjHDtdY5As1n\r\nTj1bmBLlEx2AOBGWwoma3uKEKLTJ295XY8GuSg5s3IX/7y4kTWiTMr1MfsZw\r\nhw2Bx7xG5xnYuxKucyki9JzxyUt8MWDxI+EvUU6xKftbhtwp2Phx6FLsVpTx\r\ngPw1I2VgPL45G0kYQnFfb6n74Uqj+3wBPTtvG+c/141e3Na5cCG/pHK5fk67\r\nbNDoSZWORRgETeUymsGU/zh5uz6zMsvSqG9oND9vXMEYjKq3Ia370aNBekrE\r\nfwAu1FO2t8LUbDWgltLtzMM4SLgPNssWvFg=\r\n=yf7U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin, Mixed } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\nclass Class extends Mixed(Trait) {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\n#or\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\ninterface Class extends Trait {\n  super: this\n}\n\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nconst MixinClass = Mixin(class Class {})(...traits)\n\nconst MixinFunction = Mixin(function Class(this: Class) {\n  return this\n})(...traits)\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-26799c7_1663872657508_0.4873763897795065","host":"s3://npm-registry-packages"}},"0.0.0-experimental-82c1804":{"name":"@prunus/mixin","version":"0.0.0-experimental-82c1804","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-82c1804","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"81281c0c614950b6ccfc32ac0eced34443f7baf9","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-82c1804.tgz","fileCount":16,"integrity":"sha512-33s66xielkDGIPvnvSqFlhlZi7upL0rUlRBJ3qCspG209TlZZC3Ok+1yLvo8JTlcI8qRHZmncXtUhBTXqvHs+g==","signatures":[{"sig":"MEYCIQD7yFXRW/6o9gJX3Fjj3nHFv0/JMQM2XDk31Gf8ZeujiwIhALXm2SiudVeaRlZweZrPblHJNgzU1z133Uc8mvH8ZdBZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLLqJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJmg//Wstw5m6Ka9l0/jJGqXW4st5XhEWTQdK78ASuqzYirmvZg7NH\r\nPRmXi+vw45M42l9iHEwo4U+8upWaHDTFm7n3rK4nRg7U7JCywRpNEDRRhUks\r\nbR09bQXJHc2ahOV4yQEVG+dPzks//lstoISoCB9jbgZWGu1+/MXCMqrVdbsB\r\n08MCupcP1J2erj2bFQypTiY3GBPTsKKzb+MjWSVwukrwabNvvAZJbh1PZb3h\r\nBenympBW1vW67i0nmOEtdi8iotnnpbt43Dw09/KrP1MZ+gzJpi/r1sJkNRHa\r\ne3gD0fZ9+4ZkQDW+WTMHygCs7Fwd3hCIp7HMs9+DoMBN5P3pzQiLIOQ30Yg8\r\n51VUVSBq41zf+k4uPI/Io8jBXQn3h83D+rNQhc6KtRYubePkoUWhoriiwX4n\r\nUaorMScF9Osmv5jizmbhmVjgrZpbPHnBJZwL2krAQTqtoDkzvBYgdBX2ceQi\r\ne3J7AFeSlfEInKBq0XxJD3Yzd7364XWa2MbUHRR95wxxSFlqiEeXifCaPyNz\r\n8LDHipK6SivPDa3cEzbOJ/CAx/qY5dpasvZ1j7uYl7XJKpC2MC/te4qkAGqk\r\n20DK3krLNK5cvo3gkAbQ93KMNHJ61k2vbmjCDBhgNKksBgAPrMsYqMMMdeN6\r\nt+ni7bcmVRwc9h61ZtsojDL13B2b6cw2nss=\r\n=RC+J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin, Mixed } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\nclass Class extends Mixed(Trait) {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\n#or\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\ninterface Class extends Trait {\n  super: this\n}\n\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nconst MixinClass = Mixin(...traits)(class Class {})\n\nconst MixinFunction = Mixin(...traits)(function Class(this: Class) {\n  return this\n})\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-82c1804_1663875721763_0.6519557298537759","host":"s3://npm-registry-packages"}},"0.0.0-experimental-647051e":{"name":"@prunus/mixin","version":"0.0.0-experimental-647051e","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.0.0-experimental-647051e","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"14edd721d76b303ac9770d3d6ebf513cdcc72a2b","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-647051e.tgz","fileCount":16,"integrity":"sha512-0hRk+ch0E2HCAC2I5jcT7GrzDXELV9BYAFB2pfQFMgjpCbOBcLezi2L90oIEo48oApXALHLdIznNMWvIhub2VQ==","signatures":[{"sig":"MEUCIFQ46h9kUHTq2PY4DUdpT8MalK1zJV2BKK4Gdk4BKzuOAiEAlktLOZWM8vq0J8xxa0CPP99cidHs/hSapso3BSFlcDQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMViACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpySQ//eGTAKKruTWEma9BK+xeNMLK/fi4stIg7uDxH4gc7yxN5Y5Aw\r\nthBtGNDJC0Fu4823oG3zpG9DPaVFBcY1eOGtmHij0C/QAFEP60oDQyNTMuEu\r\nuFxvDmtPe8xStfxIsw84V5IIr5GUkqP9g2l69ozu8p9PYu18i8HTf6k0xYyq\r\nil0MC2i8wDbmlEZSN5Wc+LNQmUel58pniw8u1VSIYN9ss70wqcbTBcn5bit7\r\nFTNniAsRJJIGtOdBFhyKtyGKbz8wqu16NY3u0/6GDr7Qe6vtqRSf6L8Vhcv/\r\nCyoq3aMGySZSdx9A3aSJf0L/07TTg/SzKa/llRaFKgAtNvVX8k39gF3UjYiF\r\nKTt/ppXzfG5iapNZ1jZVVlUfk9DDKvTHvstC88bBTR4/EHYTngSggZAEi3+f\r\nmnzSsn/7lizfPeEGNnEWo0CGmZ5wugaY//rtvts4kGLGGAnjyTDGXKJDNReD\r\n5XntUWaBm0xFebJ0IzJW+oKCmj+IFu0K4TR4DgBP8QWpmXBnl8pjdyD+7u2E\r\nNTAVPblu6JEobMMh8ZyhiOxtYspI7uq7aJGdcZ/3S+0jZCl9ta36dXwjE8QF\r\nukaiy8FU03xZ2eVVj7KZSau80X3o1o4muVTB7vHjrfp6Us2KOyZYkpoHwGIJ\r\nWivjbvKp3B39c+7oLuPYCAK9/QfJ7AjLQEE=\r\n=Sq51\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { mixin, trait } from '@prunus/mixin'\n\nconst Trait1 = trait(function Trait1(this: Trait1) {\n  return this\n})()\n\ninterface Trait1 {}\n\nconst Trait2 = trait(class Trait2 {})()\n\ntype Trait2 = InstanceType<typeof Trait2>\n\nconst Test = mixin(function Test(this: Test) {\n  return this\n})(Trait1, Trait2)\n\ninterface Test extends Trait1, Trait2 {}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### **Trait dependencies**\nYou can declare that a trait needs a dependency, and without it, the mixin won't work.\n\n```ts\nimport { Trait, Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\n@Trait(Trait1, Trait2)\nclass Trait3 {}\ninterface Trait3 extends Trait1, Trait2 {}\n\n@Mixin(Trait3) // throw expection\nclass Class {}\n\ninterface Class extends Trait3 {}\n```\n\n### Super of super\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.super`.\n\n```ts\nimport { Mixin, Mixed } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\nclass Class extends Mixed(Trait) {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\n#or\n\n@Mixin(Trait)\nclass Class {\n  say() {\n    this.supers.for(Trait).say()\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\ninterface Class extends Trait {\n  super: this\n}\n\n```\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nconst MixinClass = Mixin(...traits)(class Class {})\n\nconst MixinFunction = Mixin(...traits)(function Class(this: Class) {\n  return this\n})\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n- Research on how to make `instanceof` work correctly when compared to a trait. Otherwise create functions for comparison in a sematic way.\n- A super smart that adapts when called within a trait with dependencies.\n- Smart methods that can be polymorphic depending on who calls them (mixins or traits).\n","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.0.0-experimental-647051e_1663878498584_0.9101481052408011","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@prunus/mixin","version":"0.1.0","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.0","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"ec1a424150f03ba252dac549d758e66e4a9ab8ec","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.0.tgz","fileCount":16,"integrity":"sha512-496jWUVd5mRXhpUH38iEa95peNWPX/8ig2goUUOprBYVI/Ijrpj8l899W37zIeLBhq5H22RiqtvFEzoivVxEzQ==","signatures":[{"sig":"MEYCIQCa0KqLJmd+buPD1JYzj5Lb/sLm1SObJ64eFYcK/S+/iwIhALg53o2fDqyD7iNHnUk2Vy7RnufrOQ71PNfcGedUOeZv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25391,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMZnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrG3BAAk/E0ypE5wUejfSEqKkndGLo6acyt0lckmhJLz4jYbIPlJFUL\r\nQXcmBzCMsTZEN3Xb4Ll1RIkUvdAH3VwSKMIPrUzB5kvkDvFYdob/rFYd9j56\r\nyBu4NLlXQYEsIEKRxQCnd+E/cs4mvxcB3BcJ5RdQXuVSjmluwY6cXnn+ztCx\r\nCzlmd4dAdkApjb+kj1sj+YitSIAi20GJMWbMXwCiSs0ogDAxttY3sTlJ3zBO\r\nJOuH1E/fGgxmr8klZH0StJBs6XFjbA6F33ob7m2j4GPH6VO1JbzEjon1mebO\r\nBdk60E1voo3o1gy1X68FnLX3rMBUdEMyxgTaTb2VeKmh9DdMEeN2fsscKqGT\r\nJ7ynDAR+M8nnadtaYQYBMVzTUfv/Q0x+DC75Keooj7n8PTrx5oDml4cdhiJV\r\nxCQWMQphFIhzNGQatm0cbzl/yuyWmwgqEsbujHrqZXEpLGMam6uZtjPHubr+\r\nNCn1CmVQwyImi/wPPip3TxG4yL3KVTVsozD8bdoUNsf1ilFxHjWA8lorRNIK\r\nWtcEavJLOYNoBHjyDnbw0AhadpbA4HOpiQ1d8bh0KPHBwvg40xP/9YgTyW9a\r\nNqVPHQSOOt5QsNsoeyMilbzR4Y98Sx8m9pVrsV+JVninJPps/GfJJD8KrQl7\r\nLorqxY8azuxF/CHHucij+Hfx5+DRXVzv2Xk=\r\n=50IH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.0_1663878759159_0.7827539504048668","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@prunus/mixin","version":"0.1.1","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.1","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"c1c164d1682d13f6812c04fdca93f72be04b66f9","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.1.tgz","fileCount":16,"integrity":"sha512-XmwN+gEKiWiS8Xxfk8QHYMueu8lBVggAJ6MM/xdOm7iYXS8tOy2aq6pa508lkJjlbbJISLiossyHzMrXL1+62w==","signatures":[{"sig":"MEYCIQDtzsT3lF7tC5pRHMg/I/WnzCgkz7WHQlWwlSFyBpZo/QIhAIP4AMUCn2ZSh3UdIr4fiTl7V8fOm8WdPmJwbrwooxsi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMnEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqphBAAjFu0iYQpJsMmlPkH4Mh2LEZDS0AXcEgE35JImXrDoSSwSlpE\r\nZFDB1pq4hNNfT9Lr2De+25JK0jYCxKeHCyennm8VpspLf2oNzkWf0e97rvsA\r\nFCeii0jp7Tb+k3UgfpR9k9m80l+M98TdW30xYEiYqHVmSrg5jqQOQavlIu6i\r\n9iU/tgzeUxEjGNgL3neyTiabz7dYGvcLjYcATOBYdgowXqZLXAf+1DNmO7l0\r\nmfP1UOvJ1p+jPWasNDv+HPa/3H4PVy4Url1qdhXeQ3fCG3muIR0yuN9sFq1C\r\n+ChELWVcqenzAMhzFRh8RkYNb3kejDZd+ngBBujtv+GmDmaya29FOgxWKZBw\r\nZbjHuoKlyltZWwiY93/UNYjXSA2zoOpAReJ0zyPafAIo+af3xGr5Di5Po8QS\r\nyMtSGQq1tcDnB+Ggzj5sNMBCscHonOb+rLOfXcnvZymvl9aZy4fypxvHH6HC\r\nbLvoKJ2lt1OeabKUxp37t8+FgJqjB14dbf8KqAh0JolH7Tz81gtqsumHtVKr\r\nUNCZjB/4V47IAQz0Jb3xA0wXbJv6e0ICxZfr+hlILGWWkG5mOJS85ZB1O5WF\r\nAsZF/GDMZjSsh/w/4m1ZrZT3E0o3erSoDKmzE+oR443/t5CDM7akwe0wnK/n\r\nzdbiKtMYaVVmhbDzKxHvWlsVyRMj0sPoamw=\r\n=vq2s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.1_1663879619980_0.12406242785906874","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@prunus/mixin","version":"0.1.2","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.2","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"acc12af381fd795cd2977b73a827f12537ddfe38","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.2.tgz","fileCount":16,"integrity":"sha512-NvDUCNUouufyh+Yzprzl+4ywueckvww1UXk5MWO95UrAhBsILJSF05AOJil5IdUU1uHQ8sqk2wVycePJmi5I6g==","signatures":[{"sig":"MEUCIBUvri7+2zqXz+xzOVZpIOcTd0Z45YXg+UVJIfhihtjXAiEA9ZLiwjC0IpphXoqDX7HAbjmbkNSxNb/1pohuES2MsQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMvOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMXg//QlGH6gi/8D/iJrA0MQpjQsg3mrfNCQ5nM/28xNzhuA4jec51\r\n8KI6gG7OEdT3So9w39H8Mtgpkyo/Y9X3vYJKug0s7Wbcmc2OaDkynmrMls9O\r\nWXYK+IhfPjQf9x9BrqHnifDmmJ0B+9CEhPwr6bF5R3v8jeQargjvmi6qvRdJ\r\n77V2sW+Bw0s7aejkRdRLPORM15eUHS0yMLFxn9xXZ4uctWV2+766GrDak6yI\r\nyzhDEYMMFiSIlRxh0PaW/fAhLcUkEy4AZQ7N5qVj+muv0u8SK+W1JL5CKGHj\r\n+r/w2PVZN84gMIDaUgO2cAX259g/W6RffZ+YIS215uEwotFHmEfJmweT2qTv\r\n7rsO/Z97Ah8GMbc8+IroCJeTVXJug5vCXpeHzniinFT7KcRHmbKpqOSGBXqg\r\nyq4EswZm1Gldwb9A5y4M95FABS7ZiWUE04wy0OZChTWReYCuaSKakZmyt7SU\r\nOvMK8FRoQnDcW/ulHZWeJh8UwlJZZA0uY/3jcpvvyS64nn0FeBxfr6QJnQOU\r\nmZ68vVvQ2PUViNAU7sRd2RhkJkreuIgwu+kB/ml4wx0OC1G0IvD4CkgtpWhQ\r\nNCgFJIVuKcswbLdZGGIbsP1EWMxaAFjo3Jf35FZD+D0zgwCbXStkOAjU1ruh\r\nKYoJJM8FK66ed31e89W30rcVsUughBNz3Ag=\r\n=ecHt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.2_1663880142457_0.7907991339065197","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@prunus/mixin","version":"0.1.3","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.3","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"a1f296d513b02d65fec8f7818d73e3d56e0114c5","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.3.tgz","fileCount":16,"integrity":"sha512-Ay15Ato76WRceX2D5pAFsV6HEkKCm8mJYzvYRyhEZP5qCiIsyABYVklq+laTXNYeIrb4/1SAeNO9OSUDFJCJHg==","signatures":[{"sig":"MEYCIQCbCGwpy46lqeRl4OyBuX4z4Nc+/2+EtXmKf531WBX2CQIhAJdFzve8LFeribgq36uyffjogsjgdBKZw7EkjcxNlD/1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMz/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtZw/9GDRuFyzIo7oO2CgEPw7Iz4g0y8ANbH1nrlEeWaQvCFSNyOt8\r\nJECk+Lw9g62c3gBxA8Z9WctQLEBxUsYAXeFPIDXAGclfAlY8kqq092FAouAz\r\nEQH40idGWWPPFly2TcB8SOtIj3QysLddQvdNmuhuiG+i6ivczCwjjc5JH++E\r\no/QbVJqDwJKD2LhehpGjZPTBLfpY1vgxnXRanHvtmSSY9NQHvdFVwCez+QlW\r\nR0bbU7htfLEZKr5tFB/iPGTRUmdh+DA+0uuO0np6YvTxT6UEy3zvMVNkRNKq\r\nDjAJgB06ekl7se5jAhzNXjX/vNYwwB9EDflC9PzEDrf7YaFPTYeUsJxlt2eT\r\nEVTlMF6cBydA5Kci/b79x6VuGNBbrDQHh9r8vttvk3g4lihmTal59t7tsOAa\r\ncWT4GPuaJt0BJs2DwfTr2qxSksgh5lYDrKyD7F5Fs6/S+2uoL7+mt1gjqcxl\r\nkHyEJNLjmhaOeltjAprZCv1wTfeLyJVvFCd14NQ3KcKIXGDZSFP3LCqUTsKY\r\nj8Su4flxhXMUM/6MwQmaVW4p6SY4PI90qE1NjyDGA420iy1g5VJZFqHaSchb\r\nAaRfq1nHGta7rTdCeq7s7vI9hJjlJZMV5g+id+FvnhB55iNl+yCuczKxc0B3\r\nulB6Ot+prVtX8J5SfKAIoA4xgtkpW9x7YlY=\r\n=W+8S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.3_1663880447666_0.9536096454821461","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@prunus/mixin","version":"0.1.4","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.4","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"22adcd9c5302c2709f4e23d2fe58652212300bc1","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.4.tgz","fileCount":16,"integrity":"sha512-hpHdQRwO7cQIsVlzeIqxKzn62T7COXthgK58Qv4YSR4riM6M2PEDfPMgy/gpaJRxy4T4hXc0bNkYTu4v/L1FGw==","signatures":[{"sig":"MEYCIQCp44h4AQH2Sr02OfnDp6ONKw3YtboL7a4XBXPyhGqZxwIhAKgEjccPTRLPPKq4jhLHSgcXZrF5A8hmRTLqgy3JN1DS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNJO8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprGw/+O/W981BAECdzRvfEqlIfIzB3jHoFVDuqR2kEODRVJ0UJGySe\r\nHsfK8jx1n7L43kDHURsqxZSd4fh72nO3WblAo9MRwNHJTsS6QL0kbl06hsSx\r\n3ragetVGvrU7VkBiInDjkNQ1cekFV+pSAKR/XkXv8m7QMsoG6gJ6tE3NryAD\r\nnfMeqLJyTjktGKvYYOL0ucIFacrOlUsv0CdOpI74GfYUBGnxerekx7MMfPP+\r\nEGUnAG1lWUw6pW8x54ZkzgN71U9ctB9uVsLoDQWaJifKz56L9TNTI74H3Bhy\r\nckBLFdpHRxixR8i3UkMnwZdIh93XBOHkLC9dEElDgw/yDqfoYjjaWN/CX8Jq\r\nWRAbPISMAdexh2Q3Sns3ohp0rUrM6o56G33PQMdYOt8rFmDIYYGMymfRuJDc\r\nHU2ZpE9M4n1/7mkvW7msalrdL9G+d5Gh/Sl/OZ7b2U0CTQX9qmfXLom0ZRy2\r\nJ4ss59Le7xiDEUe+POhHMksdhaTQuhgM2cOio6X9n0n6b28QuHgYA9FA9BWt\r\nS5v8fsjUugyK80ZHzBfFsC5YXXFKs5Kh6M4rpaISYk0ZK8fssqbExVkxIUFf\r\n72VZhHrnX/8KSQ6sJR+uwxWh8RCA5pzh18pJw1CbfuLBGl9RWxxblNpA2nLJ\r\nUT48ohRi79LtPYvwsve2kTfn9FCnW+ajlTE=\r\n=MrwH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.4_1681167292298_0.41809498077656193","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@prunus/mixin","version":"0.1.5","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.5","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"4a04eda9ec3a3fb8809a7dd8fd3b8f101eb2a767","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.5.tgz","fileCount":16,"integrity":"sha512-88D4wZ52Su3YGrCntbMqK4QMkARgxqB/YkHBRSeMMfWME/3DatDgGPiGFd08tWvemvBE8O+ThozRry+RswzonA==","signatures":[{"sig":"MEQCIENMgJyxG+uT5fD/mvcPvInzljsOgrNUOt80NVqOuV0lAiAJHvOYHoY3kmJTIwS5igeSXoQU2+UFLn/ezNFKHKF70A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21298},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^4.6.3","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.5_1717260761892_0.19192905517395364","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"@prunus/mixin","version":"0.1.6","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.6","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"8c715a84053e040bd2d3cce864448bdb297f3896","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.6.tgz","fileCount":22,"integrity":"sha512-hXQNXQnLqJPQlZg5bhM5wFtccJi9GnTB7mkVGtc3lHY3tM38AMJvhMeZYZsKLtRwQFEvmMVwPQK/E7FP3/5KKA==","signatures":[{"sig":"MEUCIESztgVP86qwG0yXOhnL0GPFAfubPxcpLKNT22SoXf6aAiEA5PjYTlG1LAIKurxGg1QGfYVu82Dnb/Q5ltACT7C6/Ok=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22480},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^5.4.5","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.6_1717270033328_0.6150531383699775","host":"s3://npm-registry-packages"}},"0.1.7":{"name":"@prunus/mixin","version":"0.1.7","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.7","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"0c0ef9e0a1a30168eb53e3d84dd986301fc4fe4e","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.7.tgz","fileCount":22,"integrity":"sha512-wL2NHslrjBVasoEhiOvuTFPqJNX+ubabc2ch1DKSfFpyNPK0J12Fq3/keIRBv0vYBqrXIfz/5zKeh6kz44cG6Q==","signatures":[{"sig":"MEQCIFvf7v4vihfJqXa4JHXvCngimb+lmYCg9uDrlesiNcSiAiBGtxr8PlymXHKGO9A81OQpYEuRW0wvdTEnD2Oc7cvTvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22540},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^5.4.5","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.7_1717270516176_0.7096047076240926","host":"s3://npm-registry-packages"}},"0.1.8":{"name":"@prunus/mixin","version":"0.1.8","author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","_id":"@prunus/mixin@0.1.8","maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"dist":{"shasum":"b42dde305ff580c7979f4d80cd0ef556bce480db","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.1.8.tgz","fileCount":22,"integrity":"sha512-d/3Sct5I7GU5Uf8TudFiaQtuikfrLqdya5FkQg8wahvTnmwq9H/pKMywfRitKf9V74gpszIFveRw3IiyLe467w==","signatures":[{"sig":"MEYCIQDWhMmbY7g1wMZ5HgdI+vB0SHj1wzGwIWBf8+gEiP75uwIhAKrUtIEpVHRKbZgU+JJ62M0tTpmCbF21gbropwx5QIZc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22558},"main":"dist/index.js","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"yarn build"},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"repository":{"url":"https://github.com/prunus/mixin.git","type":"git"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","directories":{},"licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1","ts-jest":"^27.1.4","typescript":"^5.4.5","@types/jest":"^27.4.1","ts-node-dev":"^1.1.8"},"_npmOperationalInternal":{"tmp":"tmp/mixin_0.1.8_1718390795823_0.9004841625135283","host":"s3://npm-registry-packages"}},"0.0.0-experimental-0e11f82":{"name":"@prunus/mixin","version":"0.0.0-experimental-0e11f82","type":"module","repository":{"type":"git","url":"https://github.com/prunus/mixin.git"},"author":{"name":"Tony","email":"tony.js@zoho.eu"},"license":"MIT","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","exports":{"types":"./dist/esm/index.d.ts","require":"./dist/cjs/index.js","import":"./dist/esm/index.js"},"scripts":{"build:esm:package.json":"node -e \"require('fs').writeFileSync('./dist/esm/package.json', '{\\\"type\\\": \\\"module\\\"}')\"","build:cjs:package.json":"node -e \"require('fs').writeFileSync('./dist/cjs/package.json', '{\\\"type\\\": \\\"commonjs\\\"}')\"","build:esm:tsc":"npx tsc -p tsconfig.build.json --module nodenext --outDir ./dist/esm --declaration","build:cjs:tsc":"npx tsc -p tsconfig.build.json --module commonjs --outDir ./dist/cjs","build:esm":"yarn build:esm:tsc && yarn build:esm:package.json","build:cjs":"yarn build:cjs:tsc && yarn build:cjs:package.json","build":"yarn run build:esm && yarn run build:cjs","prepublishOnly":"yarn build"},"devDependencies":{"@types/jest":"^27.4.1","jest":"^27.5.1","ts-jest":"^27.1.4","ts-node-dev":"^1.1.8","typescript":"^5.4.5"},"description":"![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge) ![GitHub Workflow Status](https://img.shields.io/github/workflo","licenseText":"Copyright 2022 @tony-tsx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@prunus/mixin@0.0.0-experimental-0e11f82","dist":{"shasum":"f2839769292a2670d27bae3690e296c52d290966","integrity":"sha512-2VNJwBaLIpYQUHgE61hPhNqZojlfk1m4+kXdVr2QNHHI5cNuIA4URIxIFTo8XNPsuPyvkS3DPBNejW3U2MXQ1w==","tarball":"https://registry.npmjs.org/@prunus/mixin/-/mixin-0.0.0-experimental-0e11f82.tgz","fileCount":51,"unpackedSize":49481,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKrAuXFpVcfPVe/Uga2eIccsLNA4elUQrhNpvGyZOcXAiAQt9BVkl/J5lO5YxUgUTfrHzUr7hnLCdhJIuY4k6pTnw=="}]},"_npmUser":{"name":"tony-tsx","email":"tony.js@zoho.eu"},"directories":{},"maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mixin_0.0.0-experimental-0e11f82_1720451989499_0.6010341565506587"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-08T20:02:54.384Z","modified":"2024-07-08T15:19:49.827Z","0.0.0-experimental-25d94ca":"2022-04-08T20:02:54.602Z","0.0.0-alpha.0":"2022-04-08T20:06:33.454Z","0.0.0":"2022-04-08T20:08:38.963Z","0.0.1":"2022-04-08T21:04:40.604Z","0.0.3":"2022-04-12T20:50:01.837Z","0.0.4":"2022-04-12T21:59:59.219Z","0.0.5":"2022-04-12T22:03:13.955Z","0.0.6":"2022-04-18T16:04:15.328Z","0.0.7":"2022-05-02T21:44:41.914Z","0.0.8":"2022-05-19T15:05:18.277Z","0.0.9":"2022-05-19T15:15:35.680Z","0.0.0-experimental-6376996":"2022-05-30T20:37:40.108Z","0.0.0-experimental-5d6f5a7":"2022-05-31T16:00:04.818Z","0.0.0-experimental-6fbfc86":"2022-06-01T17:42:38.493Z","0.0.0-experimental-df512e2":"2022-06-29T15:50:55.250Z","0.0.0-experimental-054eab0":"2022-06-29T16:28:51.902Z","0.0.0-experimental-068f9a8":"2022-07-22T19:30:10.769Z","0.0.0-experimental-4f805f0":"2022-09-22T18:39:42.558Z","0.0.0-experimental-26799c7":"2022-09-22T18:50:57.666Z","0.0.0-experimental-82c1804":"2022-09-22T19:42:01.929Z","0.0.0-experimental-647051e":"2022-09-22T20:28:18.704Z","0.1.0":"2022-09-22T20:32:39.303Z","0.1.1":"2022-09-22T20:47:00.144Z","0.1.2":"2022-09-22T20:55:42.646Z","0.1.3":"2022-09-22T21:00:47.800Z","0.1.4":"2023-04-10T22:54:52.460Z","0.1.5":"2024-06-01T16:52:42.038Z","0.1.6":"2024-06-01T19:27:13.472Z","0.1.7":"2024-06-01T19:35:16.330Z","0.1.8":"2024-06-14T18:46:36.026Z","0.0.0-experimental-0e11f82":"2024-07-08T15:19:49.650Z"},"maintainers":[{"name":"tony-tsx","email":"tony.js@zoho.eu"}],"author":{"name":"Tony","email":"tony.js@zoho.eu"},"repository":{"type":"git","url":"https://github.com/prunus/mixin.git"},"license":"MIT","readme":"# Mixin\n\n![GitHub package.json version](https://img.shields.io/github/package-json/v/prunus/mixin?style=for-the-badge)\n![GitHub](https://img.shields.io/github/license/prunus/mixin?style=for-the-badge)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/prunus/mixin/CI?label=CI&style=for-the-badge)\n\nMixin is a lib that, as its name says, creates our beloved traits, helping to improve the syntax of our class.\n\n## Installation\n\n```sh\nnpm install @prunus/mixin\n```\n\nor\n\n```sh\nyarn add @prunus/mixin\n```\n\n---\n\n## Usage\n\n### **The best way:**\n\nThis is the purpose of this lib, to give readability to your code in a clean way and with little code. This, along with the __typescript [mixin](https://www.typescriptlang.org/docs/handbook/mixins.html) feature__, makes it even more exciting as they complement each other extremely well.\n\n```ts\nimport { Mixed } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\nclass Class extends Mixed(Trait1, Trait2) {}\n```\n\nOr\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\nclass Trait2 {}\n\n@Mixin(Trait1, Trait2)\nclass Class {}\n\ninterface Class extends Trait1, Trait2 {}\n```\n\nTest! Write some properties of your traits and your class and watch the magic happen.\n\n### **The not so good way:**\n\nWe certainly do not encourage you to do this, but it is a feature that could not be left out, due to some specific needs that the developer may have.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\nclass TestClass {}\n\nconst Test: TestConstructor = Mixin(Trait1, Trait2)(TestClass)\n\ninterface TestClass extends Trait1, Trait2 {}\ninterface TestConstructor {\n  new (): TestClass\n}\n```\n\nAs you can see in this way, we lose readability, it can make the code confusing depending on how complex our trait or class code is, even separating it into files... But it works, so your imagination is the limit.\n\n### Supers\n\nWe haven't forgotten about the overlay, and we never will, that's why we remember our super. Unfortunately we can't fight js for the position of `super` inside the class, but it is a property of our `this.supers`.\n\n```ts\nimport { Mixed } from '@prunus/mixin'\n\nclass Trait {\n  say() {\n    console.log('Hello world i\\'am a trait')\n  }\n}\n\nclass Class extends Mixed(Trait) {\n  say() {\n    this.supers.for(Trait).say()\n    # or\n    this.supers.forEach(that => that.say())\n\n    console.log('Hello world i\\'am a mixin')\n  }\n}\n\n```\n\n---\n\n### All instanceof instructions working correctly\n\nIn your code you can check if that instance of your dear mix is an instance of some other class within the mix. Example:\n\n```ts\nimport { Mixed } from '@prunus/mixin'\n\nclass Trait1 {}\n\nclass Trait2 {}\n\nclass Trait3 {}\n\nclass Trait4 extends Mixed(Trai1, Trait3)\n\nclass Test extends Mixed(Trait1, Trait2) {}\n\nconsole.log(new Test() instanceof Trait1) // true\nconsole.log(new Test() instanceof Trait2) // true\nconsole.log(new Test() instanceof Trait3) // false\nconsole.log(new Test() instanceof Trait4) // false\nconsole.log(new Trait4() instanceof Trait3) // true\nconsole.log(new Trait4() instanceof Trait1) // false\nconsole.log(new Trait4() instanceof Trait2) // false\nconsole.log(new Trait4() instanceof Test) // false\n```\n\n---\n\n## Limitations\n\nWell... the limitations of this solution are quite interesting, starting with that... they don't work with the class syntax. Cough! Cough!\n\n### Why?\n\nSimple, try executing the code below and you will understand that it will be impossible to call only the constructor of a class as if it were just a function with context.\n\n```js\nclass Test {}\n\nconst mixinContext = {}\n\nTest.call(mixinContext)\n\n// Uncaught TypeError: Class constructor Test cannot be invoked without 'new'\n```\n\nFor that reason in the end inside the mixin the class you passed to it needs to be a function, no matter how you do it, typescript, babel, a fifth dimensional cat... It needs to be a function or nothing will work.\n\n### Wait, trait with constructor?\n\nYeah, yeah, weird right? But it is necessary... simply because a trait can have properties that are initialized the moment the instance is created. As JavaScript doesn't support this, we unfortunately need to do all this torture with our class, turn it into a function.\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nclass Trait {\n  protected property = true\n}\n\n@Mixin(Trait)\nclass Class {}\n\ninterface Class extends Trait {}\n```\n\nIf we didn't convert our trait into a function, we wouldn't be able to initialize this property, because it won't be defined in the prototype, only when the instance is created.\n\n### But let's not be discouraged, we just need to write our classes as functions.\n\nJust kidding, we don't need to do this anymore right? right...?\n\n### **TypeScript**\nIf you use typescript it's simple, let's tax some of our features for that.\n\n```jsonc\n{\n  \"compilerOptions\": {\n    // ...\n    \"target\": \"ES5\",\n    // ...\n    \"experimentalDecorators\": true,\n    // ...\n  },\n}\n```\n\nIf you don't want to use our beautiful decorator, you can disable `experimentalDecorators`. But remember we won't be able to assemble your class pointer at runtime without decorators. So your syntax will have to be something like this:\n\n```ts\nimport { Mixin } from '@prunus/mixin'\n\nconst MixinClass = Mixin(...traits)(class Class {})\n\nconst MixinFunction = Mixin(...traits)(function Class(this: Class) {\n  return this\n})\n```\n\n### **Babel**\n\nWell this one is very simple, add the babel plugin that turns classes into functions [`@babel/plugin-transform-classes`](https://babeljs.io/docs/en/babel-plugin-transform-classes).\n\nIn that case you can also configure the babel decorator plugin, we recommend that you don't get a headache looking at your mixin code [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/babel-plugin-proposal-decorators).\n\n## What's to come\n\n- Documentation and examples of integration with libs like typeorm\n","readmeFilename":"README.md"}