{"_id":"samsam","_rev":"102848","name":"samsam","description":"Value identification and comparison functions","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"time":{"modified":"2021-06-03T10:36:17.000Z","created":"2012-07-14T08:11:42.495Z","1.3.0":"2017-10-03T07:19:22.891Z","1.2.1":"2016-02-17T06:49:58.855Z","1.2.0":"2016-02-16T07:36:44.060Z","1.1.3":"2015-11-14T13:53:33.846Z","1.1.2":"2014-12-11T20:38:33.306Z","1.1.1":"2014-03-26T09:33:53.823Z","1.1.0":"2013-10-18T20:08:08.446Z","1.0.1":"2013-09-22T21:37:26.493Z","1.0.0":"2013-09-16T22:34:56.978Z","0.1.1":"2012-07-19T23:21:09.599Z","0.1.0":"2012-07-14T08:11:42.495Z"},"users":{"matiasherranz":true},"author":{"name":"Christian Johansen"},"repository":{"type":"git","url":"git+https://github.com/busterjs/samsam.git"},"versions":{"1.3.0":{"name":"samsam","version":"1.3.0","description":"Value identification and comparison functions","homepage":"http://docs.busterjs.org/en/latest/modules/samsam/","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"license":"BSD-3-Clause","main":"./lib/samsam","repository":{"type":"git","url":"git+https://github.com/busterjs/samsam.git"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-buster":"0.4.x","grunt-cli":"0.1.x","buster":"0.7.x","phantomjs":"1.9.x"},"gitHead":"cf67766c3d80859174cc3eae38c5922baccbae9e","bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"reinseth","email":"gar@prepost.net"},"dist":{"shasum":"8d1d9350e25622da30de3e44ba692b5221ab7c50","size":11093,"noattachment":false,"key":"/samsam/-/samsam-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.3.0.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/samsam-1.3.0.tgz_1507015161888_0.9069395666010678"},"directories":{},"publish_time":1507015162891,"_hasShrinkwrap":false,"_cnpm_publish_time":1507015162891,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam"},"1.2.1":{"name":"samsam","version":"1.2.1","description":"Value identification and comparison functions","homepage":"http://docs.busterjs.org/en/latest/modules/samsam/","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"license":"BSD-3-Clause","main":"./lib/samsam","repository":{"type":"git","url":"git+https://github.com/busterjs/samsam.git"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-buster":"0.4.x","grunt-cli":"0.1.x","buster":"0.7.x","phantomjs":"1.9.x"},"gitHead":"7dbefccb03cbe8f5ecfedda41cb20d1ae3514e5c","bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.2.1","_shasum":"edd39093a3184370cb859243b2bdf255e7d8ea67","_from":".","_npmVersion":"2.14.15","_nodeVersion":"4.2.2","_npmUser":{"name":"cjohansen","email":"christian@cjohansen.no"},"dist":{"shasum":"edd39093a3184370cb859243b2bdf255e7d8ea67","size":12336,"noattachment":false,"key":"/samsam/-/samsam-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.2.1.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/samsam-1.2.1.tgz_1455691794871_0.4617163052316755"},"directories":{},"publish_time":1455691798855,"_cnpm_publish_time":1455691798855,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam"},"1.2.0":{"name":"samsam","version":"1.2.0","description":"Value identification and comparison functions","homepage":"http://docs.busterjs.org/en/latest/modules/samsam/","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"license":"BSD-3-Clause","main":"./lib/samsam","repository":{"type":"git","url":"git+https://github.com/busterjs/samsam.git"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-buster":"0.4.x","grunt-cli":"0.1.x","buster":"0.7.x","phantomjs":"1.9.x"},"gitHead":"cd649c17efb5b7b75b58fde5f23ae8f5860b3832","bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.2.0","_shasum":"be9ed3f0155be4a50b1c269403f875614d91a789","_from":".","_npmVersion":"2.14.15","_nodeVersion":"4.2.2","_npmUser":{"name":"cjohansen","email":"christian@cjohansen.no"},"dist":{"shasum":"be9ed3f0155be4a50b1c269403f875614d91a789","size":12081,"noattachment":false,"key":"/samsam/-/samsam-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.2.0.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/samsam-1.2.0.tgz_1455608200206_0.1596462035086006"},"directories":{},"publish_time":1455608204060,"_cnpm_publish_time":1455608204060,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam"},"1.1.3":{"name":"samsam","version":"1.1.3","description":"Value identification and comparison functions","homepage":"http://docs.busterjs.org/en/latest/modules/samsam/","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"license":"BSD-3-Clause","main":"./lib/samsam","repository":{"type":"git","url":"git+https://github.com/busterjs/samsam.git"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-buster":"0.4.x","grunt-cli":"0.1.x","buster":"0.7.x","phantomjs":"1.9.x"},"gitHead":"8998458179d51620f20094e669872b780bae1323","bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.1.3","_shasum":"9f5087419b4d091f232571e7fa52e90b0f552621","_from":".","_npmVersion":"3.3.12","_nodeVersion":"4.2.2","_npmUser":{"name":"dominykas","email":"hello@dominykas.com"},"dist":{"shasum":"9f5087419b4d091f232571e7fa52e90b0f552621","size":10270,"noattachment":false,"key":"/samsam/-/samsam-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.1.3.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1447509213846,"_cnpm_publish_time":1447509213846,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam"},"1.1.2":{"name":"samsam","version":"1.1.2","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"main":"./lib/samsam","repository":{"type":"git","url":"https://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js","test-debug":"node --debug-brk test/samsam-test.js"},"devDependencies":{"buster":"0.6.11"},"bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.1.2","_shasum":"bec11fdc83a9fda063401210e40176c3024d1567","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dwittner","email":"d.wittner@gmx.de"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"dist":{"shasum":"bec11fdc83a9fda063401210e40176c3024d1567","size":9974,"noattachment":false,"key":"/samsam/-/samsam-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.1.2.tgz"},"directories":{},"publish_time":1418330313306,"_cnpm_publish_time":1418330313306,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam"},"1.1.1":{"name":"samsam","version":"1.1.1","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"main":"./lib/samsam","repository":{"type":"git","url":"https://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js","test-debug":"node --debug-brk test/samsam-test.js"},"devDependencies":{"buster":"0.6.11"},"bugs":{"url":"https://github.com/busterjs/samsam/issues"},"_id":"samsam@1.1.1","dist":{"shasum":"48d64ee2a7aecaaeccebe2f0a68a49687d3a49b1","size":9909,"noattachment":false,"key":"/samsam/-/samsam-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.1.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dwittner","email":"d.wittner@gmx.de"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1395826433823,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1395826433823},"1.1.0":{"name":"samsam","version":"1.1.0","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"main":"./lib/samsam","repository":{"type":"git","url":"https://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js"},"devDependencies":{"buster":"0.6.11"},"_id":"samsam@1.1.0","dist":{"shasum":"0e5ab8aa2929ec50e5579ed5842dd207c966c642","size":9292,"noattachment":false,"key":"/samsam/-/samsam-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.1.0.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1382126888446,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1382126888446},"1.0.1":{"name":"samsam","version":"1.0.1","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"main":"./lib/samsam","repository":{"type":"git","url":"https://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js"},"devDependencies":{"buster":"0.6.11"},"_id":"samsam@1.0.1","dist":{"shasum":"06ab3f84166f17162cc6ad96c2610c22a33232eb","size":9281,"noattachment":false,"key":"/samsam/-/samsam-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.0.1.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1379885846493,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1379885846493},"1.0.0":{"name":"samsam","version":"1.0.0","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"Christian Johansen"},"contributors":[{"name":"Christian Johansen","email":"christian@cjohansen.no","url":"http://cjohansen.no"},{"name":"August Lilleaas","email":"august.lilleaas@gmail.com","url":"http://augustl.com"},{"name":"Daniel Wittner","email":"d.wittner@gmx.de","url":"https://github.com/dwittner"}],"main":"./lib/samsam","repository":{"type":"git","url":"https://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js"},"devDependencies":{"buster":"0.6.11"},"_id":"samsam@1.0.0","dist":{"shasum":"f3fc2139b8a9e7012f820af73ac1c959ea4923a6","size":9252,"noattachment":false,"key":"/samsam/-/samsam-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-1.0.0.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1379370896978,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1379370896978},"0.1.1":{"name":"samsam","version":"0.1.1","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"August Lilleaas and Christian Johansen"},"contributors":[{"name":"Christian Johansen","url":"christian@cjohansen.no"},{"name":"August Lilleaas","url":"august@augustl.com"}],"main":"./lib/samsam","repository":{"type":"git","url":"git://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js"},"dependencies":{"lodash":"~0.4"},"devDependencies":{"buster":"0.6.2"},"_npmUser":{"name":"cjohansen","email":"christian@cjohansen.no"},"_id":"samsam@0.1.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"a08edef94b8d7c8faa7b2ec2275c528b9d6c0a6b","size":7801,"noattachment":false,"key":"/samsam/-/samsam-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-0.1.1.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1342740069599,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1342740069599},"0.1.0":{"name":"samsam","version":"0.1.0","description":"Value identification and comparison functions","homepage":"http://busterjs.org/docs/buster-assertions","author":{"name":"August Lilleaas and Christian Johansen"},"contributors":[{"name":"Christian Johansen","url":"christian@cjohansen.no"},{"name":"August Lilleaas","url":"august@augustl.com"}],"main":"./samsam","repository":{"type":"git","url":"git://github.com/busterjs/samsam.git"},"scripts":{"test":"node test/samsam-test.js"},"devDependencies":{"buster-util":">=0.5","sinon":"~1.4"},"_npmUser":{"name":"cjohansen","email":"christian@cjohansen.no"},"_id":"samsam@0.1.0","dependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"57bda819f720cd7cf8c731ec58a3802a01532ffc","size":7987,"noattachment":false,"key":"/samsam/-/samsam-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/samsam/download/samsam-0.1.0.tgz"},"maintainers":[{"name":"augustl","email":"august@augustl.com"},{"name":"dominykas","email":"hello@dominykas.com"},{"name":"dwittner","email":"d.wittner@gmx.de"},{"name":"reinseth","email":"gar@prepost.net"}],"directories":{},"publish_time":1342253502495,"_hasShrinkwrap":false,"deprecated":"This package has been deprecated in favour of @sinonjs/samsam","_cnpm_publish_time":1342253502495}},"readme":"# samsam\n\n[![Build status](https://secure.travis-ci.org/busterjs/samsam.png?branch=master)](http://travis-ci.org/busterjs/samsam)\n\n> Same same, but different\n\n`samsam` is a collection of predicate and comparison functions useful for\nidentifiying the type of values and to compare values with varying degrees of\nstrictness.\n\n`samsam` is a general-purpose library with no dependencies. It works in browsers\n(including old and rowdy ones, like IE6) and Node. It will define itself as an\nAMD module if you want it to (i.e. if there's a `define` function available).\n\n`samsam` was originally extracted from the\n`referee <http://github.com/busterjs/referee/>`_ assertion library, which\nships with the Buster.JS testing framework.\n\n\n## Predicate functions\n\n\n### `isArguments(object)`\n\nReturns `true` if `object` is an `arguments` object, `false` otherwise.\n\n\n### `isNegZero(value)`\n\nReturns `true` if `value` is `-0`.\n\n\n## `isElement(object)`\n\nReturns `true` if `object` is a DOM element node. Unlike\nUnderscore.js/lodash, this function will return `false` if `object` is an\n*element-like* object, i.e. a regular object with a `nodeType` property that\nholds the value `1`.\n\n\n###`isDate(object)`\n\nReturns true if the object is a `Date`, or *date-like*. Duck typing of date\nobjects work by checking that the object has a `getTime` function whose return\nvalue equals the return value from the object's `valueOf`.\n\n\n## Comparison functions\n\n\n###`identical(x, y)`\n\nStrict equality check according to `EcmaScript Harmony's `egal`.\n\n**From the Harmony wiki:**\n\n> An egal function simply makes available the internal `SameValue` function\nfrom section 9.12 of the ES5 spec. If two values are egal, then they are not\nobservably distinguishable.\n\n`identical` returns `true` when `===` is `true`, except for `-0` and\n`+0`, where it returns `false`. Additionally, it returns `true` when\n`NaN` is compared to itself.\n\n\n### `deepEqual(obj1, obj2)`\n\nDeep equal comparison. Two values are \"deep equal\" if:\n\n* They are identical\n* They are both date objects representing the same time\n* They are both arrays containing elements that are all deepEqual\n* They are objects with the same set of properties, and each property\n  in `obj1` is deepEqual to the corresponding property in `obj2`\n\n\n### `match(object, matcher)`\n\nPartial equality check. Compares `object` with matcher according a wide set of\nrules:\n\n\n**String matcher**\n\nIn its simplest form, `match` performs a case insensitive substring match.\nWhen the matcher is a string, `object` is converted to a string, and the\nfunction returns `true` if the matcher is a case-insensitive substring of\n`object` as a string.\n\n```javascript\nsamsam.match(\"Give me something\", \"Give\"); //true\nsamsam.match(\"Give me something\", \"sumptn\"); // false\nsamsam.match({ toString: function () { return \"yeah\"; } }, \"Yeah!\"); // true\n```\n\nThe last example is not symmetric. When the matcher is a string, the `object`\nis coerced to a string - in this case using `toString`. Changing the order of\nthe arguments would cause the matcher to be an object, in which case different\nrules apply (see below).\n\n\n**Boolean matcher**\n\nPerforms a strict (i.e. `===`) match with the object. So, only `true`\nmatches `true`, and only `false` matches `false`.\n\n\n**Regular expression matcher**\n\nWhen the matcher is a regular expression, the function will pass if\n`object.test(matcher)` is `true`. `match` is written in a generic way, so\nany object with a `test` method will be used as a matcher this way.\n\n```javascript\nsamsam.match(\"Give me something\", /^[a-z\\s]$/i); // true\nsamsam.match(\"Give me something\", /[0-9]/); // false\nsamsam.match({ toString: function () { return \"yeah!\"; } }, /yeah/); // true\nsamsam.match(234, /[a-z]/); // false\n```\n\n\n**Number matcher**\n\nWhen the matcher is a number, the assertion will pass if `object == matcher`.\n\n```javascript\nsamsam.match(\"123\", 123); // true\nsamsam.match(\"Give me something\", 425); // false\nsamsam.match({ toString: function () { return \"42\"; } }, 42); // true\nsamsam.match(234, 1234); // false\n```\n\n\n**Function matcher**\n\nWhen the matcher is a function, it is called with `object` as its only\nargument. `match` returns `true` if the function returns `true`. A strict\nmatch is performed against the return value, so a boolean `true` is required,\ntruthy is not enough.\n\n```javascript\n// true\nsamsam.match(\"123\", function (exp) {\n    return exp == \"123\";\n});\n\n// false\nsamsam.match(\"Give me something\", function () {\n    return \"ok\";\n});\n\n// true\nsamsam.match({\n    toString: function () {\n        return \"42\";\n    }\n}, function () { return true; });\n\n// false\nsamsam.match(234, function () {});\n```\n\n\n**Object matcher**\n\nAs mentioned above, if an object matcher defines a `test` method, `match`\nwill return `true` if `matcher.test(object)` returns truthy.\n\nIf the matcher does not have a test method, a recursive match is performed. If\nall properties of `matcher` matches corresponding properties in `object`,\n`match` returns `true`. Note that the object matcher does not care if the\nnumber of properties in the two objects are the same - only if all properties in\nthe matcher recursively matches ones in `object`.\n\n```javascript\n// true\nsamsam.match(\"123\", {\n    test: function (arg) {\n        return arg == 123;\n    }\n});\n\n// false\nsamsam.match({}, { prop: 42 });\n\n// true\nsamsam.match({\n    name: \"Chris\",\n    profession: \"Programmer\"\n}, {\n    name: \"Chris\"\n});\n\n// false\nsamsam.match(234, { name: \"Chris\" });\n```\n\n\n**DOM elements**\n\n`match` can be very helpful when comparing DOM elements, because it allows\nyou to compare several properties with one call:\n\n```javascript\nvar el = document.getElementById(\"myEl\");\n\nsamsam.match(el, {\n    tagName: \"h2\",\n    className: \"item\",\n    innerHTML: \"Howdy\"\n});\n```\n\n\n## Changelog\n\n**1.1.2** (11.12.2014)\n\n* Fix for issue [#359 - `assert.match` does not support objects with `null` properties`](https://github.com/busterjs/buster/issues/359)\n* Implementation of feature request [#64 - assert.match and parentNode](https://github.com/busterjs/buster/issues/64)\n\n**1.1.1** (26.03.2014)\n\n* [Make `isArguments` work with arguments from `\"strict mode\"` functions](https://github.com/busterjs/samsam/commit/72903613af90f39474f8388ed8957eaea4cf46ae)\n* [Fix type error for nested object in function `match`](https://github.com/busterjs/samsam/commit/9d3420a11e9b3c65559945e60ca56980820db20f)\n* Fix for issue [#366 - Assertion match fails with data attribute](https://github.com/busterjs/buster/issues/366)\n","_attachments":{},"homepage":"http://docs.busterjs.org/en/latest/modules/samsam/","bugs":{"url":"https://github.com/busterjs/samsam/issues"},"license":"BSD-3-Clause"}