{"_id":"sparkler","_rev":"34-5612023a902b13ba5605fb775980f6f3","name":"sparkler","description":"Native pattern matching for JavaScript","dist-tags":{"latest":"0.3.5"},"versions":{"0.1.0":{"name":"sparkler","version":"0.1.0","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.2.4","mocha":"~1.13.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.0","dist":{"shasum":"9ac67d8fa633b91546cdb5dad667989868a440b5","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.0.tgz","integrity":"sha512-EHBqpV6Giabo/Wdm93nVceJ+KLU8ZJgIEbaxeZc02f16niyN+RxxL5pBnCmglZ0k6ly1+60S9wF7AbR/Hb3xvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBUNshp1T7OtLoeHYwB7WMz5ZE9ZAgmhIHkMzFk+yeFAiEA181umAGmlOtAN+vrF/v6oXXuE5m/Zpf8x61XSv540hE="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.1":{"name":"sparkler","version":"0.1.1","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.2.4","mocha":"~1.13.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.1","dist":{"shasum":"0ffddd967e59f38db4200f52c0af789f40d0fe3a","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.1.tgz","integrity":"sha512-JFDZ1UvHhimXVVuhmreiEc2SZymB5eM8a5wheqSebSc26p4/i/b55zQ3ZT5ZI8ysw1FoaewN+qSBjZN+AV/EJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi6nJPOpq0kpauW01Um8CQt+/2FA4jZ9Q1ZqZoInRHpwIgYeyKD3r7/KkwMZJPU2JbYNUUaok68ZIy8iiMufFDp+g="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.2":{"name":"sparkler","version":"0.1.2","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.2.4","mocha":"~1.13.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.2","dist":{"shasum":"c8df464d1db73b26db9d33494cfb5f5ee7fc2e28","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.2.tgz","integrity":"sha512-5a6WSQ8rfm9r6NI1AT5arHg9P9uTWODfDNaHM0Gk+56OycJkiwAU2hd2bGUGJyno9TltLmOpIUAXs5nCTlaB/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJCwhVdaOcvUFSWWBznICp4kxVy9Jm3WaUmcWgvURwVwIhALhBYKzIoZL+DhxpF/A8JIg0L6RuQ3Lt3MmwvaPEER3Q"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.3":{"name":"sparkler","version":"0.1.3","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.2.4","mocha":"~1.13.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.3","dist":{"shasum":"601e2434b221a7771e358239af8bf21ed764b2dc","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.3.tgz","integrity":"sha512-fIX/p0GxuQWcrXJ877h1KBtNysdz90Jx8OtqEIYBTMusO01fQK8Ons2fpHooy30EkOHihY/SLc5vjL3+QrcmOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcUzUd+tBnt1hcegYzwFkqMI3+yLhQR64LuOR9Vtm71QIhAOLdzwL9E9JId9NG81crCCyZEh2aeurmFOLcAiC8UgiY"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.4":{"name":"sparkler","version":"0.1.4","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.3.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.4","dist":{"shasum":"ab0aef551e10cc654ac71f9196bf5266d8307c5b","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.4.tgz","integrity":"sha512-5dfxpJey8ewruYWvqBS8sr1yH3w+ChVLZuHNKKGIkgJdaBA39TASZe6nr5e5gkFS6Lz4H2mCKiTvoUIe0DOv7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6V6b6vnxYwAqYJQn0/iNeQINIO+VAtxY87zKjFv2FYAiBHiO2kRwN6uZaHTuEfg3xJawI2EJujukZfxwTBSSx1pw=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.5":{"name":"sparkler","version":"0.1.5","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.3.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"_id":"sparkler@0.1.5","dist":{"shasum":"0b8a12c80527650433bf715ac2477afc809e1a33","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.5.tgz","integrity":"sha512-lcgoEQO7xG7tk67WspcLYLaSKJKwJ2p8BZRO5YCtLbm9JiSkBoltM4MRlxx2KMKqIBt9rX6CAvHcq35v1q8Tjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHiTiOIcuSE1Vgm1bc2/9YDDh+cu7i/K2YsjRn53r5hMAiAXp9YfGODALiO841gfe47OeNBsKiOqPJ/5EEQOE4RRQA=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.1.6":{"name":"sparkler","version":"0.1.6","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.4.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"_id":"sparkler@0.1.6","dist":{"shasum":"b2f33894eb8713b0ccb8fa1e5a11b62e20a549ac","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.1.6.tgz","integrity":"sha512-wOW/JpqmprS6mUZVAlf8OC6TGC1yBtwzIcugO4QpfTQYmIHVMbdirztDhQK1cF/HK1T7tLqt8TuLiPj4MIEpNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFpr0sanBgEvbuSNDmOv8rmuwCVfCAmSJTVGS7J50YMPAiEA4KyxjunEd2ppOzKLE9DwZr3wXVK4uJ2yPJxuaX2lU8I="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.2.0":{"name":"sparkler","version":"0.2.0","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.2.0","dist":{"shasum":"18582fd9550bb9639825b9869667c88c715132c4","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.2.0.tgz","integrity":"sha512-EfXLXUzzMu5O0zvaEdkzKTYnE678rdKplQZFX4psS97VLAfHlCSMG7mmh7/qOuJrb0B0JaXmhZU9XxJPU49SFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM9ExVYeYZ4q3w2+DEVQaAMO3vsQAPkedDA2YshdGKpAIhAO7DKzHXa6oG6xqr0KL9qbSlzjx+edM4TnuJ9TE8yxR6"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.2.1":{"name":"sparkler","version":"0.2.1","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.2.1","dist":{"shasum":"a9035fbe139641934e60d0c6b142aa0001f41fce","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.2.1.tgz","integrity":"sha512-e/Msj26eqYYuIVfvSe5qgN+yVzKLIa7pojmDm8ujChatu5kQaiJwM91A97VnZCRY1UC7Og8ZSfI8qxeMH7lXLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBz9UJn94+CitaUbkRmBYUbiQlc4jXYeSq1E+n1h8To6AiB8h33ItnT6iI4l2VyPrGd3EBOoyVWqBwctOSqTqEU83g=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.0":{"name":"sparkler","version":"0.3.0","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.0","dist":{"shasum":"0a2bb3d4fc962506929fba3dc6c64816a267f253","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.0.tgz","integrity":"sha512-p9WA8ungHfNyO32pANP2Eg0+g/42lxV9tqzpU4783eCxDCHTv48Q8l5EohPKBpq53v6uZMgrbXSvNgW2+WvZZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXy1A3zTNtvF5g541HST1lhzVYZd997836CwHkOKbOZwIhAKjdHxvsQtwfIaZIy6PNtegROfe9sfVTGmhQNn0zI+ge"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.1":{"name":"sparkler","version":"0.3.1","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.1","dist":{"shasum":"411448ffbdefc218899c896bec6341dae28889e9","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.1.tgz","integrity":"sha512-6HyMM8bQ/N8ylhsYLql4jWrTJI02wjdCzVSttcehC4rNUa6lPnrqw3yI6QDtLB6znxul3yPpslNfzlRhsAg9Hw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCC9QFEJhiFglUBOnslp8O1gsqBIEY3X4aMfUw7fmHAzwIgIw/muztLx+3Uv6qMx4pp/UJ6ag3PtVueBYlDurcafO4="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.2":{"name":"sparkler","version":"0.3.2","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.0","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.2","dist":{"shasum":"ec797d5f2147f1f51b966b8469033d7f33f2ecb4","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.2.tgz","integrity":"sha512-jQzCKu7d2JySGtyG9YsAzWoZGE43j08wREpYttW3NqtBC0e5p3/d3Imuno/iubI6WoYXsnk6SxFoPgScWSzJ+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICaaIQ4cocxOGrrinATDGy0qUlrI6cpFT2v+rtbv7P6KAiB95KNSH3N3biSL/Qqc6t+7tlnn/XhkIIPlf1vXsqTNNA=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.3":{"name":"sparkler","version":"0.3.3","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.1","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.3","dist":{"shasum":"8f29518f32640d67ff297067670512f98304a38a","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.3.tgz","integrity":"sha512-M+IaUV/sejFR6KS9ymNGU5JOrDPHN23zSk5INYP5KMgMjv8pRLC7j5dsuOuapXu7Oj8ccJqNcxybvJ1HIcfVGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7ym7tM667c0TQQ63eGvD91zJXXQlwqvPZPWmxAsl1FAiBgh2aJ2eqi2wLPoyUgl73ZUKGPKwYxxSOcqZTBrPZIXA=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.4":{"name":"sparkler","version":"0.3.4","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.1","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.4","dist":{"shasum":"d0ed17483d6bac5780d5835b8e8b60596234a74d","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.4.tgz","integrity":"sha512-mkpluEdb4XbJpW/ZeG1ngYZ9LwQFasL7WVi1JW9I3l6s6BtEOSujKip1bjoZLngHvV3TGqgckv9lwTv6dKJx+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgguIBFW3cqDkSakZsPnGKyH+TEdrAVRuswayTmRmnGAiBUzbSp5ge9SEQKW1/uPqWqrlhVatbRQ/7zF6cYf+81MA=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]},"0.3.5":{"name":"sparkler","version":"0.3.5","description":"Native pattern matching for JavaScript","scripts":{"test":"grunt test"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"license":"MIT","devDependencies":{"grunt":"~0.4.1","sweet.js":"~0.6.1","chai":"~1.8.0","grunt-mocha-test":"~0.7.0"},"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"homepage":"https://github.com/natefaubion/sparkler","_id":"sparkler@0.3.5","dist":{"shasum":"ee546aee41af62f54b27970a61f09fa81c852487","tarball":"https://registry.npmjs.org/sparkler/-/sparkler-0.3.5.tgz","integrity":"sha512-F7c9XJISy0O2r8FlK/5H4ay9goy/gJ539GidIPmnGuFV5YBLd4VkKWkgDdLeFO3+WsFGUKmgrG7JGTnae0u6Uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqj05hoTSb4APWLpg2XHj5sohklaTTCEHv0ZYK3YUYrAiEA3aYuHCwKb9YHrx3clZaRgelTBw8inA0xhWaTeP0d0HI="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"natefaubion","email":"nathan@n-son.com"},"maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}]}},"readme":"sparkler\n========\n\nSparkler is a pattern matching engine for JavaScript built using\n[sweet.js](https://github.com/mozilla/sweet.js) macros, so it looks and feels\nlike native syntax. It has no runtime dependencies and compiles down to simple\n`if`s and `for`s.\n\nHere's a small slice of what you can do with it:\n\n```js\nfunction myPatterns {\n  // Match literals\n  42 => 'The meaning of life',\n\n  // Tag checking for JS types using Object::toString\n  a @ String => 'Hello ' + a,\n\n  // Array destructuring\n  [...front, back] => back.concat(front),\n\n  // Object destructuring\n  { foo: 'bar', x, 'y' } => x,\n\n  // Custom extractors\n  Email { user, domain: 'foo.com' } => user,\n\n  // Rest arguments\n  (a, b, ...rest) => rest,\n\n  // Rest patterns (mapping a pattern over many values)\n  [...{ x, y }] => _.zip(x, y),\n\n  // Guards\n  x @ Number if x > 10 => x\n}\n```\n\nYou can see a slew of more examples in the\n[pattern spec file](https://github.com/natefaubion/sparkler/blob/master/test/patterns.sjs)\n\nInstall\n-------\n\n    npm install -g sweet.js\n    npm install sparkler\n    sjs -m sparkler/macros myfile.js\n\nHow Does It Work?\n-----------------\n\nSparkler overloads the `function` keyword as a macro (don't worry, all your old\nfunctions will still work) but implements a slightly different syntax. There's\nno argument list after the name or function keyword. Instead the function body\nis just a set of ES6 style arrow-lambdas separated by commas.\n\n```js\nfunction myFunc {\n  // Single arguments don't need parens and simple expression \n  // bodies get an implicit `return`.\n  a @ String => 'Hello ' + a,\n\n  // Add parens and braces if you need more.\n  (x, y, z) => {\n    return x + y + z;\n  }\n}\n```\n\nYou can also do this with anonymous functions:\n\n```js\nDB.getResource('123', function {\n  (null, resp) => complete(resp),\n  (err) => handleError(err)\n})\n```\n\nIf no case matches, a `TypeError('No match')` is thrown.\n\nOptimization\n------------\n\nSparkler doesn't just try each case one at a time until one passes. That would\nbe really inefficient. Instead, it analyzes your entire pattern matrix, and\nrearranges things as needed to get an optimized set of tests while still\npreserving the left-to-right, top-down semantics.\n\n```js\nfunction expensiveExtraction {\n  (MyExtractor(x, y, z), 1) => doThis(),\n  (MyExtractor(x, y, z), *) => doThat()\n}\n```\n\nLet's say `MyExtractor` is really expensive. Sparkler efficiently backtracks,\nso it will only get called once in this set of tests.\n\nArgument Length\n---------------\n\nIn JavaScript, you can call a function with any number of arguments. Arguments\nthat are not provided are just set to `undefined`. Sparkler does not implicitly\nmatch on argument length.\n\n```js\nfunction ambiguous {\n  (a)       => 1,\n  (a, b)    => 2,\n  (a, b, c) => 3\n}\n```\n\nThe above function will __always__ return `1` no matter how many arguments you\ncall it with as the first case always matches. The subsequent cases are\nactually removed from the final output in the optimization phase.\n\nIf you want to match on specific argument length, you need to add a guard to\nyour case.\n\n```js\nfunction argCheck {\n  // Using arguments.length\n  (a, b, c) if arguments.length == 3 => 1,\n  // Or matching undefined\n  (a, b, undefined) => 2,\n  (a) => 1\n}\n```\n\nThe only time Sparkler is strict with argument length is with the empty\nparameter list `()`. It will check that `arguments.length` is zero. This is so\nyou can do stuff like this:\n\n```js\nFoo.prototype = {\n  // jQuery-style getter/setter\n  val: function {\n    ()  => this._val,\n    val => {\n      this._val = val;\n      return this;\n    }\n  }\n}\n```\n\nIf you want a catch-all, you should use a wildcard (`*`) or `default` instead.\n\nMatch Keyword\n-------------\n\nSparkler exports a `match` macro for doing easy matching in any position.\n\n### Match Expressions\n\nMatch expressions look like `function` matching, except you provide the\nargument(s) upfront.\n\n```js\nvar num = 12;\nvar isNumber = match num {\n  Number => true,\n  *      => false\n};\n```\n\nThis works by desugaring `match` into a self-invoking function with `num` as\nthe argument. Consequently, `match` expressions do not support `break`,\n`continue`, and early `return`. Using a `match` expression in statement\nposition will result in a parse error.\n\n### Match Statements\n\nMatch statements use a slightly different syntax. They look like a suped up\n`switch`.\n\n```js\nvar a = Foo(Foo(Foo(42)));\nwhile (1) {\n  match a {\n    case Foo(inner):\n      a = inner;\n    default:\n      break;\n  }\n}\n```\n\nUnlike `switch`es, `case`s in a `match` statement do not fall through. Early\n`return`, `break`, and `switch` are all supported. Using a `match` statement in\nexpression position will result in a parse error.\n\n### Multiple Matches\n\nYou can match on multiple expressions at once in both `match` expressions and\nstatements.\n\n```js\nvar allNums = match (num1, num2, num3) {\n  (Number, Number, Number) => true,\n  *                        => false\n};\n\nmatch (num1, num2, num3) {\n  case (Number, Number, Number):\n    allNums = true;\n  default:\n    allNums = false;\n}\n```\n\n### Pattern Bindings and Hoisting\n\nAll bindings in patterns are declared as `var`s by default, as it is the most\nwidely supported declaration form. Consequently, they will hoist outside of\n`match` statements. You may specify your declaration form by prefixing pattern\nbindings with one of `var`, `let`, or `const`.\n\n```js\nmatch x {\n  case Foo(a):       ... // will hoist\n  case Foo(var a):   ... // will hoist\n  case Foo(let a):   ... // will not hoist\n  case Foo(const a): ... // will not hoist, immutable\n}\n```\n\nCustom Extractors\n-----------------\n\nYou can match on your own types by implementing a simple protocol. Let's build\na simple extractor that parses emails from strings:\n\n```js\nvar Email = {\n  // Factor out a matching function that we'll reuse.\n  match: function {\n    x @ String => x.match(/(.+)@(.+)/),\n    *          => null\n  },\n\n  // `hasInstance` is called on bare extractors.\n  hasInstance: function(x) {\n    return !!Email.match(x);\n  },\n\n  // `unapply` is called for array-like destructuring.\n  unapply: function(x) {\n    var m = Email.match(x);\n    if (m) {\n      return [m[1], m[2]];\n    }\n  },\n\n  // `unapplyObject` is for object-like destructuring.\n  unapplyObject: function(x) {\n    var m = Email.match(x);\n    if (m) {\n      return {\n        user: m[1],\n        domain: m[2]\n      };\n    }\n  }\n};\n```\n\nNow we can use it in case arguments:\n\n```js\nfunction doStuffWithEmails {\n  // Calls `unapplyObject`\n  Email { domain: 'foo.com' } => ...,\n  \n  // Calls 'unapply'\n  Email('foo', *) => ...,\n\n  // Calls `hasInstance`\n  Email => ...\n}\n```\n\nIf you don't implement `hasInstance`, Sparkler will fall back to a simple\n`instanceof` check.\n\n### adt-simple\n\n[adt-simple](https://github.com/natefaubion/adt-simple) is a library that\nimplements the extractor protocol out of the box, and even has its own set of\nmacros for defining data-types.\n\n```js\nvar adt = require('adt-simple');\nunion Tree {\n  Empty,\n  Node {\n    value : *,\n    left  : Tree,\n    right : Tree\n  }\n} deriving (adt.Extractor)\n\nfunction treeFn {\n  Empty => 'empty',\n  Node { value @ String } => 'string'\n}\n```\n\nOptional Extensions\n-------------------\n\nSparkler also provides a small library that extends some of the native types\nwith convenient functions.\n\n```js\nrequire('sparkler/extend');\n\n// Date destructuring\nfunction dateStuff {\n  Date { month, year } => ...\n}\n\n// RegExp destructuring\nfunction regexpStuff {\n  RegExp { flags: { 'i' }} => ...\n}\n\n// Partial-function composition with `orElse`\nfunction partial {\n  Foo => 'foo'\n}\n\nvar total = partial.orElse(function {\n  * => 'anything'\n})\n```\n\n`orElse` is added to the prototype safely using `defineProperty`\nand isn't enumerable.\n\n***\n\n### Author\n\nNathan Faubion (@natefaubion)\n\n### License\n\nMIT\n","maintainers":[{"name":"natefaubion","email":"nathan@n-son.com"}],"time":{"modified":"2022-06-26T22:35:29.770Z","created":"2013-10-10T03:17:44.372Z","0.1.0":"2013-10-10T03:17:50.451Z","0.1.1":"2013-10-14T02:00:38.129Z","0.1.2":"2013-10-16T01:23:00.877Z","0.1.3":"2013-10-19T14:41:47.007Z","0.1.4":"2013-12-09T23:06:38.963Z","0.1.5":"2013-12-14T04:52:11.155Z","0.1.6":"2014-01-11T14:40:51.882Z","0.2.0":"2014-05-10T22:00:39.416Z","0.2.1":"2014-05-20T01:05:41.032Z","0.3.0":"2014-06-16T02:02:12.074Z","0.3.1":"2014-06-19T00:13:10.929Z","0.3.2":"2014-06-19T01:26:56.709Z","0.3.3":"2014-06-23T22:01:35.877Z","0.3.4":"2014-09-19T01:07:12.984Z","0.3.5":"2014-11-26T04:13:21.278Z"},"author":{"name":"Nathan Faubion","email":"nathan@n-son.com"},"repository":{"type":"git","url":"https://github.com/natefaubion/sparkler.git"},"homepage":"https://github.com/natefaubion/sparkler","keywords":["pattern","matching","patterns","matches","functional","macro","macros","sweet-macros"],"bugs":{"url":"https://github.com/natefaubion/sparkler/issues"},"license":"MIT","readmeFilename":"README.md","users":{"yuchi":true}}