{"_id":"@cursorsdottsx/s","_rev":"3-51f9c630908d739661b239795f70435e","name":"@cursorsdottsx/s","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@cursorsdottsx/s","version":"1.0.0","description":"Functional switch blocks for comparing numbers.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/cursorsdottsx/s.git"},"keywords":[],"author":{"name":"im-lonely","email":"cursors.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/cursorsdottsx/s/issues"},"homepage":"https://github.com/cursorsdottsx/s#readme","gitHead":"ee7f91fe9ed8e2e30b2a66de183ed3a1210d6216","_id":"@cursorsdottsx/s@1.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-p/IcGfciSODr9cP1VBwGNJbt8Q++1HCLguBbWNAqVlbr3w7p5N0XpnyObxtCz3n4ptvsSzvsz5i6SJEJz7LC3g==","shasum":"657e78f73cdad7296227051e27f94fd207456c78","tarball":"https://registry.npmjs.org/@cursorsdottsx/s/-/s-1.0.0.tgz","fileCount":3,"unpackedSize":6834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqAIKCRA9TVsSAnZWagAABnoP/0eq7UEp3xKEYj45F+92\nd2IqOminUX5B6Wt3d411jfjeef4UMpfbe8OpX4zQflddoVHQLPkMJYiTjX2q\nGRl9DgKPPUOrJe/yaa9AgYETPtTqPdrFfuaHrZ+RXDushAOFESiRyZlcdcV2\nZdePdAeRva0oFVJERwAFeY5COI/anQot82TlsdraWl6WimUZs4T/8eMWwfq1\nwC1CE0GCI9UI4ilNrjtg5k7dg4X0UXrv7CYxnIHAf0Ctlyl4YjagyZRon5z/\n+xpb4OTtIubMLLE4jN00YmS4IFEL1Gf/UCgWK+qfegfnMcA9FaX2vurCMtmI\noEsQVQOtRiGCQ5/iptY307YDA5NP+yESuhIBXfNFQIuHzjDys6kZmHWjQGms\nBEB1k2VwO0ItYSQkuWkP0sPf929nnybE7SBwbpVND5iEToZDJ94jYO5U/ZjH\n0Ikne4YvXCNvObLcUpg6Df9C0eZHrDwB34WC1rmGAjXXRnCGzsLV7VT3OWva\nPI5BF8NsIe/mK3n7CVfouVI944aiQxYEVrCCDVSCUlu1vn1JvUguiH4A+yi9\nxUzmai2Fioj49NkYWD3QAHUK4a351wTaXI/Kq9gnpNYDyaoiWYOhu1zZdNgk\nwQqIwaMhjWqxiFBZSO4eTTvYGYR+/ySM3fiQSNmh0ZI1ODxQ5Pd5lYgb7XBQ\n7E+B\r\n=Ja/l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3J75UjxjyjyjxAZix3OLf6cPuxX5wZXGLxoEKQ851wAiAeHkxlQhS4BCdfTNT63wsPdWXSYCFnkixojD+j7OO9rw=="}]},"_npmUser":{"name":"cursorspkg","email":"cursors.dev@gmail.com"},"directories":{},"maintainers":[{"name":"cursorspkg","email":"cursors.dev@gmail.com"},{"name":"cursorsdev","email":"cursors.alt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s_1.0.0_1621623306255_0.16558805923577102"},"_hasShrinkwrap":false},"2.0.0":{"name":"@cursorsdottsx/s","version":"2.0.0","description":"Functional switch blocks for comparing numbers.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/cursorsdottsx/s.git"},"keywords":[],"author":{"name":"im-lonely","email":"cursors.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/cursorsdottsx/s/issues"},"homepage":"https://github.com/cursorsdottsx/s#readme","gitHead":"22a40e6b28d60fafa8aa44bee62ac662c7d3d5ff","_id":"@cursorsdottsx/s@2.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-DANEp+CEaxHX7PtOKey3rBn2mqve4rijH6kfPbE9sGb41LStY/742MB4FxhsTGyQnXoSFnGaF8CSYJCsldwSVQ==","shasum":"f12d1e2c57c3296fe766efd44900e28afac59698","tarball":"https://registry.npmjs.org/@cursorsdottsx/s/-/s-2.0.0.tgz","fileCount":4,"unpackedSize":7002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqW0VCRA9TVsSAnZWagAAd2UP/A/SpVvBuozEQOoITgzl\n4WSPxBZaUaFgc1LI19bf9trfoPtY7jAzFBWRLfsdQ9oP8/HsPeivyYI1ESE/\nKM9ZDw8lfuf2G4AwmSSkYg6AzTpw93Mytwn6hXqbghLVeUH2h9+Q/Z4hbAH1\nVByWPvGZj+njnE9txzs/693A78iw2tS0GHw+14VdDEOwuaMJFgqsFvYBNdN5\n4Qh4shvL/CKcsPAFFw+sWW8pyz1COpmNNy3GHXEVksZC01tnVBk+zyU7PrIa\nLYHgEvYOjGsMSXvR6hUs4c7o00OD+45VZc/dSjMKHoFJlxIgZiGMgAeq35wt\n2XcLrIXUIlb57zELSplVUqONYcRTIwJleKDsCC9YlG0P7pB+krn4cRw4D8sl\neQCJfbNZjm8GVplX04krAkgMXApCOicsYN9gOX8UrjzSh1+FZVQnqEKeSSrI\nxRBgQ217l043tC5AYRHVO7NjT4GxqEWkdeL/TRcvBNY6kLFXvSYEOBiVpkJM\nSbB+Ez6e19IXry8Ol65W3WiJrLGVjzCn0VXeOZvoUj95mrPSVQnSMIhJhdSV\nya79nFQ2i71AVDHoifZyK+7VlFDE458aDqFrdAlXz+rzczZBxjy5eUAJYz/F\nUcwmVIIqEWyXvdluVnAtgHAeTIbaPhlx2e6ij7ytY0MX7YMLIQWd4lNSM7wN\nY9tQ\r\n=IAAR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsQqdwMYfFHcKl/oQ223IJ2hwAW4+TW3Lj2wyaRshWTAIhAITpN46BN3fDjHEZycbgNQnbYfzzSGH2pt/oR/f5xjl9"}]},"_npmUser":{"name":"cursorspkg","email":"cursors.dev@gmail.com"},"directories":{},"maintainers":[{"name":"cursorspkg","email":"cursors.dev@gmail.com"},{"name":"cursorsdev","email":"cursors.alt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s_2.0.0_1621716244734_0.46851948575680824"},"_hasShrinkwrap":false},"2.0.1":{"name":"@cursorsdottsx/s","version":"2.0.1","description":"Functional switch blocks for comparing numbers.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/cursorsdottsx/s.git"},"keywords":[],"author":{"name":"im-lonely","email":"cursors.dev@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/cursorsdottsx/s/issues"},"homepage":"https://github.com/cursorsdottsx/s#readme","gitHead":"89966affdff1a080ab10b9234676c7fe4650e36b","_id":"@cursorsdottsx/s@2.0.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-1seQc8dsXjLzEfrMuH3EF6FAfoqBMAJBtPlKumVUQ4bPErAMoVyzQoNwf5lP8Qos4H6yQdzxr/ASkeQZGXEWQg==","shasum":"1ab41e405c23bcd8f7a06f8ef334dffb1cd0b4af","tarball":"https://registry.npmjs.org/@cursorsdottsx/s/-/s-2.0.1.tgz","fileCount":4,"unpackedSize":7002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqW0jCRA9TVsSAnZWagAAi24P+gOYU62p+b9jqZjMPjRc\n12vm8mobK96353dLxBAHGKA390bnUQKpdwXgTXWiMbrCKyiH0paA4heXE8Dr\nGPUYu55U+slluSo/Pbg2kwq+R/d5YIWTCQ+KjfiGgrxzD8W6pS4v04O0543C\nfBWFa8F+cu6kuPLbr5f8lCm1Ij1sRKam9AiokYXYx5XIYk9AO42EtmLHp+5a\nhqvy9kL9QJWv5zzKlpJafuCuCAz9wzaxGUUjbzV7HUzSGGr6C3jezojyACqy\nDCML39/jigVXcMiIAlNjTreph3+625DXzcKsCNfGaAXNiUeczmt7q8J0QAyD\nrNWmAdxvjFxRxTtvFQ/PH4NZ0OLF5AUIuGsxAqRKsFlZ/TZ4OaaEDlLBRndj\ngS+RkdLR8obLaMEMpKKX+U1k0/nOnqSLTUuytwcmlsOEzrSDjffIxW2dm7P+\nvT6jh4Q68o39puZEmnpsvxt3Cu/sT2wyDjWkl/IXOPDt3mpM0VC0ICnSQAWw\nd7F6An6bcysbWreKEmh4l/5ef+X4ll39u+41Neq6H5tG9iYkKyF8jX3Xqi5L\nndFFtoxXRuL/IVfX8qZR8cfI5VMIw8CbIno4hzjeGL3ZZxGLhyCKblm6S4kR\nDOoyJa9EjwtdZ1Q3vKXAh6Mur5pz9xqC2IGTS6u+LoC93ORPcXfIK7uKU6AP\nzrfe\r\n=Mt+L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCutyzauKEVNti2wmMaUaPhE7BudfEVNHQSwIAqVHr4dwIhAN+mvhoh5CnZ5DIIavtCmRQWrgW9Q8b+h2xjjPaVOl/T"}]},"_npmUser":{"name":"cursorspkg","email":"cursors.dev@gmail.com"},"directories":{},"maintainers":[{"name":"cursorspkg","email":"cursors.dev@gmail.com"},{"name":"cursorsdev","email":"cursors.alt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s_2.0.1_1621716258940_0.29096269863133517"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-21T18:55:05.888Z","1.0.0":"2021-05-21T18:55:06.381Z","modified":"2022-04-05T02:20:40.685Z","2.0.0":"2021-05-22T20:44:04.895Z","2.0.1":"2021-05-22T20:44:19.096Z"},"maintainers":[{"name":"cursorspkg","email":"cursors.dev@gmail.com"},{"name":"cursorsdev","email":"cursors.alt@gmail.com"}],"description":"Functional switch blocks for comparing numbers.","homepage":"https://github.com/cursorsdottsx/s#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/cursorsdottsx/s.git"},"author":{"name":"im-lonely","email":"cursors.dev@gmail.com"},"bugs":{"url":"https://github.com/cursorsdottsx/s/issues"},"license":"MIT","readme":"| [a](https://www.npmjs.com/package/@cursorsdottsx/a)\n| [b](https://www.npmjs.com/package/@cursorsdottsx/b)\n| [c](https://www.npmjs.com/package/@cursorsdottsx/c)\n| [d](https://www.npmjs.com/package/@cursorsdottsx/d)\n| [e](https://www.npmjs.com/package/@cursorsdottsx/e)\n| [f](https://www.npmjs.com/package/@cursorsdottsx/f)\n| [g](https://www.npmjs.com/package/@cursorsdottsx/g)\n| [h](https://www.npmjs.com/package/@cursorsdottsx/h)\n| [i](https://www.npmjs.com/package/@cursorsdottsx/i)\n| [j](https://www.npmjs.com/package/@cursorsdottsx/j)\n| [k](https://www.npmjs.com/package/@cursorsdottsx/k)\n| [l](https://www.npmjs.com/package/@cursorsdottsx/l)\n| [m](https://www.npmjs.com/package/@cursorsdottsx/m)\n| [n](https://www.npmjs.com/package/@cursorsdottsx/n)\n| [o](https://www.npmjs.com/package/@cursorsdottsx/o)\n| [p](https://www.npmjs.com/package/@cursorsdottsx/p)\n| [q](https://www.npmjs.com/package/@cursorsdottsx/q)\n| [r](https://www.npmjs.com/package/@cursorsdottsx/r)\n| **s**\n| [t](https://www.npmjs.com/package/@cursorsdottsx/t)\n| [u](https://www.npmjs.com/package/@cursorsdottsx/u)\n| [v](https://www.npmjs.com/package/@cursorsdottsx/v)\n| [w](https://www.npmjs.com/package/@cursorsdottsx/w)\n| [x](https://www.npmjs.com/package/@cursorsdottsx/x)\n| [y](https://www.npmjs.com/package/@cursorsdottsx/y)\n| [z](https://www.npmjs.com/package/@cursorsdottsx/z)\n|\n\n**S is for Switch**\n\n# @cursorsdottsx/s\n\nFunctional switch blocks for comparing numbers. Switch was never that good or useful. With this small library, at least it's good with numbers.\n\nSuper easy to add and install:\n\n```bash\nnpm install @cursorsdottsx/s\n```\n\n```bash\nyarn add @cursorsdottsx/s\n```\n\nAnd also super easy to use:\n\n```js\nimport Switch from \"@cursorsdottsx/s\";\n```\n\nAfter you import the library, it will attach a global function named `Switch` that's easy to use.\n\n`Switch(values, cases)`\n\n-   `values` – An object with the values to compare.\n-   `cases` – All the cases.\n\nExample:\n\n```js\nconst x = 10;\n\nSwitch(\n    { x },\n    {\n        [\"x > 5\"]() {\n            console.log(\"Greater than 5.\");\n        },\n        [\"default\"]() {\n            console.log(\"Less than 5.\");\n        },\n    }\n);\n```\n\nSwitch supports 6 comparators, `>`, `<`, `>=`, `<=`, `=`, and `!=`. It also supports `&` for joining two comparisons like this:\n\n```js\nconst x = 10;\nconst y = 5;\n\nSwitch(\n    { x, y },\n    {\n        [\"x > 5 & y > 5\"]() {\n            console.log(\"Both greater than 5.\");\n        },\n        [\"default\"]() {\n            console.log(\"One is less than 5.\");\n        },\n    }\n);\n```\n\nThe `default` case is optional, and you can have as many cases as you'd like. Only one case gets executed and its return value is `Switch`'s return value.\n\nEach comparison **must** be in the format `identifier comparator value`, though this may change in the future.\n\nIf there are any features you'd like to add, please either open an issue or pull request!\n\n[npm abc's homepage](https://codepen.io/cursorsdottsx/full/KKWNRaY)\n","readmeFilename":"README.md"}