{"_id":"meta-types","_rev":"5-5c325f4547d673058966a032a1a619f4","name":"meta-types","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"meta-types","version":"1.0.0","description":"TypeScript meta functions for (especially variadic) meta programming","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/meta-types/issues"},"homepage":"https://github.com/grantila/meta-types#readme","types":"./index.d.ts","directories":{},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","cz":"git-cz"},"pre-commit":[],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"keywords":["type","types","generic","typescript","meta","variadic"],"devDependencies":{"cz-conventional-changelog":"^3.1.0","pre-commit":"^1.2.2","rimraf":"^3.0.2","typescript":"4.2.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"b4886e3be05aa6cb8bd759bc3d4cc6702a7184ef","_id":"meta-types@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-V/uQORgDsUgznOv/hj+lHWgd+4/0z+tbBOse9IRLElP/B3/z97fpCuc946nPzg17Qv//AeZYWFxssY80Xox7mA==","shasum":"76117de82ebff1431752fe2bd707b92cf8563653","tarball":"https://registry.npmjs.org/meta-types/-/meta-types-1.0.0.tgz","fileCount":27,"unpackedSize":62292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUoOiCRA9TVsSAnZWagAAr68QAJS80gNzC7/0YYIbCj+3\nNBGAW1F/kwjwYATetsnjs68Ht1JThaBj3svSSFNKqnxFAZW1wdaSX33mNmKj\nTW9np3NTS9uFRy6OtJbNYnGa1BfAp+7eWTR6IAlZMPs/eqxpHF1y7wQLBATn\nIymMH0yBVBGrJBbyeTKkBQTfBMFhT/ehiE5a2HU6J9QYHWdeZZrjY4DbqK0h\nGjSDfOFHDr8VJK9yHrvekK1Gmlu2y6f9ZFi94tIrCpePjHlpBrGBYsJ6ltO9\nOjWWtFC40Kk/qOUqjoRCSS3qMf3tXQyZYcp1gkyHPtuN8i1+XDdtyqY03Mbm\nPa++byn01fHcL7pWmbib/Jo8SLhuuFqI6UVzW1P38zQScSRLaUeN4d9X+LLA\n+XqWq/X0ZD+Zu/2iyJlr861u+u2NX0Ygt8vwclY7jfMlTWBiwM2okII7tiUR\n4OS0YfGD/VOAMhf/j2p/Mj6p3CCL2sqqJIogehtW1h3o8UmsLAnjlGRSMOoF\nu3IRgQN7tv3KTrjHAhxQi+p1AC31IWZAu8VoHwiVVz32P+Vm5lj01oDVAMxw\nZYuiA17zeKpev72PIdMAlVkXbrE8IB0x3oFV94v03peCthPfc94aOMhtpa6h\nDzCwFOWHW9Lb179bweqV/4YZ08tmPvvNOOejjryUctAvGaK/ojVsGRHcTWsm\ni5MW\r\n=Mn4O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbtHmTdDJjIDKBCoj6XRWkdqrhr/BsRvPXMtRKgxSkoAiEApKlQwj7FdeyuMjREDlNrpcHEKbDSdT3AQ73HHO+zXAE="}]},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meta-types_1.0.0_1616020386422_0.5000929938999499"},"_hasShrinkwrap":false},"1.0.1":{"name":"meta-types","version":"1.0.1","description":"TypeScript meta functions for (especially variadic) meta programming","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/meta-types/issues"},"homepage":"https://github.com/grantila/meta-types#readme","types":"./index.d.ts","directories":{},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","cz":"git-cz"},"pre-commit":["build"],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"keywords":["type","types","generic","typescript","meta","variadic"],"devDependencies":{"cz-conventional-changelog":"^3.1.0","pre-commit":"^1.2.2","rimraf":"^3.0.2","typescript":"4.2.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"88a7895db1eab7510ad25494a23ada42b26f6753","_id":"meta-types@1.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-WpzWvIQWZTPuEKGJlK0NrOxVzWFBXRD8Jy+bWPuZX5QchpYfRTtpuBePtoo5dmjG2XwFCNWdp2428YuznC5mrw==","shasum":"2b34918c19c4c42db0df20037650c7a075f84067","tarball":"https://registry.npmjs.org/meta-types/-/meta-types-1.0.1.tgz","fileCount":27,"unpackedSize":62301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUoYLCRA9TVsSAnZWagAA0JUP/2DycUJpVjTFWMyEhBsu\nfy1NJDoipzUYLgo3XZRPICvySY1YfwqN+bCQUDaTiZojWE//MsnjZZlDE+tF\nqyPEBHTB3Hs4jGRC15+EGpq1NBFofPCtWiTt7SCetcdtVuhJaWAJfOBpP9PQ\nEiuhj4h8ZT3AEZs9a010p5DS67C149NAGGZBWahpcGqLuxTKRpmq+nRLoBmC\noV6dBoevUM1sFxFFELzeTgPL90UhxDUqTm7MVoMgbhkhLb5iDUsFWDpcFYHn\nr8kI3GQP4Ldyv6YR3ruz4N+MVVX/HETWkxl7hyRvPMNMVlXFWguohj9/mPJo\nmWOD2BYF1D8MyQHCQHmX3/dfuJbjtc/gHlGHtqno2cPZ4tUnNq2RmDrsmAmZ\nHCUZx381oeKZmB48Is5tnYwQqfpMp8y67u6qW8OQVDUEplbLcmHbNte2juc7\n1xZqgkg8oCTODc+ToocBRm9lA1LpKuVoIks7EqtBbaK5FuacFcYJ/T/2hFyR\nOc55ib7WKE+N/nC4d8wvKQ4YWJI1+fTFqpK26R+RCe5mHRVpwVveVzb1O9ap\n7rNCGUlijS8W9MoA97eFMTEg6eQDibCFJq0fN/8XirlL9e7vPJLXXApkjIoE\ntxH1qe9cVWwdmS4/5RzZac3aDFCGkOyAm+OM/4ZFNBJ99ljpGNh51Arec49B\nsrdl\r\n=dVq0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCh9wjekywVjP0Oa9RsGqGbjWlQEWC5cFWf/ptW+2E4sgIgZrekBrg+qhJFlzZP6FqYyYs8dE1OGvYbkXxFrtFC8so="}]},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meta-types_1.0.1_1616021003029_0.280564515446742"},"_hasShrinkwrap":false},"1.1.0":{"name":"meta-types","version":"1.1.0","description":"TypeScript meta functions for (especially variadic) meta programming","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/meta-types/issues"},"homepage":"https://github.com/grantila/meta-types#readme","types":"./index.d.ts","directories":{},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","cz":"git-cz"},"pre-commit":["build"],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"keywords":["type","types","generic","typescript","meta","variadic"],"devDependencies":{"cz-conventional-changelog":"^3.1.0","pre-commit":"^1.2.2","rimraf":"^3.0.2","typescript":"4.2.3"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"c5aa6f930f75b2137a8ffaadce2e1b31ef69e362","_id":"meta-types@1.1.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-XQ+biy4q3XZtECpZVvbF7kjy57i8KmQ3+/HK3/MoiXvVj6SN513BgssYHVBzRKZ9nsAtzt4S8s0Vhn9IiNJ1tA==","shasum":"15810fe8da0544465ebc9fd48610309816289e91","tarball":"https://registry.npmjs.org/meta-types/-/meta-types-1.1.0.tgz","fileCount":29,"unpackedSize":64026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVjriCRA9TVsSAnZWagAAU3cP/jg9qrJRUvQvHnpkumTB\nC+nohsOytCF3l0+6p9nvfrJZCEgd9N4mAbm865uHdHUlMpY1YWAEf+FF2frO\nQJ/9yPtHb5yfpK//onWyOkRQSFUB6k+GNDLYnwl3K6z1dIhzzkoFHARcPOMk\nlPg6Lk/bmQ0DX+PAcdpBVowMuL4RHNaY+dMiS/UXDhIlx5CP6ZUVrJ4fK9vv\nH8bSKBKkG0oo1QcPMK1PbLaFlyBnP/cM7+Ds+8tSGQrX2xAvgI7RwpGYF3Fd\nWGrIGsSuZZdNr2Zq8V3rlx7ESOgBfMONFohIf47DVC5CIq3qkiqKcck8PFR7\nRxLKlYPc0ksa0R3C4Xgf3ZNtuDyK5Vk+2tl0FEWfjGVnD5DivcmbkFEz48cr\nRudW4qVWpPo+8qDj1ZVgGXlHxYpUOpASzfpDdpymdoGfCswUpRJkCRMdeImo\nXWDln2jQ0NGXVFg11Eo+IYOv90W7/3z4K8Nmo9LelS4V4Py+FaBfVny/1R24\nAy6I61U1heBnj1YhB6Jjx3BvGZUC9FIegI4aWCTYOZQ5VcMv/SmlqCAg/N8W\nHEHg/FQ+77ZqDEmBFUj0QAereCc1xb9mcPvYV/oS9w2f3tYcVvNfoG6hY3YA\nNNhcM0oLm4Mu8xKnCAMSFzZhfE/SGl8nmmjKhjugFF5bB/2/YWNtJKjttWpt\nD6XS\r\n=2p66\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdPYdQpEa1dIGxI1nm5l0vt7NhziT5njgBwcMMHG2u+AIgcOwAvxelLC5YjRwUGP3E1Pj57vJOsdHAzjoBpwqpjKc="}]},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meta-types_1.1.0_1616263906364_0.40892323805122666"},"_hasShrinkwrap":false},"1.1.1":{"name":"meta-types","version":"1.1.1","description":"TypeScript meta functions for (especially variadic) meta programming","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/meta-types/issues"},"homepage":"https://github.com/grantila/meta-types#readme","types":"./index.d.ts","directories":{},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","dtslint":"dtslint tests","test":"yarn dtslint","cz":"git-cz"},"pre-commit":["build"],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"keywords":["type","types","generic","typescript","meta","variadic"],"devDependencies":{"cz-conventional-changelog":"^3.1.0","dtslint":"^4.0.9","pre-commit":"^1.2.2","rimraf":"^3.0.2","typescript":"^4.2.4"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"0483d1b0310ccda8a4ef51d2f39f0b0619b2c890","_id":"meta-types@1.1.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4fA3XbU0PbBD5dRJhUl46ry9F6DNyGuSsXVq/YEToJCvBxLMsFSmvly9WEBdAqtnbuQXedvdLA9KD8uI05MGZQ==","shasum":"802e24b7f3cc496f6171244cdc7566b6970b85fb","tarball":"https://registry.npmjs.org/meta-types/-/meta-types-1.1.1.tgz","fileCount":29,"unpackedSize":63212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrJKFCRA9TVsSAnZWagAA4f8P/0EKGi/ILWEyxEodK/eQ\nHzzlimR8/vgqyRszlm3ADghaz8PqDtLGhGefiHLVuqbyw4xvoy/GLf0MtyQH\n3HchZYewimKhKGKmvRojRdVX7lMfaYXgdQ/vilpdzAO9oOV8g04T9FvzCXuY\npil80Irl+vxwfvjZXH7Isn90a3mFJToq9Cp+ZMw9ZkdRpFPYOSuyatpvRkGE\n9P248HOqxakPHnDhLmtYwuFCAnzea6BUIdK5Bb/c7UxTWAlLvu8ykl28dH6E\nbX4U+SAiZA4Hfr3+qWme3XjTkSSpoEKnhVAPOOn1wurRrnFxDHIgaMSDz7QQ\npbpZyH03sMClvj95a7g027Eqir3fstEIfQktkEoHoN4HfMrsyzCztYFjVdie\nf2LV5oRz6BlJN1+LseIjI3PZ8dsb8nWHtiTXMCayPSDyOn/FY5PYoomaKj3n\nighj1ptQ+UgBnh8d+itsVN8hG8/Xti3V+glNtLCbtP6eqK36RS8Fy7qy7oWJ\nbrYIhk1g85gTrdzEuIzkw23E5xc/EBp2RMPBPnpQrw/TFYOZD6qLGz4NVkLm\n2D3ui6AzCJWv990+/7G4kVkevpmO2esFm/CsLvd3cYzXKUWdnACuU6ZHibsa\nD+whMuZJXi7BRC38udmWhG/MkpRRnY8ar4/JicYL9mbC1f+WCPrdCntZ4UAk\ntpt9\r\n=sHr/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2rrJ5eQaFsS4Nfu7MRfE8Q8+75B0JwCvyrQD0STBvXAiEAqzQPbd5mak+95qlzRMAWkPizrlhtUrVlgTWU9V+qTIw="}]},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meta-types_1.1.1_1621922437102_0.8792993297052212"},"_hasShrinkwrap":false},"2.0.0":{"name":"meta-types","version":"2.0.0","description":"TypeScript meta functions for (especially variadic) meta programming","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/meta-types/issues"},"homepage":"https://github.com/grantila/meta-types#readme","types":"./index.d.ts","directories":{},"engines":{"node":">=14"},"scripts":{"build":"rimraf dist && tsc -p tsconfig.prod.json","dtslint":"dtslint tests","test":"yarn dtslint","cz":"git-cz"},"pre-commit":["build"],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"keywords":["type","types","generic","typescript","meta","variadic"],"devDependencies":{"cz-conventional-changelog":"^3.3.0","dtslint":"^4.2.1","pre-commit":"^1.2.2","rimraf":"^4.1.2","typescript":"^4.9.5"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"packageManager":"yarn@3.2.4","gitHead":"845a85987aa7f8d38c14349896f9bfc8c2cf705f","_id":"meta-types@2.0.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-I/UKzOsGtZuMuUPo17+J7dthEDWLorxnOvD5z6I0fgdDm2bJbo6VmMu+WVppOV3uog78iKjyenlRUMywgd3TPA==","shasum":"50e9413efa53b5b1f6873d36813939caa5501a05","tarball":"https://registry.npmjs.org/meta-types/-/meta-types-2.0.0.tgz","fileCount":29,"unpackedSize":151418,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBMubEDVlE2Bedv1aq1UNQMlUGe/ML9vlH8qslYxqoRAiBoQIOd33phAOSUlS5gjbrEY/bfjkW/3GojUJAPQz+H2w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj3pQ5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDJhAAgGRs9KeXHXglcSdcJu6UCdBFwZk12YJHaeSCvlf+OaPel7Zx\r\ncGW0To/hkZsntpHNofiWg6FuR74l/lMfHxXCJ77Hy4eh+5jaLCDJVIEKBlSt\r\n0nJDlK2LTgd9kJ+Oib/DTWaYoq9VYhxGtr0wrJ04xULZGd4GsrfUmIh2VhJh\r\n4ooODshF3ddejD2s44ZfQVek9jpZUrIQ0IIqoW+jItrpIIGX5oAPuP30SMxz\r\nBz/B8VNHKVPen3GP0Tltv3qCjAqb2MeaJa9Rs3ccWeAuSisdlBXv82oJMASv\r\nOYkXR6d+8BGECuCaCLnbpPX5005ency8LapcQn8uGVKWFA/ulC4lavwMQbL1\r\nwiFYUw13exTdaAKae4ZIUEMIJjtx86vh7S87uIsb8NeCP/CxDnWzHyzW4oEz\r\nXq4KjlILV3kCjyfEEgxi1WG7HoSQwLalAvVY0AXU6Ea1VgEwcMdhgXzZcqhi\r\nVs/ZWnRJHHQdZ7SWv0GsimEtT5GM0zERsNkaecWnfX9g+33HhslpHWU+iZZ+\r\nbSUNVsM3mAky/XqFT2UuHFMhjtenUpDz4/g298+nEnaR/V4bLIMV5tsz5Hz3\r\nDglBc96qJ8Prs5j/OBXhKDDJL2gLSAXLjW1t7tx6n/9zKzzN6irze/KtYoaw\r\n2BL329VnbaG4C4STYP1p1mUSed27x+lPG/A=\r\n=89s/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"grantila","email":"g.rantila@gmail.com"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/meta-types_2.0.0_1675531321206_0.8183812399154662"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-17T22:33:06.422Z","1.0.0":"2021-03-17T22:33:06.581Z","modified":"2023-02-04T17:22:01.446Z","1.0.1":"2021-03-17T22:43:23.208Z","1.1.0":"2021-03-20T18:11:46.506Z","1.1.1":"2021-05-25T06:00:37.290Z","2.0.0":"2023-02-04T17:22:01.363Z"},"maintainers":[{"name":"grantila","email":"g.rantila@gmail.com"}],"description":"TypeScript meta functions for (especially variadic) meta programming","homepage":"https://github.com/grantila/meta-types#readme","keywords":["type","types","generic","typescript","meta","variadic"],"repository":{"type":"git","url":"git+https://github.com/grantila/meta-types.git"},"author":{"name":"Gustaf Räntilä"},"bugs":{"url":"https://github.com/grantila/meta-types/issues"},"license":"MIT","readme":"[![npm version][npm-image]][npm-url]\n[![downloads][downloads-image]][npm-url]\n\n<img src=\"https://raw.githubusercontent.com/grantila/meta-types/master/assets/logo.svg\" width=\"100%\" />\n\n# API\n\n## Contents\n\n - [Arithmetics](#arithmetics)\n   - [`Add<N1, N2>` adding numbers](#add)\n   - [`Sub<N1, N2>` subtracting numbers](#sub)\n   - [`Mul<N1, N2>` multiplying numbers](#mul)\n - [Conditionals and comparisons](#conditionals-and-comparisons)\n   - [`If<If, Then, Else>` Conditionals](#conditional)\n   - [`Extends<T, E>` Type extends](#extends)\n   - [`GreaterThan<N1, N2>` greater-than comparison](#greaterthan)\n   - [`Is< T, U >` compare equal types](#is)\n   - [`IsFalsy< T >` is type falsy](#isfalsy)\n - [Logics](#logics)\n   - [`And<B1, B2>`, `Or<B1, B2>`, `Xor<B1, B2>` Logic (and, or, xor)](#logic-and-or-xor)\n   - [`Not<B>` logic invert](#not)\n - [Tuples](#tuples)\n   - [`Fill<N, T?>` construct a tuple of size N](#fill)\n   - [`First<...T>`, `Last<...T>` first and last tuple element](#first-last)\n   - [`Rest<...R>`, `ReverseRest<...R>` all but the first / last](#rest-reverserest)\n   - [`LargerThan<...T1, ...T2>`, `SameLength<...T1, ...T2>` tuple size comparison](#largerthan-samelength)\n   - [`LengthOf<...T>` length of tuple](#lengthof)\n   - [`Optional<...T1, ...T2>`, `OptionalFrom<...T, N>` make optional tuple elements](#optional)\n   - [`Overwrite<...T1, ...T2>` overwrite one tuple with another](#overwrite)\n   - [`Reverse<...T>` reverse the types in a tuple](#reverse)\n   - [`Shift<...T, N>` remove the first N elements in a tuple](#shift)\n   - [`Slice<...T, Start?, End?>` slice a tuple](#slice)\n   - [`Truncate<...T, N>` truncate a tuple](#truncate)\n   - [`UnionAll<...T1, T2>` union all tuple element types with a type](#union)\n\n\n## Arithmetics\n\nThe arithmetics in this library handles positive integers up to ~98, sometimes more.\n\n### Add\n\nAdd two positive numbers:\n\n```ts\nimport type { Add } from 'meta-types'\ntype T = Add< 13, 11 >; // T is 24\n```\n\n\n### Sub\n\nSubtract the second number from the first number:\n\n```ts\nimport type { Sub } from 'meta-types'\ntype T = Sub< 13, 11 >; // T is 2\n```\n\n\n### Mul\n\nMultiply two numbers:\n\n```ts\nimport type { Mul } from 'meta-types'\ntype T = Mul< 13, 11 >; // T is 143\n```\n\n\n## Conditionals and comparisons\n\n### Conditional\n\nReturn Then if If otherwise Else, or; if `If` then `Then` else `Else`.\n\n```ts\nimport type { If, Extends } from 'meta-types'\ntype T1 = If< true, \"yes\", \"no\" >;  // T1 is \"yes\"\ntype T2 = If< false, \"yes\", \"no\" >; // T2 is \"no\"\ntype T3 = If< Extends< \"42\", number >, \"yes\", \"no\" >; // T3 is \"no\", \"42\" doesn't extend number\n```\n\n\n### Extends\n\nReturns true if `T` extends `E`, otherwise false. This is a trivial operation, but practical in meta functional statements, e.g. `If`.\n\n```ts\nimport type { Extends } from 'meta-types'\ntype T1 = Extends< true, boolean >; // T1 is true; true extends boolean\ntype T1 = Extends< \"42\", number >;  // T2 is false; \"42\" doesn't extend number\n```\n\n\n### GreaterThan\n\n`GreaterThan` returns true if the first number is greater than the second.\n\nA third argument can be set to `true`, to turn this into greater-than-or-equal.\n\n```ts\nimport type { GreaterThan } from 'meta-types'\ntype T1 = GreaterThan< 42, 40 >;       // T1 is true; 42 > 40\ntype T2 = GreaterThan< 40, 40, true >; // T2 is true; 40 >= 40\ntype T3 = GreaterThan< 40, 42 >;       // T3 is false; 40 < 42\n```\n\n\n### Is\n\n`Is` returns true for equal types.\n\n```ts\nimport type { Is } from 'meta-types'\ntype T1 = Is< 42, number >;      // T1 is false\ntype T2 = Is< null, undefined >; // T2 is false\ntype T3 = Is< \"foo\", \"foo\" >;    // T3 is true\n```\n\n\n### IsFalsy\n\n`IsFalsy` returns true for any falsy type (`false`, `\"\"`, `0`, `null` and `undefined`).\n\n```ts\nimport type { IsFalsy } from 'meta-types'\ntype T1 = IsFalsy< 0 >; // T1 is true\ntype T2 = IsFalsy< 3 >; // T2 is false\n```\n\n\n## Logics\n\n### Logic (and, or, xor)\n\n`And`, `Or` and `Xor` can be used to perform logical operations on booleans.\n\n```ts\nimport type { And, Or, Xor } from 'meta-types'\ntype T1 = And< true, false >; // T1 is false, {true && false} -> false\ntype T2 = Or<  true, false >; // T2 is true, {true || false} -> true\ntype T2 = Xor< true, false >; // T3 is true, {true ^ false} -> true\n```\n\n\n### Not\n\nInvert `true` or `false` using `Not`.\n\n```ts\nimport type { Not } from 'meta-types'\ntype F = Not< true >;  // F is false, !true\ntype T = Not< false >; // T is true, !false\n```\n\nA second argument `Strict` can be provided, which defaults to `true`. If this is set to `false`, and [falsy](#isfalsy) type will return `true` instead of `never`.\n\n```ts\nimport type { Not } from 'meta-types'\ntype F = Not< 0 >;        // F is never, not exactly false\ntype T = Not< 0, false >; // T is true, 0 is falsy\n```\n\n\n## Tuples\n\n\n### Fill\n\nCreate a tuple of size `N`, filled with `any` (or type `T` if provided).\n\n```ts\nimport type { Fill } from 'meta-types'\ntype T1 = Fill< 3 >; // T1 is [ any, any, any ]\ntype T2 = Fill< 4, null >; // T2 is [ null, null, null, null ]\n```\n\n\n### First, Last\n\n`First` and `Last` can be used to extract the first and last elements in a tuple.\n\n```ts\nimport type { First, Last } from 'meta-types'\ntype T = [ \"hello\", 42, \"world\", true ];\ntype T1 = First< T >; // T1 is \"hello\"\ntype T2 = Last< T >;  // T2 is true\n```\n\n\n### Rest, ReverseRest\n\n`Rest` and `ReverseRest` can be used to extract all-but-the-first or all-but-the-last elements in a tuple.\n\n```ts\nimport type { Rest, ReverseRest } from 'meta-types'\ntype T = [ \"hello\", 42, \"world\", true ];\ntype T1 = Rest< T >;         // T1 is [ 42, \"world\", true ]\ntype T2 = ReverseRest< T >;  // T2 is [ \"hello\", 42, \"world\" ]\n```\n\n\n### LargerThan, SameLength\n\n`LargerThan` and `SameLength` can be used to extract and compare the length of tuples. A second argument can be provided to `LargerThan` to turn it into larger-than-or-same-length.\n\n```ts\nimport type { LargerThan, SameLength } from 'meta-types'\ntype T1 = LargerThan< [ 0, 0 ], [ 0, 0, 0 ] >;    // T1 is false, first length 2 < second length 3\ntype T2 = SameLength< [ 0, 0 ], [ 0, 0 ] >;       // T2 is true, length 2 === length 2\ntype T3 = LargerThan< [ 0, 0 ], [ 0, 0 ], true >; // T3 is true, 2 >= 2\n```\n\n\n### LengthOf\n\n`LengthOf` returns the length of a tuple, or a fallback type (defaults to `-1`) if the tuple is unbounded, i.e. it's rest-spread like `[ \"foo\", 42, ...null[] ]`.\n\n```ts\nimport type { LengthOf } from 'meta-types'\ntype T1 = LengthOf< [ 0, 0 ] >;                 // T1 is 2\ntype T2 = LengthOf< [ 0, 0, ...any ] >;         // T2 is -1\ntype T3 = LengthOf< [ 0, 0, ...any ], \"ouch\" >; // T3 is \"ouch\"\n```\n\n\n### Optional\n\nAppend an optional tuple to a *required* tuple.\n\n```ts\nimport type { Optional } from 'meta-types'\ntype T = Optional< [ string, number ], [ boolean, any ] >;\n// T is:\n//   | [ string, number ]\n//   | [ string, number, boolean ]\n//   | [ string, number, boolean, any ]\n```\n\nTurn all types after index N into optional.\n\n```ts\nimport type { OptionalFrom } from 'meta-types'\ntype T = OptionalFrom< [ string, number, boolean, any ], 2 >;\n// T is:\n//   | [ string, number ]\n//   | [ string, number, boolean ]\n//   | [ string, number, boolean, any ]\n```\n\n\n### Overwrite\n\nOverwrite the first elements in a tuple, with elements from another tuple. The first tuple will be overwritten with types in the second tuple.\n\n```ts\nimport type { Overwrite } from 'meta-types'\ntype T1 = Overwrite< [ 1, 2, 3 ], [ \"a\", \"b\" ] >; // T1 is [ \"a\", \"b\", 3 ]\ntype T2 = Overwrite< [ 1, 2 ], [ \"a\", \"b\", \"c\" ] >; // T2 is [ \"a\", \"b\", \"c\" ]\n```\n\n\n### Reverse\n\nReverse a tuple.\n\n```ts\nimport type { Reverse } from 'meta-types'\ntype T = Reverse< [ string, boolean, 42 ] >; // T is [ 42, boolean, string ]\n```\n\n\n### Shift\n\nShift (remove the first) N elements from a tuple.\n\n```ts\nimport type { Shift } from 'meta-types'\ntype T = Shift< [ string, boolean, number, 42, \"foo\" ], 2 >;\n// T is [ number, 42, \"foo\" ]\n```\n\n\n### Slice\n\nSlice a tuple with a start and end offset.\n\n```ts\nimport type { Slice } from 'meta-types'\ntype T = Slice< [ string, boolean, number, 42, \"foo\" ], 2, 4 >;\n// T is [ number, 42 ]\n```\n\n\n### Truncate\n\nTruncate a tuple to a max length.\n\n```ts\nimport type { Truncate } from 'meta-types'\ntype T = Truncate< [ string, boolean, number, 42, \"foo\" ], 2 >;\n// T is [ string, boolean ]\n```\n\n\n### Union\n\nUnion all the types in a tuple, with a type.\n\n```ts\nimport type { UnionAll } from 'meta-types'\ntype T = UnionAll< [ string, boolean, number ], U >;\n// T is [ string | U, boolean | U, number | U ]\n```\n\n\n\n[npm-image]: https://img.shields.io/npm/v/meta-types.svg\n[npm-url]: https://npmjs.org/package/meta-types\n[downloads-image]: https://img.shields.io/npm/dm/meta-types.svg\n","readmeFilename":"README.md"}