{"_id":"@anilkumarthakur/match","_rev":"12-bfa23e8b4ea7496625fa1dd8887d92a9","name":"@anilkumarthakur/match","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.0":{"name":"@anilkumarthakur/match","version":"0.0.0","_id":"@anilkumarthakur/match@0.0.0","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"ee7655d0131ca13916be54a5db379e7cc6d73a46","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.0.tgz","fileCount":5,"integrity":"sha512-R8tNivKAHiEjXQyGZLo4Buz3DhFIXXaoX1JwGp2HOhdHtBxo87uVVNmF/MciG+pyuNhNrRFdNiiI/9cu+lxEow==","signatures":[{"sig":"MEUCIQDilnp0iDNXy9fAbRxMMCTKBFuU9Mkf3KaD9zoRWUyMGAIgF7rAMFP6dkWAajDOM+A0xRFuMcj6TKfEA448nXAXnLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4968},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"private":false,"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","directories":{},"_nodeVersion":"21.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.2.0","typescript":"^5.2.2","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.0_1717258898806_0.4958566989047548","host":"s3://npm-registry-packages"}},"0.0.1":{"name":"@anilkumarthakur/match","version":"0.0.1","_id":"@anilkumarthakur/match@0.0.1","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"10657b7cfda3cce5e908462b725b147b29527c72","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.1.tgz","fileCount":9,"integrity":"sha512-SpRGvHOov4KO+RSg9suU5XOsZgAM1VsDcHXtCXWFxd5sRfMnYQ5mcT0gnxtCgZeSTjuf47h23i/Kr2v5dqdaEA==","signatures":[{"sig":"MEUCIQCK1t+qap61TOX2ifbFejjbuXeViJHu4T7nHDTARnWtTQIgPjsS/botuvmfafxDsCmKKiMmWjodZp9leVI6nBXwD+A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7238},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"88f63f52c4ccfbeef920647574392b4ab09262f2","private":false,"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"21.7.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{"vite":"^5.2.0","typescript":"^5.2.2","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1"},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.1_1717292209456_0.9204846012882082","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@anilkumarthakur/match","version":"0.0.3","_id":"@anilkumarthakur/match@0.0.3","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"587584d4ba9f8554cc1c3a32d28e5db01e522dd8","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.3.tgz","fileCount":9,"integrity":"sha512-RwMt9ok3HDDUsDKHaWPnzLuWpvlAuPg27Ub2K7hu+fyA5paGdGMG8/nKdvP6QPP7Y/1PUnWyjiw7tKRrqR8B/w==","signatures":[{"sig":"MEUCIQCOAoSQ9jGaOVhz8NFrfZRSCBcKtoEVTD8mOkvTquYTcgIgYe0SNkYXGuvwmo78OElAxM55xQ9kTMV95HiQFDxROPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7364},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"2076a75276977386303373383f7480730b84a34b","private":false,"scripts":{"dev":"vite","test":"jest","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"21.7.0","dependencies":{"jest":"^29.7.0","vite":"^5.2.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.3_1717299553763_0.9923211825946303","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@anilkumarthakur/match","version":"0.0.4","_id":"@anilkumarthakur/match@0.0.4","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"5af6d426af8d7c91b5ca25833883a93702a90325","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.4.tgz","fileCount":9,"integrity":"sha512-YreZ3s3veIYOlDxPn3M5FCVDMJXmA9QAFF38jgx85udHXt2lkTahd0ZVxaIcqRzgG2vQxVnQJnrDXxezMgE+ew==","signatures":[{"sig":"MEYCIQCcLXMUOcj5KecT2767j8CJwjvXud5f4lczNhxFtt6IfgIhAKgIhpKMTJTrAJqJF64seyAWGBJl66gBL2oKJ5LMUTiA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7347},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"132378d2f3b522c568a0e517714056039d94b51a","private":false,"scripts":{"dev":"vite","test":"jest","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"21.7.0","dependencies":{"jest":"^29.7.0","vite":"^5.2.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.4_1717382109958_0.39294462453745216","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@anilkumarthakur/match","version":"0.0.5","keywords":["match","typescript","javascript","conditional","logic","pattern-matching","php-match","npm","library","match-expression","match-library","match-js","match-js-library","match-js-npm","match-js-package","match-js-package-npm","match-js-package-npm-library","php match expression in javascript","php match in javascript"],"_id":"@anilkumarthakur/match@0.0.5","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"5991a9cd82b5a5fc4a82f3574e479e838fc5cc65","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.5.tgz","fileCount":2,"integrity":"sha512-ZTYEw2+hVO9P7/8H+oXvJPUgUsvNAVTT45MBkRsjWFAtXpR7jWTNP8OCbb5kpwbkLB6XpJJOAo16SB/u0Lp5ew==","signatures":[{"sig":"MEYCIQCRDUWNNS7pAzN8r8acLRs7Lh66TqmtGUchw6sLj5aoeQIhAPf/fGsh7ThZeUAwqrAUkthOA7nDCSWdatRE4eAGqeJ+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3541},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"a01a7f2abd0c006b69dae33679cfcb2508559e76","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc && vite build","format":"prettier --write src/","preview":"vite preview","lint-format":"npm run lint && npm run format"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"21.7.3","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","vite":"^5.2.0","eslint":"^8.57.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","prettier":"^3.2.5","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1","@rushstack/eslint-patch":"^1.8.0","@typescript-eslint/parser":"^7.11.0","@typescript-eslint/eslint-plugin":"^7.11.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.5_1717482791549_0.1536687380344235","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@anilkumarthakur/match","version":"0.0.6","keywords":["match","typescript","javascript","conditional","logic","pattern-matching","php-match","npm","library","match-expression","match-library","match-js","match-js-library","match-js-npm","match-js-package","match-js-package-npm","match-js-package-npm-library","php match expression in javascript","php match in javascript"],"_id":"@anilkumarthakur/match@0.0.6","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"405d4971cd830ef047929f54d6d90c0e7faacda0","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.6.tgz","fileCount":9,"integrity":"sha512-zjBXcxpArOm8lwUeHtAPBoXckF+lQgn8cHQconT0t5lsPI+fPCUddg05bg7KCkRXh2Cmjbp8H26syf8kz2uVpA==","signatures":[{"sig":"MEQCIGjsMxfV1G6GdgYEDBy1Dp3hB3W6Vc6fl7JTnlmBq94AAiBqs7eTyL1kc0rwt8Ud4yWHnPHyu0V79YqocLDZ7h3KZw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7920},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"a01a7f2abd0c006b69dae33679cfcb2508559e76","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc && vite build","format":"prettier --write src/","preview":"vite preview","lint-format":"npm run lint && npm run format"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.5.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"21.7.3","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","vite":"^5.2.0","eslint":"^8.57.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","prettier":"^3.2.5","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1","@rushstack/eslint-patch":"^1.8.0","@typescript-eslint/parser":"^7.11.0","@typescript-eslint/eslint-plugin":"^7.11.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.6_1717482907054_0.22582378631266642","host":"s3://npm-registry-packages"}},"0.0.7":{"name":"@anilkumarthakur/match","version":"0.0.7","keywords":["match","typescript","javascript","conditional","logic","pattern-matching","php-match","npm","library","match-expression","match-library","match-js","match-js-library","match-js-npm","match-js-package","match-js-package-npm","match-js-package-npm-library","php match expression in javascript","php match in javascript"],"_id":"@anilkumarthakur/match@0.0.7","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"dist":{"shasum":"e24d42e50baaffcf2ca0d34f3dfc1013446110d7","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.7.tgz","fileCount":9,"integrity":"sha512-QRSvgCfFxAKZxaSQvBX8e3Ti59Hgx2DZmJjFcNXDX73Cd+BJo0VYI1rQHVqTljOcvLEoRe+tdFi1x+M83n6BVQ==","signatures":[{"sig":"MEUCIHbJavMt6tyi4Xl0Bu6dkytcJUJiDFz34eLkOPYXT1uNAiEA/Wy3dgge+2Nngm1YEcdsA4OsqEXmpIqYqoEQp4mUcYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9339},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"d34cd38c66b5bcd29dc923accccea66c390a12da","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc && vite build","format":"prettier --write src/","preview":"vite preview","lint-format":"npm run lint && npm run format"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"_npmVersion":"10.9.0","description":"`@anilkumarthakur/match` is a JavaScript library inspired by PHP's match expression. It allows for more readable and maintainable code by providing a clean and concise way to handle small to large conditional logic.","directories":{},"_nodeVersion":"22.11.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","vite":"^5.2.0","eslint":"^8.57.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","prettier":"^3.2.5","typescript":"^5.2.2","@types/jest":"^29.5.12","@types/node":"^20.13.0","vite-plugin-dts":"^3.9.1","@rushstack/eslint-patch":"^1.8.0","@typescript-eslint/parser":"^7.11.0","@typescript-eslint/eslint-plugin":"^7.11.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.7_1734368108769_0.4196495498165118","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@anilkumarthakur/match","version":"0.0.8","keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"license":"MIT","_id":"@anilkumarthakur/match@0.0.8","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"homepage":"https://github.com/anilkumarthakur60/js-match#readme","bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"dist":{"shasum":"5b1809e93dc355ca51442e9904a02fc26fe840b2","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.0.8.tgz","fileCount":29,"integrity":"sha512-EcolcnLfwiZe8NgpR65LLHyrxRIqYkoE81G98mlCaMvnYdiXow8ZmZabUMvWCC8HHdX1mWYVRjLX6a+fRntmJw==","signatures":[{"sig":"MEQCIH/ChAa05l2TieH+hROO8Fr0+BnqLT+eBokzGu4aWudaAiA1KcnoTkfHHDz2zeLnyxn/M18LQzh3M9J6sFofcwBdcQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":129069},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"dacc7f5f90db33de627fbfccf06890c58662cabf","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc --noEmit && vite build","format":"prettier --write src/","preview":"vite preview","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","lint-format":"npm run lint && npm run format","docs:preview":"vitepress preview docs","test:coverage":"jest --coverage"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"repository":{"url":"git+https://github.com/anilkumarthakur60/js-match.git","type":"git"},"_npmVersion":"10.9.4","description":"PHP-style match expressions for JavaScript/TypeScript","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","vite":"^7.3.1","eslint":"^9.39.2","ts-jest":"^29.4.6","ts-node":"^10.9.2","prettier":"^3.8.0","vitepress":"^1.6.4","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^25.0.9","@changesets/cli":"^2.29.8","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@rushstack/eslint-patch":"^1.15.0","@typescript-eslint/parser":"^8.53.0","@semantic-release/changelog":"^6.0.3","@typescript-eslint/eslint-plugin":"^8.53.0"},"_npmOperationalInternal":{"tmp":"tmp/match_0.0.8_1768580137963_0.31146467273048417","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@anilkumarthakur/match","version":"0.1.1","keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"license":"MIT","_id":"@anilkumarthakur/match@0.1.1","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"homepage":"https://github.com/anilkumarthakur60/js-match#readme","bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"dist":{"shasum":"5c4bdff4583026f388de0188957f52979481b1f6","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.1.1.tgz","fileCount":8,"integrity":"sha512-e2wGTcgm2RQkqdFou7W4Puq19gwiZNd5oIsfuLMzKrI70eXLY94yFqXAQA9HE6dn5CZJ1JtWz9OBEUaUWlTE7w==","signatures":[{"sig":"MEUCIQDYmT6c+OddzoniK3d4GWSpVwSmorqP6zEmqFfCtffj0AIgWG2S10v3kuSzD+1Pwo5bhmnSAJAsf7LIMmYSdymEYlc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68649},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"bf9134801150536329097e2802a29b87927d48eb","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc --noEmit && vite build","format":"prettier --write src/","preview":"vite preview","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","lint-format":"npm run lint && npm run format","docs:preview":"vitepress preview docs","test:coverage":"jest --coverage"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"repository":{"url":"git+https://github.com/anilkumarthakur60/js-match.git","type":"git"},"_npmVersion":"10.9.4","description":"PHP-style match expressions for JavaScript/TypeScript","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","vite":"^7.3.1","eslint":"^9.39.2","ts-jest":"^29.4.6","ts-node":"^10.9.2","prettier":"^3.8.0","vitepress":"^1.6.4","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^25.0.9","@changesets/cli":"^2.29.8","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@rushstack/eslint-patch":"^1.15.0","@typescript-eslint/parser":"^8.53.0","@semantic-release/changelog":"^6.0.3","@typescript-eslint/eslint-plugin":"^8.53.0"},"_npmOperationalInternal":{"tmp":"tmp/match_0.1.1_1768667993172_0.4361950102741472","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@anilkumarthakur/match","version":"0.1.2","keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"license":"MIT","_id":"@anilkumarthakur/match@0.1.2","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"homepage":"https://github.com/anilkumarthakur60/js-match#readme","bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"dist":{"shasum":"7d551384033c147ec68e605e88b4310fd41b3c60","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.1.2.tgz","fileCount":8,"integrity":"sha512-X5yLGakq747b1yoskJT4jiADN5EaoiJY/blSgAmJM2ZpnTEm4wFEHccPna38A6VSdc3i3xVmN+Lv5zey31+UrQ==","signatures":[{"sig":"MEUCIQDJy+UlOfx8mIuOCgy+uQqMkdV3XUnWG/8bdAkq09/vqAIgdhAUy6/cJ92YQHZVg796aEM+at9q/iL/Z/1I7mxjXGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85163},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"b1a7b9231672b74aabf4ce5899a0a808b722febc","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc --noEmit && vite build","format":"prettier --write src/","preview":"vite preview","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","lint-format":"npm run lint && npm run format","docs:preview":"vitepress preview docs","test:coverage":"jest --coverage"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"repository":{"url":"git+https://github.com/anilkumarthakur60/js-match.git","type":"git"},"_npmVersion":"10.9.4","description":"PHP-style match expressions for JavaScript/TypeScript","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","vite":"^7.3.1","eslint":"^9.39.2","ts-jest":"^29.4.6","ts-node":"^10.9.2","prettier":"^3.8.0","vitepress":"^1.6.4","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^25.0.9","@changesets/cli":"^2.29.8","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@rushstack/eslint-patch":"^1.15.0","@typescript-eslint/parser":"^8.53.0","@semantic-release/changelog":"^6.0.3","@typescript-eslint/eslint-plugin":"^8.53.0"},"_npmOperationalInternal":{"tmp":"tmp/match_0.1.2_1768671972132_0.33165118914377434","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@anilkumarthakur/match","version":"0.1.3","keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"license":"MIT","_id":"@anilkumarthakur/match@0.1.3","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"homepage":"https://anilkumarthakur60.github.io/js-match","bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"dist":{"shasum":"8789fa7ac2b1263e7dd95d63b10231a3fe3f5b0f","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.1.3.tgz","fileCount":8,"integrity":"sha512-AQ6zhY1Z+ZLzzv4Txir6br7f7HpX5mPIAActMbTXjf09K2oXyYWy6kFA4X9h/aN2CJZDiHhwEQ25HAJzYMZpPQ==","signatures":[{"sig":"MEUCIQCWBv72ZfJdGeRbQ6GbW/XyjZ2GWyKbsJ6sgwHHRDp+3gIgOCH3DzPyj0Lxmx8FcYLq6oFtk0cTuAUdehrGtKR4aCA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85155},"main":"dist/index.umd.js","type":"module","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.umd.js"}},"gitHead":"154618a50843f6f8a32d2002b09991287abd3026","private":false,"scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","test":"jest","build":"tsc --noEmit && vite build","format":"prettier --write src/","preview":"vite preview","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","lint-format":"npm run lint && npm run format","docs:preview":"vitepress preview docs","test:coverage":"jest --coverage"},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"repository":{"url":"git+https://github.com/anilkumarthakur60/js-match.git","type":"git"},"_npmVersion":"10.9.4","description":"PHP-style match expressions for JavaScript/TypeScript","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","vite":"^7.3.1","eslint":"^9.39.2","ts-jest":"^29.4.6","ts-node":"^10.9.2","prettier":"^3.8.0","vitepress":"^1.6.4","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^25.0.9","@changesets/cli":"^2.29.8","vite-plugin-dts":"^4.5.4","semantic-release":"^25.0.2","@semantic-release/git":"^10.0.1","@rushstack/eslint-patch":"^1.15.0","@typescript-eslint/parser":"^8.53.0","@semantic-release/changelog":"^6.0.3","@typescript-eslint/eslint-plugin":"^8.53.0"},"_npmOperationalInternal":{"tmp":"tmp/match_0.1.3_1768751220162_0.2573093218595881","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anilkumarthakur/match","version":"0.2.0","description":"PHP-style match expressions for JavaScript/TypeScript","type":"module","license":"MIT","author":{"name":"Anil Kumar Thakur","url":"https://github.com/anilkumarthakur60"},"repository":{"type":"git","url":"git+https://github.com/anilkumarthakur60/js-match.git","directory":"packages/match"},"homepage":"https://anilkumarthakur60.github.io/js-match","bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","unpkg":"./dist/index.global.js","jsdelivr":"./dist/index.global.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"default":"./dist/index.js"},"./package.json":"./package.json"},"sideEffects":false,"engines":{"node":">=22"},"devDependencies":{"@types/node":"^25.0.9","@vitest/coverage-v8":"^4.1.10","tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.1.10"},"publishConfig":{"access":"public"},"keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"scripts":{"clean":"rm -rf dist coverage","build":"tsup && node scripts/check-dist.mjs","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","typecheck":"tsc --noEmit","lint":"eslint ."},"_nodeVersion":"22.23.1","_id":"@anilkumarthakur/match@0.2.0","dist":{"integrity":"sha512-dF2lFj5guIaQalZwwzkThp8P1JmzB+eIPr4Fw6E3UnDRXPnmVvGKDN6eRFFSy2fJ0zAUDH3kqIMs4yntbnKBSQ==","shasum":"e2c3770d8c79ce9b8fb64c7b65a57d21d41994bc","tarball":"https://registry.npmjs.org/@anilkumarthakur/match/-/match-0.2.0.tgz","fileCount":9,"unpackedSize":64630,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDQd2rQF413qIvyWyBzi6S7ukZ//4KkByJFwy7XM0Q3RAiEAqwy7PMKtZIbsMHUsyxcWLNq6U7QfXPK/3+GGI8IwsfI="}]},"_npmUser":{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"},"directories":{},"maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/match_0.2.0_1784777234765_0.34423052206100335"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-01T16:21:38.686Z","modified":"2026-07-23T03:27:15.080Z","0.0.0":"2024-06-01T16:21:38.962Z","0.0.1":"2024-06-02T01:36:49.732Z","0.0.3":"2024-06-02T03:39:13.921Z","0.0.4":"2024-06-03T02:35:10.123Z","0.0.5":"2024-06-04T06:33:11.696Z","0.0.6":"2024-06-04T06:35:07.194Z","0.0.7":"2024-12-16T16:55:08.995Z","0.0.8":"2026-01-16T16:15:38.107Z","0.1.1":"2026-01-17T16:39:53.318Z","0.1.2":"2026-01-17T17:46:12.302Z","0.1.3":"2026-01-18T15:47:00.317Z","0.2.0":"2026-07-23T03:27:14.918Z"},"bugs":{"url":"https://github.com/anilkumarthakur60/js-match/issues"},"license":"MIT","homepage":"https://anilkumarthakur60.github.io/js-match","keywords":["match","match-expression","pattern-matching","php-match","typescript","javascript","switch-alternative","conditional"],"repository":{"type":"git","url":"git+https://github.com/anilkumarthakur60/js-match.git","directory":"packages/match"},"description":"PHP-style match expressions for JavaScript/TypeScript","maintainers":[{"name":"anilkumarthakur","email":"anilkumarthakur60@gmail.com"}],"readme":"# @anilkumarthakur/match\n\n[![npm version](https://img.shields.io/npm/v/@anilkumarthakur/match)](https://www.npmjs.com/package/@anilkumarthakur/match)\n[![license](https://img.shields.io/npm/l/@anilkumarthakur/match)](LICENSE)\n[![CI](https://github.com/anilkumarthakur60/js-match/actions/workflows/ci.yml/badge.svg)](https://github.com/anilkumarthakur60/js-match/actions/workflows/ci.yml)\n[![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](#testing)\n\nPHP-style match expressions for JavaScript/TypeScript with 100% type safety and comprehensive test coverage.\n\n`@anilkumarthakur/match` brings the power and elegance of PHP's match expression to the JavaScript/TypeScript world. It provides a clean, type-safe alternative to complex switch statements and nested if-else logic.\n\n## Features\n\n✨ **Type-Safe**: Full TypeScript support with generic types for subject and result  \n🎯 **Readable**: Clean, expressive syntax inspired by PHP match expressions  \n🚀 **Fast**: Eager, allocation-free matching — a single `Object.is` per case, no lookup table to build  \n🛡️ **Guards**: Predicate functions, not just literals — the headline extension over PHP's `match`  \n📦 **Lightweight**: Zero dependencies, ~1 KB gzipped (ES module)  \n🧪 **Well-Tested**: Comprehensive test suite at 100% code coverage  \n🔗 **Chainable**: Fluent API for method chaining  \n🌍 **Cross-Platform**: Works in Node.js and browsers (ESM + CJS + IIFE browser global)\n\n## Installation\n\n### npm\n\n```bash\nnpm install @anilkumarthakur/match\n```\n\n### yarn\n\n```bash\nyarn add @anilkumarthakur/match\n```\n\n### bun\n\n```bash\nbun add @anilkumarthakur/match\n```\n\n### CDN (browser global)\n\n`unpkg` and `jsDelivr` resolve the bare package specifier to `dist/index.global.js`, an IIFE bundle\nthat exposes everything on the `JsMatch` global. There is no UMD build — the bundle performs no\nAMD/CommonJS detection.\n\n```html\n<script src=\"https://unpkg.com/@anilkumarthakur/match\"></script>\n<script>\n  const { match } = JsMatch\n  console.log(\n    match(404)\n      .on(404, () => 'Not Found')\n      .otherwise(() => 'Unknown')\n  ) // \"Not Found\"\n</script>\n```\n\n## Quick Start\n\n```typescript\nimport { match } from '@anilkumarthakur/match'\n\nconst result = match('success')\n  .on('success', () => 'Operation successful!')\n  .on('error', () => 'Something went wrong')\n  .otherwise(() => 'Unknown status')\n\nconsole.log(result) // \"Operation successful!\"\n```\n\n## API Reference\n\n### `match<TSubject, TResult>(subject: TSubject): Matcher`\n\nCreates a new match expression for the given subject value.\n\n**Parameters:**\n\n- `subject` - The value to match against (any type)\n\n**Returns:** A `Matcher` instance for method chaining\n\n**Example:**\n\n```typescript\nconst matcher = match(statusCode)\n```\n\n### `on(pattern: TSubject | Predicate<TSubject>, handler: () => TResult): Matcher`\n\nAdds a case. `pattern` is either a literal value compared with `Object.is()`, or a predicate\nfunction `(subject) => boolean` (see [Predicate Matching](#predicate-matching)).\n\n**Parameters:**\n\n- `pattern` - A literal value, or a predicate function receiving the subject\n- `handler` - Function returning the result if matched\n\n**Returns:** The matcher instance (for chaining)\n\n**Example:**\n\n```typescript\nmatch(status)\n  .on(200, () => 'Success')\n  .on(404, () => 'Not Found')\n```\n\n### `onAny(values: readonly TSubject[], handler: () => TResult): Matcher`\n\nAdds multiple values that all map to the same handler (simulates PHP's comma-separated cases).\n\n**Parameters:**\n\n- `values` - Array of values to match\n- `handler` - Function to execute if any value matches\n\n**Returns:** The matcher instance (for chaining)\n\n**Example:**\n\n```typescript\nmatch(status)\n  .onAny([200, 201, 202], () => 'Success')\n  .onAny([400, 401, 403], () => 'Client Error')\n```\n\n### `otherwise(handler: () => TResult): TResult`\n\nSets the default handler and executes the match. Returns immediately with the result.\n\n**Parameters:**\n\n- `handler` - Function to execute if no cases match\n\n**Returns:** The result from matched handler or default handler\n\n**Throws:** `UnhandledMatchError` if no match found and no default provided\n\n**Example:**\n\n```typescript\nconst result = match(value)\n  .on('expected', () => 'matched')\n  .otherwise(() => 'default')\n```\n\n### `default(handler: () => TResult): TResult`\n\nPHP-compatible alias for `otherwise()`. Identical behavior.\n\n**Example:**\n\n```typescript\nconst result = match(value)\n  .on('expected', () => 'matched')\n  .default(() => 'default')\n```\n\n### `get(): TResult`\n\nReturns the matched result without a default handler. Throws if nothing matched.\n\n**Returns:** The result from the matched handler\n\n**Throws:** `UnhandledMatchError` if no match found\n\n**Example:**\n\n```typescript\nconst result = match('test')\n  .on('test', () => 'matched')\n  .get() // Must have matched something\n```\n\n### `valueOf(): TResult`\n\nDeprecated alias for [`get()`](#get-tresult). Prefer `get()`.\n\n`valueOf` is JavaScript's own `ToPrimitive` hook, so the engine calls it implicitly whenever a\nmatcher is coerced — string concatenation, `==`, arithmetic. On an unmatched chain that means an\n`UnhandledMatchError` can surface from an expression that never mentions `valueOf`:\n\n```typescript\nconst matcher = match(1).on(2, () => 'two')\nmatcher + '' // throws UnhandledMatchError: Unhandled match value: 1\n```\n\n`get()` has no such coupling to the language.\n\n### `run(): boolean`\n\nExecutes the chain for side effects only and reports whether anything matched. Handlers have\nalready run by this point (matching is eager), so this is just the terminal that gives you the\nboolean instead of a value.\n\n**Returns:** `true` if a case matched, `false` otherwise\n\n**Example:**\n\n```typescript\nconst handled = match(action)\n  .on('save', () => saveData())\n  .on('delete', () => deleteData())\n  .run()\n\nif (!handled) console.warn(`Unknown action: ${action}`)\n```\n\n### `isMatched: boolean`\n\nRead-only getter for the current match state. Unlike `run()` it does not terminate the chain, so\nyou can inspect a matcher and keep adding cases.\n\n**Example:**\n\n```typescript\nconst matcher = match('test').on('test', () => 'matched')\nconsole.log(matcher.isMatched) // true\n```\n\n### `UnhandledMatchError`\n\nCustom error thrown when no case matches and no default handler is provided.\n\n**Properties:**\n\n- `name` - \"UnhandledMatchError\"\n- `message` - Contains the unmatched value\n\n**Example:**\n\n```typescript\ntry {\n  match('foo')\n    .on('bar', () => 'bar')\n    .get()\n} catch (error) {\n  if (error instanceof UnhandledMatchError) {\n    console.error('No match found for:', error.message)\n  }\n}\n```\n\n## Usage Examples\n\n### Predicate Matching\n\nBeyond PHP: any `on()` pattern may be a function, in which case it is called with the subject and\nmatches when it returns truthy.\n\n```typescript\nconst grade = (score: number): string => {\n  return match(score)\n    .on(\n      (n) => n >= 90,\n      () => 'A'\n    )\n    .on(\n      (n) => n >= 80,\n      () => 'B'\n    )\n    .on(\n      (n) => n >= 70,\n      () => 'C'\n    )\n    .otherwise(() => 'F')\n}\n\nconsole.log(grade(95)) // \"A\"\nconsole.log(grade(85)) // \"B\"\nconsole.log(grade(45)) // \"F\"\n```\n\nLiterals and predicates mix freely in one chain — first match wins either way:\n\n```typescript\nconst describe = (score: number | string): string => {\n  return match(score)\n    .on('N/A', () => 'Not available')\n    .on(\n      (v) => typeof v === 'number' && v > 80,\n      () => 'High'\n    )\n    .otherwise(() => 'Low')\n}\n\nconsole.log(describe('N/A')) // \"Not available\"\nconsole.log(describe(90)) // \"High\"\nconsole.log(describe(60)) // \"Low\"\n```\n\n> **A function subject disables predicate matching.** When the subject is itself a function, `on()`\n> compares patterns by reference instead of calling them — otherwise you could never match a\n> function value literally. The predicate is silently never invoked and the case just falls\n> through, with no error. See [Supported Types](#supported-types).\n\n### Basic String Matching\n\n```typescript\nimport { match } from '@anilkumarthakur/match'\n\nconst getRole = (role: string) => {\n  return match(role)\n    .on('admin', () => 'Full access')\n    .on('user', () => 'Limited access')\n    .on('guest', () => 'Read-only access')\n    .otherwise(() => 'Unknown role')\n}\n\nconsole.log(getRole('admin')) // \"Full access\"\n```\n\n### Number Matching (HTTP Status Codes)\n\n```typescript\nconst handleResponse = (statusCode: number) => {\n  return match(statusCode)\n    .on(200, () => 'OK')\n    .onAny([201, 202, 204], () => 'Created/Accepted')\n    .on(400, () => 'Bad Request')\n    .on(401, () => 'Unauthorized')\n    .on(404, () => 'Not Found')\n    .on(500, () => 'Server Error')\n    .otherwise(() => 'Unknown Status')\n}\n\nconsole.log(handleResponse(200)) // \"OK\"\nconsole.log(handleResponse(201)) // \"Created/Accepted\"\nconsole.log(handleResponse(999)) // \"Unknown Status\"\n```\n\n### Complex Notifications\n\n```typescript\nconst showNotification = (type: string, message: string) => {\n  const styling = match(type)\n    .on('success', () => ({ color: 'green', icon: '✓' }))\n    .on('error', () => ({ color: 'red', icon: '✗' }))\n    .on('warning', () => ({ color: 'orange', icon: '⚠' }))\n    .on('info', () => ({ color: 'blue', icon: 'ℹ' }))\n    .otherwise(() => ({ color: 'gray', icon: '•' }))\n\n  return `[${styling.icon}] ${message}`\n}\n\nconsole.log(showNotification('success', 'Saved!')) // \"[✓] Saved!\"\nconsole.log(showNotification('error', 'Failed!')) // \"[✗] Failed!\"\n```\n\n### Nested Match Expressions\n\n```typescript\nconst getUserStatus = (userId: string, status: string) => {\n  return match(userId)\n    .on('admin', () => {\n      return match(status)\n        .on('active', () => 'Admin is active')\n        .on('inactive', () => 'Admin is inactive')\n        .otherwise(() => 'Admin status unknown')\n    })\n    .on('user', () => {\n      return match(status)\n        .on('active', () => 'User is active')\n        .otherwise(() => 'User is inactive')\n    })\n    .otherwise(() => 'User not found')\n}\n\nconsole.log(getUserStatus('admin', 'active')) // \"Admin is active\"\nconsole.log(getUserStatus('user', 'active')) // \"User is active\"\nconsole.log(getUserStatus('guest', 'active')) // \"User not found\"\n```\n\n### Type-Safe Unions\n\n```typescript\ntype LogLevel = 'debug' | 'info' | 'warn' | 'error'\n\nconst getLogColor = (level: LogLevel): string => {\n  return match(level)\n    .on('debug', () => 'gray')\n    .on('info', () => 'blue')\n    .on('warn', () => 'yellow')\n    .on('error', () => 'red')\n    .otherwise(() => 'white')\n}\n\nconsole.log(getLogColor('info')) // \"blue\"\n```\n\n### Conditional Logic with match(true)\n\n```typescript\nconst getUserMessage = (age: number, isPremium: boolean) => {\n  return match(true)\n    .on(age < 13, () => 'Not eligible')\n    .on(age >= 13 && age < 18, () => 'Teen user')\n    .on(age >= 18 && !isPremium, () => 'Free user')\n    .on(age >= 18 && isPremium, () => 'Premium user')\n    .otherwise(() => 'Unknown')\n}\n\nconsole.log(getUserMessage(25, true)) // \"Premium user\"\nconsole.log(getUserMessage(16, false)) // \"Teen user\"\n```\n\n### Days in Month (Real-World Example)\n\n```typescript\nconst daysInMonth = (month: string, year: number): number => {\n  const isLeap = (y: number) => y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0)\n\n  return match(month.toLowerCase().slice(0, 3))\n    .on('jan', () => 31)\n    .on('feb', () => (isLeap(year) ? 29 : 28))\n    .on('mar', () => 31)\n    .on('apr', () => 30)\n    .on('may', () => 31)\n    .on('jun', () => 30)\n    .on('jul', () => 31)\n    .on('aug', () => 31)\n    .on('sep', () => 30)\n    .on('oct', () => 31)\n    .on('nov', () => 30)\n    .on('dec', () => 31)\n    .otherwise(() => {\n      throw new Error('Invalid month')\n    })\n}\n\nconsole.log(daysInMonth('February', 2024)) // 29 (leap year)\nconsole.log(daysInMonth('February', 2025)) // 28\n```\n\n## Comparison with PHP match()\n\n### PHP\n\n```php\n$result = match($status) {\n    'success', 'ok' => 'All good',\n    'error', 'fail' => 'Something went wrong',\n    default => 'Unknown'\n};\n```\n\n### JavaScript (this library)\n\n```typescript\nconst result = match(status)\n  .onAny(['success', 'ok'], () => 'All good')\n  .onAny(['error', 'fail'], () => 'Something went wrong')\n  .otherwise(() => 'Unknown')\n```\n\n## Supported Types\n\nThe library supports matching on any JavaScript type. Literal comparison uses `Object.is()`, **not**\n`===`:\n\n- ✅ Strings\n- ✅ Numbers (including `Infinity`, `-Infinity`, `NaN`)\n- ✅ Booleans\n- ✅ null / undefined\n- ✅ Symbols\n- ✅ BigInt\n- ✅ Objects (by reference)\n- ✅ Arrays (by reference)\n- ✅ Functions (by reference)\n- ✅ Enums\n- ✅ Class instances (by reference)\n\n### `Object.is()`, not `===`\n\nThe two operators diverge on exactly two values, and the difference is deliberate:\n\n```typescript\n// NaN matches NaN — `NaN === NaN` is false, `Object.is(NaN, NaN)` is true\nmatch(NaN)\n  .on(NaN, () => 'matched NaN')\n  .otherwise(() => 'no match') // → \"matched NaN\"\n\n// +0 and -0 are distinct — `+0 === -0` is true, `Object.is(+0, -0)` is false\nmatch(+0)\n  .on(-0, () => 'negative zero')\n  .on(+0, () => 'positive zero')\n  .otherwise(() => 'default') // → \"positive zero\"\n```\n\n`onAny()` uses `Object.is()` per element, so the same rules apply there.\n\n### Function subjects\n\nBecause functions are matched by reference, a function-valued subject turns off predicate matching\nfor the whole chain — the pattern is compared to the subject rather than called:\n\n```typescript\nconst fn = () => 'subject'\n\nmatch(fn)\n  .on(\n    (v) => true,\n    () => 'predicate ran'\n  ) // never invoked\n  .otherwise(() => 'fell through') // → \"fell through\"\n\nmatch(fn)\n  .on(fn, () => 'matched by reference')\n  .otherwise(() => 'no match') // → \"matched by reference\"\n```\n\nThere is no error or warning — the case simply does not fire. If you need guards over a function\nvalue, match on something else (`match(true)` with boolean conditions, or a derived key).\n\n## Type Safety\n\nFull TypeScript support with automatic type inference:\n\n```typescript\n// Explicit types\nconst result = match<string, number>('test')\n  .on('test', () => 123)\n  .otherwise(() => 456)\n\n// Inferred types\nconst result2 = match('test')\n  .on('test', () => 'result') // Inferred as string result\n  .otherwise(() => 'default')\n\n// Union types\ntype Status = 'success' | 'pending' | 'error'\nconst result3 = match<Status, string>('success')\n  .on('success', () => 'Done')\n  .on('pending', () => 'In progress')\n  .on('error', () => 'Failed')\n  .otherwise(() => 'Unknown')\n```\n\n## Performance\n\n- ⚡ Sequential `Object.is()` scan — O(N) in the number of cases, with no `Map` and no lookup table\n  to allocate. Eager chaining is what makes that inherent: a handler must be able to run the moment\n  its `.on()` is evaluated, so there is nothing to index ahead of time. For the case counts a\n  `match` expression realistically has, a few identity comparisons beat building a hash map.\n- 💾 Only the first matching handler executes; later `.on()` calls short-circuit to no-ops\n- 📦 Roughly 3 kB raw / 1 kB gzipped per format (ESM, CJS, IIFE)\n\n## Testing\n\nThe library ships a comprehensive test suite at 100% code coverage:\n\n```bash\n# Run all tests\nnpm test\n\n# Run with coverage\nnpm run test:coverage\n\n# Watch mode\nnpm test -- --watch\n```\n\nTest categories:\n\n- Basic functionality\n- Type matching (strings, numbers, booleans, objects, arrays, etc.)\n- All API methods (`on`, `onAny`, `otherwise`, `default`, `get`/`valueOf`, `run`, `isMatched`)\n- Predicate matching and function subjects\n- Error handling\n- Type safety\n- Real-world examples\n- Edge cases and performance\n\n## Browser Support\n\nWorks in all modern browsers. The published `engines.node` range is `>=22`, and the build targets\nES2022. The Node floor follows the LTS schedule — it is the oldest LTS line still in maintenance and\nrises as older lines reach end-of-life — so the supported runtimes are:\n\n- Chrome/Edge (latest)\n- Firefox (latest)\n- Safari (latest)\n- Node.js 22+ (active LTS lines)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n### Development\n\nThis is a pnpm workspace; run these from the repository root.\n\n```bash\n# Install dependencies\npnpm install\n\n# Run tests\npnpm run test\n\n# Build\npnpm run build\n\n# Lint and format\npnpm run lint\npnpm run format\n\n# Typecheck + lint + format:check + test, in one shot\npnpm run verify\n```\n\n## License\n\nMIT - See [LICENSE](LICENSE) for details\n\n## Author\n\n[Anil Kumar Thakur](https://github.com/anilkumarthakur60)\n\n## Related\n\n- [PHP match expression](https://www.php.net/manual/en/control-structures.match.php) - Official PHP documentation\n- [JavaScript switch statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release history and updates.\n","readmeFilename":"","author":{"name":"Anil Kumar Thakur","url":"https://github.com/anilkumarthakur60"}}