xmatcher

Pattern matching library

Usage no npm install needed!

<script type="module">
  import xmatcher from 'https://cdn.skypack.dev/xmatcher';
</script>

README

xMatcher

Description

Library of pattern matching based on pure types and symbols

Usage

[sudo] npm i -S xmatcher

Example

const matcher = require('xmatcher');

console.log(matcher.matches({ 'foo': 1, 'bar': 2, 'baz': 3, '_': 'Common value' }, 'bar'));
// [ 2 ]