This is the easy part, provided you have
npm install stablematch
Here is an example of how to pair up two six-element sets. Note the
use of amdefine, which allows
if typeofdefine !== 'function'var define = module;;
Performance and Optimality
The implementation is not intended to be the world's best... It was, after all, a quick-n-dirty implementation done one Saturday morning just so that a basic pairing could be done inside the syncml-js package...
If you care to improve it in any way, please do so! I'll accept any pull requests that don't break it and improve performance.