diff --git a/.travis.yml b/.travis.yml
index 3694d3a..06a2a13 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,6 @@ node_js:
- "6"
- "7"
script:
- - npm test
+ - npm run ci
after_script:
- npm run report-coverage
diff --git a/CHANGES.md b/CHANGES.md
index 7cce5ae..23b18a3 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,10 @@
+## Version 0.4.0, 2017.03.20
+
+* Support es2015 maps [#7](https://github.com/Skelp/nevis/issues/7)
+* Support es2015 sets [#8](https://github.com/Skelp/nevis/issues/8)
+* Support es2015 typed arrays [#9](https://github.com/Skelp/nevis/issues/9)
+* Add new script for testing on CI [#10](https://github.com/Skelp/nevis/issues/10)
+
## Version 0.3.0, 2017.03.18
* Rename library to Nevis (**breaking change**)
diff --git a/Gruntfile.js b/Gruntfile.js
index 2b23b15..64b56e5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -180,7 +180,8 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt)
- grunt.registerTask('default', [ 'eslint', 'clean', 'rollup', 'mocha_istanbul' ])
+ grunt.registerTask('default', [ 'ci' ])
grunt.registerTask('build', [ 'eslint', 'clean:build', 'rollup' ])
+ grunt.registerTask('ci', [ 'eslint', 'clean', 'rollup', 'mocha_istanbul' ])
grunt.registerTask('test', [ 'eslint', 'clean:test', 'mocha_istanbul' ])
}
diff --git a/README.md b/README.md
index cb6308e..03517e6 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
- 888b 888 d8b .d88 88b.
- 8888b 888 Y8P d88P" "Y88b
- 88888b 888 d88P Y88b
- 88888b. .d88b. 888 888 888 888Y88b 888 .d88b. 888 888 888 .d8888b 888 888
- 888 "88b d8P Y8b 888 888 888 888 Y88b888 d8P Y8b 888 888 888 88K 888 888
- 888 888 88888888 888 888 888 888 Y88888 88888888 Y88 88P 888 "Y8888b. Y88b d88P
- 888 888 Y8b. Y88b 888 d88P 888 Y8888 Y8b. Y8bd8P 888 X88 Y88b. .d88P
- 888 888 "Y8888 "Y8888888P" 888 Y888 "Y8888 Y88P 888 88888P' "Y88 88P"
+ 888b 888 d8b
+ 8888b 888 Y8P
+ 88888b 888
+ 888Y88b 888 .d88b. 888 888 888 .d8888b
+ 888 Y88b888 d8P Y8b 888 888 888 88K
+ 888 Y88888 88888888 Y88 88P 888 "Y8888b.
+ 888 Y8888 Y8b. Y8bd8P 888 X88
+ 888 Y888 "Y8888 Y88P 888 88888P'
[Nevis](https://github.com/Skelp/nevis) brings more of the Object-Orientated Programming (OOP) model to JavaScript.
@@ -38,13 +38,13 @@ You'll need to have at least [Node.js](https://nodejs.org). While equals should
If you want to simply download the file to be used in the browser you can find them below:
-* [Development Version](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis.js) (77kb)
-* [Production Version](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis.min.js) (8.3kb)
+* [Development Version](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis.js) (81kb)
+* [Production Version](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis.min.js) (9.2kb - [Source Map](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis.min.js.map))
If you're only wanting support for inheritance, you can use the *lite* version instead:
* [Development Version - Lite](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis-lite.js) (7.5kb)
-* [Production Version - Lite](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis-lite.min.js) (980b)
+* [Production Version - Lite](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis-lite.min.js) (980b - [Source Map](https://cdn.rawgit.com/Skelp/nevis/master/dist/nevis-lite.min.js.map))
## API
diff --git a/bower.json b/bower.json
index 3be8db0..a0b7f17 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "nevis",
- "version": "0.3.0",
+ "version": "0.4.0",
"description": "Makes JavaScript more object-orientated",
"homepage": "https://github.com/Skelp/nevis",
"authors": [
diff --git a/dist/nevis-lite.js b/dist/nevis-lite.js
index 7b8d6e9..2b60f25 100644
--- a/dist/nevis-lite.js
+++ b/dist/nevis-lite.js
@@ -60,7 +60,7 @@
*/
function createObject(prototype, properties) {
var result;
- /* istanbul ignore else */
+ /* istanbul ignore next */
if (typeof Object.create === 'function') {
result = Object.create(prototype);
} else {
diff --git a/dist/nevis-lite.js.map b/dist/nevis-lite.js.map
index 66d6045..c07c0a0 100644
--- a/dist/nevis-lite.js.map
+++ b/dist/nevis-lite.js.map
@@ -1 +1 @@
-{"version":3,"file":"nevis-lite.js","sources":["../src/extend.js","../src/nevis.js","../lite.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore else */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src/nevis')\n"],"names":["extend","require$$0"],"mappings":";;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;AAQA,MAAI,WAAW,8BAA8B,W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nevis.js","../lite.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore next */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src/nevis')\n"],"names":["extend","require$$0"],"mappings":";;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;AAQA,MAAI,WAAW,8BAA8B,WAAW,EAAE,CAAA;;;;;;;AAO1D,MAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAA;;;;;;;AAOpD,MAAI,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAA;;;;;;;;;;;;AAYjC,EAAA,SAAS,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE;IAC3C,IAAI,MAAM,CAAA;;IAEV,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE;MACvC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CA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;IAC1C,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;;IAElC,IAAI,QAAQ,CAAA;IACZ,IAAI,MAAM,CAAA;;IAEV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;MACxD,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;;MAEnB,KAAK,QAAQ,IAAI,MAAM,EAAE;QACvB,IAAI,CAAC,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;UACjD,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;SACpC;OACF;KACF;GACF;;AAED,cAAc,GAAG,MAAM,CAAA;;;;;;;;ACzHvB,EAAA,SAAS,KAAK,GAAG,EAAE;AACnB,EAAA,KAAK,CAAC,MAAM,GAAG,OAAO,CAAA;AACtB,EAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBrB,EAAA,KAAK,CAAC,MAAM,GAAGA,QAAM,CAAA;;AAErB,WAAc,GAAG,KAAK,CAAA;;ACrCtB,UAAc,GAAGC;;;;"}
\ No newline at end of file
diff --git a/dist/nevis-lite.min.js b/dist/nevis-lite.min.js
index 13af2ca..5657b62 100644
--- a/dist/nevis-lite.min.js
+++ b/dist/nevis-lite.min.js
@@ -1,4 +1,4 @@
-/*! Nevis Lite v0.3.0 | (C) 2017 Alasdair Mercer, Skelp | MIT License */
+/*! Nevis Lite v0.4.0 | (C) 2017 Alasdair Mercer, Skelp | MIT License */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("nevis",e):t.Nevis=e()}(this,function(){"use strict";function t(t,e){var o;return"function"==typeof Object.create?o=Object.create(t):(r.prototype=t,o=new r,r.prototype=null),e&&n(!0,o,e),o}function e(e,o,r,c){var p=this;return"string"!=typeof e&&(c=r,r=o,o=e,e=null),"function"!=typeof o&&(c=r,r=o,o=function(){return p.apply(this,arguments)}),n(!1,o,p,c),o.prototype=t(p.prototype,r),o.prototype.constructor=o,o.class_=e||p.class_,o.super_=p,o}function n(t,e,n){n=p.call(arguments,2);for(var o,r,i=0,u=n.length;iObject.prototype.hasOwnProperty.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore else */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src/nevis')\n"],"names":["createObject","prototype","properties","result","Object","create","Constructor","extendObject","extend","name","constructor","statics","superConstructor","this","apply","arguments","class_","super_","own","target","sources","slice","call","property","source","i","length","hasOwnProperty","Nevis","Array","require$$0"],"mappings":";wLAwDA,SAASA,GAAaC,EAAWC,GAC/B,GAAIC,EAcJ,OAZ6B,kBAAlBC,QAAOC,OAChBF,EAASC,OAAOC,OAAOJ,IAEvBK,EAAYL,UAAYA,EACxBE,EAAS,GAAIG,GACbA,EAAYL,UAAY,MAGtBC,GACFK,GAAa,EAAMJ,EAAQD,GAGtBC,EAwBT,QAASK,GAAOC,EAAMC,EAAaT,EAAWU,GAC5C,GAAIC,GAAmBC,IAyBvB,OAvBoB,gBAATJ,KACTE,EAAUV,EACVA,EAAYS,EACZA,EAAcD,EACdA,EAAO,MAGkB,kBAAhBC,KACTC,EAAUV,EACVA,EAAYS,EACZA,EAAc,WACZ,MAAOE,GAAiBE,MAAMD,KAAME,aAIxCR,GAAa,EAAOG,EAAaE,EAAkBD,GAEnDD,EAAYT,UAAYD,EAAaY,EAAiBX,UAAWA,GACjES,EAAYT,UAAUS,YAAcA,EAEpCA,EAAYM,OAASP,GAAQG,EAAiBI,OAC9CN,EAAYO,OAASL,EAEdF,EAeT,QAASH,GAAaW,EAAKC,EAAQC,GACjCA,EAAUC,EAAMC,KAAKP,UAAW,EAKhC,KAAK,GAHDQ,GACAC,EAEKC,EAAI,EAAGC,EAASN,EAAQM,OAAQD,EAAIC,EAAQD,IAAK,CACxDD,EAASJ,EAAQK,EAEjB,KAAKF,IAAYC,GACVN,IAAOS,EAAeL,KAAKE,EAAQD,KACtCJ,EAAOI,GAAYC,EAAOD,KCnHlC,QAASK,SDFLtB,GAAyC,aAOzCqB,EAAiBvB,OAAOH,UAAU0B,eAOlCN,EAAQQ,MAAM5B,UAAUoB,QA6GXb,CCxHjBoB,GAAMZ,OAAS,QACfY,EAAMX,OAASb,OAyBfwB,EAAMpB,OAASA,QAEEoB,ICrCAE"}
\ No newline at end of file
+{"version":3,"file":"nevis-lite.min.js","sources":["../src/extend.js","../src/nevis.js","../lite.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore next */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src/nevis')\n"],"names":["createObject","prototype","properties","result","Object","create","Constructor","extendObject","extend","name","constructor","statics","superConstructor","this","apply","arguments","class_","super_","own","target","sources","slice","call","property","source","i","length","hasOwnProperty","Nevis","Array","require$$0"],"mappings":";wLAwDA,SAASA,GAAaC,EAAWC,GAC/B,GAAIC,EAcJ,OAZ6B,kBAAlBC,QAAOC,OAChBF,EAASC,OAAOC,OAAOJ,IAEvBK,EAAYL,UAAYA,EACxBE,EAAS,GAAIG,GACbA,EAAYL,UAAY,MAGtBC,GACFK,GAAa,EAAMJ,EAAQD,GAGtBC,EAwBT,QAASK,GAAOC,EAAMC,EAAaT,EAAWU,GAC5C,GAAIC,GAAmBC,IAyBvB,OAvBoB,gBAATJ,KACTE,EAAUV,EACVA,EAAYS,EACZA,EAAcD,EACdA,EAAO,MAGkB,kBAAhBC,KACTC,EAAUV,EACVA,EAAYS,EACZA,EAAc,WACZ,MAAOE,GAAiBE,MAAMD,KAAME,aAIxCR,GAAa,EAAOG,EAAaE,EAAkBD,GAEnDD,EAAYT,UAAYD,EAAaY,EAAiBX,UAAWA,GACjES,EAAYT,UAAUS,YAAcA,EAEpCA,EAAYM,OAASP,GAAQG,EAAiBI,OAC9CN,EAAYO,OAASL,EAEdF,EAeT,QAASH,GAAaW,EAAKC,EAAQC,GACjCA,EAAUC,EAAMC,KAAKP,UAAW,EAKhC,KAAK,GAHDQ,GACAC,EAEKC,EAAI,EAAGC,EAASN,EAAQM,OAAQD,EAAIC,EAAQD,IAAK,CACxDD,EAASJ,EAAQK,EAEjB,KAAKF,IAAYC,GACVN,IAAOS,EAAeL,KAAKE,EAAQD,KACtCJ,EAAOI,GAAYC,EAAOD,KCnHlC,QAASK,SDFLtB,GAAyC,aAOzCqB,EAAiBvB,OAAOH,UAAU0B,eAOlCN,EAAQQ,MAAM5B,UAAUoB,QA6GXb,CCxHjBoB,GAAMZ,OAAS,QACfY,EAAMX,OAASb,OAyBfwB,EAAMpB,OAASA,QAEEoB,ICrCAE"}
\ No newline at end of file
diff --git a/dist/nevis.js b/dist/nevis.js
index 8b9b544..6680448 100644
--- a/dist/nevis.js
+++ b/dist/nevis.js
@@ -4,6 +4,53 @@
(global.Nevis = factory());
}(this, (function () { 'use strict';
+ /*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+ /**
+ * The strings for all array types (incl. typed arrays), as generated by Object.prototype.toString
.
+ *
+ * @public
+ * @type {string[]}
+ */
+ var typeStrings = [
+ 'Array',
+ 'Int8Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Int16Array',
+ 'Uint16Array',
+ 'Int32Array',
+ 'Uint32Array',
+ 'Float32Array',
+ 'Float64Array'
+ ].map(function(str) {
+ return '[object ' + str + ']'
+ });
+
+ var arrays = {
+ typeStrings: typeStrings
+ };
+
/*
* Copyright (C) 2017 Alasdair Mercer, Skelp
*
@@ -60,7 +107,7 @@
*/
function createObject(prototype, properties) {
var result;
- /* istanbul ignore else */
+ /* istanbul ignore next */
if (typeof Object.create === 'function') {
result = Object.create(prototype);
} else {
@@ -311,7 +358,7 @@
* @memberof ArrayEqualsComparator#
*/
supports: function supports(context) {
- return context.string === '[object Array]'
+ return arrays.typeStrings.indexOf(context.string) >= 0
}
});
@@ -421,6 +468,48 @@
var hashComparator = HashEqualsComparator;
+ /**
+ * An implementation of {@link HashEqualsComparator} that supports map values.
+ *
+ * MapEqualsComparator
ignores insertion order when comparing maps.
+ *
+ * @protected
+ * @constructor
+ * @extends HashEqualsComparator
+ */
+ var MapEqualsComparator = hashComparator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ getKeys: function getKeys(hash) {
+ return Array.from(hash.keys())
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ getValue: function getValue(hash, key) {
+ return hash.get(key)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Map]'
+ }
+
+ });
+
+ var mapComparator = MapEqualsComparator;
+
/**
* An implementation of {@link EqualsComparator} that supports number values (including NaN
).
*
@@ -506,6 +595,37 @@
var objectComparator = ObjectEqualsComparator;
+ /**
+ * An implementation of {@link CollectionEqualsComparator} that supports set values.
+ *
+ * @protected
+ * @constructor
+ * @extends CollectionEqualsComparator
+ */
+ var SetEqualsComparator = collectionComparator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetEqualsComparator#
+ */
+ getElements: function getElements(collection) {
+ return Array.from(collection)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetEqualsComparator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Set]'
+ }
+
+ });
+
+ var setComparator = SetEqualsComparator;
+
/**
* An implementation of {@link EqualsComparator} that supports string values.
*
@@ -591,8 +711,10 @@
DateEqualsComparator: dateComparator,
EqualsComparator: comparator,
HashEqualsComparator: hashComparator,
+ MapEqualsComparator: mapComparator,
NumberEqualsComparator: numberComparator,
ObjectEqualsComparator: objectComparator,
+ SetEqualsComparator: setComparator,
StringEqualsComparator: stringComparator,
ToStringEqualsComparator: toStringComparator
};
@@ -762,6 +884,8 @@
new index$6.DateEqualsComparator(),
new index$6.ToStringEqualsComparator(),
new index$6.ArrayEqualsComparator(),
+ new index$6.SetEqualsComparator(),
+ new index$6.MapEqualsComparator(),
new index$6.ObjectEqualsComparator()
];
@@ -1080,7 +1204,7 @@
* @memberof ArrayHashCodeGenerator#
*/
supports: function support(context) {
- return context.string === '[object Array]'
+ return arrays.typeStrings.indexOf(context.string) >= 0
}
});
@@ -1271,6 +1395,39 @@
var hashGenerator = HashHashCodeGenerator;
+ /**
+ * An implementation of {@link HashHashCodeGenerator} that supports map values.
+ *
+ * Insertion order should have no impact on the hash code generated by MapHashCodeGenerator
.
+ *
+ * @protected
+ * @constructor
+ * @extends HashHashCodeGenerator
+ */
+ var MapHashCodeGenerator = hashGenerator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapHashCodeGenerator#
+ */
+ getEntries: function getEntries(context) {
+ return Array.from(context.value.entries())
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapHashCodeGenerator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Map]'
+ }
+
+ });
+
+ var mapGenerator = MapHashCodeGenerator;
+
/**
* An implementation of {@link HashHashCodeGenerator} that supports plain old object values.
*
@@ -1317,6 +1474,37 @@
var objectGenerator = ObjectHashCodeGenerator;
+ /**
+ * An implementation of {@link CollectionHashCodeGenerator} that supports set values.
+ *
+ * @protected
+ * @constructor
+ * @extends CollectionHashCodeGenerator
+ */
+ var SetHashCodeGenerator = collectionGenerator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetHashCodeGenerator#
+ */
+ getElements: function getElements(context) {
+ return Array.from(context.value)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetHashCodeGenerator#
+ */
+ supports: function support(context) {
+ return context.string === '[object Set]'
+ }
+
+ });
+
+ var setGenerator = SetHashCodeGenerator;
+
/**
* An implementation of {@link CachingHashCodeGenerator} that supports string values.
*
@@ -1403,7 +1591,9 @@
DateHashCodeGenerator: dateGenerator,
HashCodeGenerator: generator,
HashHashCodeGenerator: hashGenerator,
+ MapHashCodeGenerator: mapGenerator,
ObjectHashCodeGenerator: objectGenerator,
+ SetHashCodeGenerator: setGenerator,
StringHashCodeGenerator: stringGenerator,
ToStringHashCodeGenerator: toStringGenerator
};
@@ -1542,7 +1732,9 @@
new index$10.StringHashCodeGenerator(),
new index$10.DateHashCodeGenerator(),
new index$10.ToStringHashCodeGenerator(),
- new index$10.ArrayHashCodeGenerator()
+ new index$10.ArrayHashCodeGenerator(),
+ new index$10.SetHashCodeGenerator(),
+ new index$10.MapHashCodeGenerator()
];
/**
diff --git a/dist/nevis.js.map b/dist/nevis.js.map
index 88ef70e..1c44319 100644
--- a/dist/nevis.js.map
+++ b/dist/nevis.js.map
@@ -1 +1 @@
-{"version":3,"file":"nevis.js","sources":["../src/extend.js","../src/equals/comparators/comparator.js","../src/equals/comparators/collection-comparator.js","../src/equals/comparators/array-comparator.js","../src/equals/comparators/date-comparator.js","../src/equals/comparators/hash-comparator.js","../src/equals/comparators/number-comparator.js","../src/equals/comparators/object-comparator.js","../src/equals/comparators/string-comparator.js","../src/equals/comparators/to-string-comparator.js","../src/equals/comparators/index.js","../src/equals/context.js","../src/equals/index.js","../src/equals/builder.js","../src/hash-code/generators/generator.js","../src/hash-code/generators/collection-generator.js","../src/hash-code/generators/array-generator.js","../src/hash-code/generators/boolean-generator.js","../src/hash-code/generators/caching-generator.js","../src/hash-code/generators/date-generator.js","../src/hash-code/generators/hash-generator.js","../src/hash-code/generators/object-generator.js","../src/hash-code/generators/string-generator.js","../src/hash-code/generators/to-string-generator.js","../src/hash-code/generators/index.js","../src/hash-code/context.js","../src/hash-code/index.js","../src/hash-code/builder.js","../src/nevis.js","../src/to-string/index.js","../src/index.js","../index.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore else */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for comparing the values within a specific {@link EqualsContext} to check whether they are equal.\n *\n * Individual EqualsComparator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly provide a more suitable comparison. The\n * {@link EqualsContext} should never be modified but can be copied via {@link EqualsContext#copy}.\n *\n * A EqualsComparator
is only called once it has been determined that the values within the\n * {@link EqualsContext} are not exactly equal, neither are null
, and both share the same type.\n *\n * Implementations must implement the {@link EqualsComparator#compare} and {@link EqualsComparator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction EqualsComparator() {}\nEqualsComparator.class_ = 'EqualsComparator'\nEqualsComparator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof EqualsComparator\n */\nEqualsComparator.extend = extend\n\n/**\n * Compares the values within the specified context
.\n *\n * This method is only called when {@link EqualsComparator#supports} indicates that this {@link EqualsComparator}\n * supports context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} whose values are to be compared\n * @return {boolean} true
if the values within context
are equal; otherwise\n * false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.compare = /* istanbul ignore next */ function compare(context) {}\n\n/**\n * Returns whether this {@link EqualsComparator} supports the specified context
.\n *\n * This method should only return true
when {@link EqualsComparator#compare} can compare the values within\n * context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} to be checked\n * @return {boolean} true
if this {@link EqualsComparator} can compare the values within\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = EqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * values types that contain a collection of other values. This is achieved by requesting the elements contained within\n * e value as an array from the implementation and then compares each element to determine whether the values are equal.\n *\n * Implementations must implement the {@link CollectionEqualsComparator#getElements} and\n * {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar CollectionEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionEqualsComparator#\n */\n compare: function compare(context) {\n var elements = this.getElements(context.value, context)\n var otherElements = this.getElements(context.other, context)\n var length = elements.length\n\n if (length !== otherElements.length) {\n return false\n }\n\n while (length--) {\n if (!context.equals(elements[length], otherElements[length])) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the elements contained within the specified collection
.\n *\n * @param {*} collection - the collection whose elements are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The elements contained within collection
.\n * @protected\n * @abstract\n * @memberof CollectionEqualsComparator#\n */\n getElements: /* istanbul ignore next */ function getElements(collection, context) {}\n\n})\n\nmodule.exports = CollectionEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar ArrayEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n getElements: function getElements(collection) {\n return collection\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Array]'\n }\n\n})\n\nmodule.exports = ArrayEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar DateEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.getTime() === context.other.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the keys contained within each\n * value as an array from the implementation and then compares each key/value pair to determine whether the values are\n * equal.\n *\n * Implementations must implement the {@link HashEqualsComparator#getKeys}, {@link HashEqualsComparator#getValue}\n * and {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar HashEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashEqualsComparator#\n */\n compare: function compare(context) {\n var value = context.value\n var other = context.other\n var keys = this.getKeys(value, context)\n var length = keys.length\n\n if (length !== this.getKeys(other, context).length) {\n return false\n }\n\n var key\n\n while (length--) {\n key = keys[length]\n\n if (!context.equals(this.getValue(value, key, context), this.getValue(other, key, context))) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the keys contained within the value of the specified hash
.\n *\n * @param {*} hash - the hash whose keys are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The keys contained within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getKeys: /* istanbul ignore next */ function getKeys(hash, context) {},\n\n /**\n * Returns the value associated with the specified key
in the hash
provided.\n *\n * @param {*} hash - the hash from which the value is to be returned\n * @param {*} key - the key for which the associated value is to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {*} The value for key
within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getValue: /* istanbul ignore next */ function getValue(hash, key, context) {}\n\n})\n\nmodule.exports = HashEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports number values (including NaN
).\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar NumberEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n compare: function compare(context) {\n return context.value !== context.value ? context.other !== context.other : context.value === context.other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'number'\n }\n\n})\n\nmodule.exports = NumberEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar ObjectEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getKeys: function getKeys(hash, context) {\n var keys = []\n var options = context.options\n var value\n\n for (var key in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, key)) {\n value = this.getValue(hash, key, context)\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(key, value, hash)) {\n keys.push(key)\n }\n }\n }\n\n return keys\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash[key]\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar StringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n compare: function compare(context) {\n var other = context.other\n var value = context.value\n\n if (context.options.ignoreCase) {\n other = other.toLocaleUpperCase()\n value = value.toLocaleUpperCase()\n }\n\n return value === other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports miscellaneous values by comparing their string\n * representations (generated by calling toString
on each value).\n *\n * This {@link EqualsComparator} currently only supports functions and regular expressions.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar ToStringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.toString() === context.other.toString()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayEqualsComparator = require('./array-comparator')\nvar CollectionEqualsComparator = require('./collection-comparator')\nvar DateEqualsComparator = require('./date-comparator')\nvar EqualsComparator = require('./comparator')\nvar HashEqualsComparator = require('./hash-comparator')\nvar NumberEqualsComparator = require('./number-comparator')\nvar ObjectEqualsComparator = require('./object-comparator')\nvar StringEqualsComparator = require('./string-comparator')\nvar ToStringEqualsComparator = require('./to-string-comparator')\n\n/**\n * A hash containing constructors for all equals comparators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayEqualsComparator: ArrayEqualsComparator,\n CollectionEqualsComparator: CollectionEqualsComparator,\n DateEqualsComparator: DateEqualsComparator,\n EqualsComparator: EqualsComparator,\n HashEqualsComparator: HashEqualsComparator,\n NumberEqualsComparator: NumberEqualsComparator,\n ObjectEqualsComparator: ObjectEqualsComparator,\n StringEqualsComparator: StringEqualsComparator,\n ToStringEqualsComparator: ToStringEqualsComparator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the values whose equality is to be tested as well as the string representation and type for the value which\n * can be checked elsewhere for type-checking etc.\n *\n * A EqualsContext
is only created once it has been determined that both values not exactly equal\n * and neither are null
. Once instantiated, {@link EqualsContext#validate} should be called to ensure that\n * both values share the same type.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @param {Function} equals - a reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}\n * @param {?Nevis~EqualsOptions} options - the options to be used (may be null
)\n * @public\n * @constructor\n */\nfunction EqualsContext(value, other, equals, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}.\n *\n * @private\n * @type {Function}\n */\n this._equals = equals\n\n /**\n * The options to be used to test equality for both of the values.\n *\n * @public\n * @type {Nevis~EqualsOptions}\n */\n this.options = {\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreCase: Boolean(options.ignoreCase),\n ignoreEquals: Boolean(options.ignoreEquals),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The other value to be checked against the value
.\n *\n * @public\n * @type {*}\n */\n this.other = other\n\n /**\n * The string representation of the values to be tested for equality.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the values to be tested for equality.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value to be checked against the other
.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link EqualsContext} but for the specified value
and other
value\n * instead.\n *\n * This method can be useful for when an {@link EqualsComparator} implementation wants to test equality based on a value\n * derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @return {EqualsContext} A copy of this {@link EqualsContext} for value
and other
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.copy = function copy(value, other) {\n return new EqualsContext(value, other, this._equals, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.equals} from within an {@link EqualsComparator}.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.equals = function equals(value, other) {\n return this._equals(value, other, this.options)\n}\n\n/**\n * Validates this {@link EqualsContext} by checking whether its values share the same type.\n *\n * This method must be called before attempting to call any {@link EqualsComparator} as they are meant to be able\n * to assume that both values share the same type.\n *\n * @return {boolean} true
if both values share the same type; otherwise false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.validate = function validate() {\n return this.string === Object.prototype.toString.call(this.other) && this.type === typeof this.other\n}\n\nmodule.exports = EqualsContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar comparators = require('./comparators')\nvar EqualsContext = require('./context')\n\n/**\n * The list of active equals comparators that will be checked for any that support the values.\n *\n * @private\n * @type {EqualsComparator[]}\n */\nvar activeComparators = [\n new comparators.NumberEqualsComparator(),\n new comparators.StringEqualsComparator(),\n new comparators.DateEqualsComparator(),\n new comparators.ToStringEqualsComparator(),\n new comparators.ArrayEqualsComparator(),\n new comparators.ObjectEqualsComparator()\n]\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n */\nfunction equals(value, other, options) {\n if (value === other) {\n return true\n }\n if (value == null || other == null) {\n return value === other\n }\n\n var context = new EqualsContext(value, other, equals, options)\n\n if (!context.options.ignoreEquals && typeof value.equals === 'function') {\n return value.equals(other)\n }\n\n if (!context.validate()) {\n return false\n }\n\n var comparator\n var length = activeComparators.length\n\n for (var i = 0; i < length; i++) {\n comparator = activeComparators[i]\n\n if (comparator.supports(context)) {\n return comparator.compare(context)\n }\n }\n\n return false\n}\n\nmodule.exports = equals\n\n/**\n * Called with the name and value of a property belonging to an object whose equality is being tested to determine\n * whether the property should be checked against that on the other object within the equality test.\n *\n * Keep in mind that including a property on one object but not on the other will almost certainly result in\n * inequality.\n *\n * @callback Nevis~EqualsFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and that is being checked against another\n * @return {boolean} true
if the equality of the property should be tested against that on the other\n * object; otherwise false
.\n */\n\n/**\n * The options to be used to test equality.\n *\n * @typedef {Object} Nevis~EqualsOptions\n * @property {Nevis~EqualsFilterPropertyCallback} [filterProperty] - A function to be called to filter properties based\n * on their name and value when testing equality of objects to determine whether they should be tested. This is not\n * called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreCase] - true
to ignore case when testing equality for strings; otherwise\n * false
.\n * @property {boolean} [ignoreEquals] - true
to ignore the \"equals\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when testing equality for\n * objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when testing equality for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticEquals = require('./')\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @constructor\n */\nfunction EqualsBuilder() {\n /**\n * The current equals for this {@link EqualsBuilder}.\n *\n * @private\n * @type {boolean}\n */\n this._equals = true\n}\n\n/**\n * Appends the specified value
and other
to this {@link EqualsBuilder}, testing equality for\n * them using the options
provided.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to check equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.append = function append(value, other, options) {\n if (this._equals) {\n this._equals = staticEquals(value, other, options)\n }\n\n return this\n}\n\n/**\n * Appends the result of testing equality for a super class to this {@link EqualsBuilder}.\n *\n * @param {boolean} superEquals - the result of testing equality for a super class\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.appendSuper = function appendSuper(superEquals) {\n if (this._equals) {\n this._equals = superEquals\n }\n\n return this\n}\n\n/**\n * Returns whether the values that have been appended to this {@link EqualsBuilder} are all equal.\n *\n * @return {boolean} true
if all appended values are equal; otherwise false
.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.build = function build() {\n return this._equals\n}\n\nmodule.exports = EqualsBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for generating a hash code for a specific {@link HashCodeContext}.\n *\n * Individual HashCodeGenerator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly generate a more suitable hash code. The\n * {@link HashCodeContext} should never be modified but can be copied via {@link HashCodeContext#copy}.\n *\n * Implementations must implement the {@link HashCodeGenerator#generate} and {@link HashCodeGenerator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction HashCodeGenerator() {}\nHashCodeGenerator.class_ = 'HashCodeGenerator'\nHashCodeGenerator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof HashCodeGenerator\n */\nHashCodeGenerator.extend = extend\n\n/**\n * Returns a hash code for the specified context
.\n *\n * This method is only called when {@link HashCodeGenerator#supports} indicates that this {@link HashCodeGenerator}\n * supports context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.generate = /* istanbul ignore next */ function generate(context) {}\n\n/**\n * Returns whether this {@link HashCodeGenerator} supports the specified context
.\n *\n * This method should only return true
when {@link HashCodeGenerator#generate} can generate a hash code for\n * context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} to be checked\n * @return {boolean} true
if this {@link HashCodeGenerator} can generate a hash code for\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = HashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that contain a collection of other values. This is achieved by requesting the elements contained within\n * the value as an array from the implementation and then generates hash codes for each element to compute the hash code\n * for the value.\n *\n * Implementations must implement the {@link CollectionHashCodeGenerator#getElements} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CollectionHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionHashCodeGenerator#\n */\n generate: function generate(context) {\n var elements = this.getElements(context)\n\n return elements.reduce(function(hash, element) {\n return ((31 * hash) + context.hashCode(element)) | 0\n }, 1)\n },\n\n /**\n * Returns the elements contained within the value of the specified context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose children elements are to\n * be returned\n * @return {Array} The elements contained within the value of context
.\n * @protected\n * @abstract\n * @memberof CollectionHashCodeGenerator#\n */\n getElements: /* istanbul ignore next */ function getElements(context) {}\n\n})\n\nmodule.exports = CollectionHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar ArrayHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return context.value\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n supports: function support(context) {\n return context.string === '[object Array]'\n }\n\n})\n\nmodule.exports = ArrayHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports boolean values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar BooleanHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value ? 1231 : 1237\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'boolean'\n }\n\n})\n\nmodule.exports = BooleanHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to cache\n * generated hash codes to avoid re-generating them for the same values. Obviously, this should only ever be done for\n * immutable values.\n *\n * Generated hash codes should only ever be cached when the allowCache
option is enabled, however, the\n * cache will always be checked before attempting to generate a hash code for a value.\n *\n * Implementations must implement the {@link CachingHashCodeGenerator#generateInternal} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CachingHashCodeGenerator = HashCodeGenerator.extend(function() {\n /**\n * A cache of values mapped to their previously generated hash codes.\n *\n * @private\n * @type {Object.<*, number>}\n * @memberof CachingHashCodeGenerator#\n */\n this._cache = {}\n}, {\n\n /**\n * Clears the cache of hash codes that have been previously generated by this {@link CachingHashCodeGenerator} while\n * the allowCache
option has been enabled.\n *\n * @return {void}\n * @public\n * @memberof CachingHashCodeGenerator#\n */\n clearCache: function clearCache() {\n this._cache = {}\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof CachingHashCodeGenerator#\n */\n generate: function generate(context) {\n var hash = this._cache[context.value]\n\n if (hash == null) {\n hash = this.generateInternal(context)\n\n if (context.options.allowCache) {\n this._cache[context.value] = hash\n }\n }\n\n return hash\n },\n\n /**\n * Returns a hash code for the specified context
.\n *\n * This method is called internally by {@link CachingHashCodeGenerator#generate} only when a hash code needs to be\n * generated (i.e. the cache doesn't contain a previously generated hash code for the value of context
).\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @protected\n * @abstract\n * @memberof CachingHashCodeGenerator#\n */\n generateInternal: /* istanbul ignore next */ function generateInternal(context) {}\n\n})\n\nmodule.exports = CachingHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar DateHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the entries of key/value pairs\n * contained within the value as an multi-dimensional array from the implementation and then generates hash codes for\n * each entry to compute the hash code for the value.\n *\n * Implementations must implement the {@link HashHashCodeGenerator#getEntries} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar HashHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashHashCodeGenerator#\n */\n generate: function generate(context) {\n var entries = this.getEntries(context)\n\n return entries.reduce(function(hash, entry) {\n return hash + (context.hashCode(entry[0]) ^ context.hashCode(entry[1]))\n }, 0)\n },\n\n /**\n * Returns the entries contained within the value of the specified context
.\n *\n * This method returns a multi-dimensional array where each entry is an array consisting of the key and value, in that\n * order.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose entries are to be\n * returned\n * @return {Array.} The entries contained within the value of context
.\n * @protected\n * @abstract\n * @memberof HashHashCodeGenerator#\n */\n getEntries: /* istanbul ignore next */ function getEntries(context) {}\n\n})\n\nmodule.exports = HashHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar ObjectHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n var entries = []\n var hash = context.value\n var options = context.options\n var value\n\n for (var name in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, name)) {\n value = hash[name]\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(name, value, hash)) {\n entries.push([ name, value ])\n }\n }\n }\n\n return entries\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CachingHashCodeGenerator = require('./caching-generator')\n\n/**\n * An implementation of {@link CachingHashCodeGenerator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends CachingHashCodeGenerator\n */\nvar StringHashCodeGenerator = CachingHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n generateInternal: function generateInternal(context) {\n var hash = 0\n var length = context.value.length\n\n for (var i = 0; i < length; i++) {\n hash = ((31 * hash) + context.value.charCodeAt(i)) | 0\n }\n\n return hash\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar StringHashCodeGenerator = require('./string-generator')\n\n/**\n * An extension of {@link StringHashCodeGenerator} that supports miscellaneous values by generating hash codes for their\n * string representations (generated by calling toString
on the value).\n *\n * This {@link HashCodeGenerator} currently only supports functions, numbers and regular expressions.\n *\n * @protected\n * @constructor\n * @extends StringHashCodeGenerator\n */\nvar ToStringHashCodeGenerator = StringHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n generate: function generate(context) {\n return ToStringHashCodeGenerator.super_.prototype.generate.call(this, context.copy(context.value.toString()))\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.type === 'number' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayHashCodeGenerator = require('./array-generator')\nvar BooleanHashCodeGenerator = require('./boolean-generator')\nvar CachingHashCodeGenerator = require('./caching-generator')\nvar CollectionHashCodeGenerator = require('./collection-generator')\nvar DateHashCodeGenerator = require('./date-generator')\nvar HashCodeGenerator = require('./generator')\nvar HashHashCodeGenerator = require('./hash-generator')\nvar ObjectHashCodeGenerator = require('./object-generator')\nvar StringHashCodeGenerator = require('./string-generator')\nvar ToStringHashCodeGenerator = require('./to-string-generator')\n\n/**\n * A hash containing constructors for all hash code generators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayHashCodeGenerator: ArrayHashCodeGenerator,\n BooleanHashCodeGenerator: BooleanHashCodeGenerator,\n CachingHashCodeGenerator: CachingHashCodeGenerator,\n CollectionHashCodeGenerator: CollectionHashCodeGenerator,\n DateHashCodeGenerator: DateHashCodeGenerator,\n HashCodeGenerator: HashCodeGenerator,\n HashHashCodeGenerator: HashHashCodeGenerator,\n ObjectHashCodeGenerator: ObjectHashCodeGenerator,\n StringHashCodeGenerator: StringHashCodeGenerator,\n ToStringHashCodeGenerator: ToStringHashCodeGenerator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the value for which a hash code is to be generated as well string representation and type of the value which\n * can be checked elsewhere for type-checking etc.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @param {Function} hashCode - a reference to {@link Nevis.hashCode} which can be called within a\n * {@link HashCodeGenerator}\n * @param {?Nevis~HashCodeOptions} options - the options to be used (may be null
)\n * @protected\n * @constructor\n */\nfunction HashCodeContext(value, hashCode, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.hashCode} which can be called within a {@link HashCodeGenerator}.\n *\n * @private\n * @type {Function}\n */\n this._hashCode = hashCode\n\n /**\n * The options to be used to generate the hash code for the value.\n *\n * @public\n * @type {Nevis~HashCodeOptions}\n */\n this.options = {\n allowCache: options.allowCache !== false,\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreHashCode: Boolean(options.ignoreHashCode),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The string representation of the value whose hash code is to be generated.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the value whose hash code is to be generated.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value whose hash code is to be generated.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link HashCodeContext} but for the specified value
instead.\n *\n * This method can be useful for when a {@link HashCodeGenerator} implementation wants to generate the hash code based\n * on a value derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @return {HashCodeContext} A copy of this {@link HashCodeContext} for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.copy = function copy(value) {\n return new HashCodeContext(value, this._hashCode, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.hashCode} from within a {@link HashCodeGenerator}.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @return {number} A hash code for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.hashCode = function hashCode(value) {\n return this._hashCode(value, this.options)\n}\n\nmodule.exports = HashCodeContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar generators = require('./generators')\nvar HashCodeContext = require('./context')\n\n/**\n * The list of active generators that will be checked for any that support the value before falling back to\n * {@link defaultGenerator}.\n *\n * @private\n * @type {HashCodeGenerator[]}\n */\nvar activeGenerators = [\n new generators.BooleanHashCodeGenerator(),\n new generators.StringHashCodeGenerator(),\n new generators.DateHashCodeGenerator(),\n new generators.ToStringHashCodeGenerator(),\n new generators.ArrayHashCodeGenerator()\n]\n\n/**\n * The default generator to be used when no others support the value.\n *\n * @private\n * @type {HashCodeGenerator}\n */\nvar defaultGenerator = new generators.ObjectHashCodeGenerator()\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n */\nfunction hashCode(value, options) {\n if (value == null) {\n return 0\n }\n\n var context = new HashCodeContext(value, hashCode, options)\n\n if (!context.options.ignoreHashCode && typeof value.hashCode === 'function') {\n return value.hashCode()\n }\n\n var generator\n var length = activeGenerators.length\n\n for (var i = 0; i < length; i++) {\n generator = activeGenerators[i]\n\n if (generator.supports(context)) {\n return generator.generate(context)\n }\n }\n\n return defaultGenerator.generate(context)\n}\n\n/**\n * Clears all previously generated hash codes that may been cached by any active {@link CachingHashCodeGenerator}\n * implementations.\n *\n * Such implementations only cache hash codes generated while the allowCache
option is enabled and it is\n * unlikely that an application would be required to call this method, however, it is here if needed and also for\n * testing purposes.\n *\n * @return {void}\n * @public\n * @static\n * @memberof hashCode\n */\nhashCode.clearCache = function clearCache() {\n activeGenerators.forEach(function(generator) {\n if (typeof generator.clearCache === 'function') {\n generator.clearCache()\n }\n })\n}\n\nmodule.exports = hashCode\n\n/**\n * Called with the name and value of a property belonging to an object for which a hash code is being generated to\n * determine whether the hash code for the property should be included in that generated for the object.\n *\n * @callback Nevis~HashCodeFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and whose hash code is being generated\n * @return {boolean} true
if the hash code for obj
should consist of that generated for the\n * given property; otherwise false
.\n */\n\n/**\n * The options to be used to generate the hash code.\n *\n * @typedef {Object} Nevis~HashCodeOptions\n * @property {boolean} [allowCache=true] - true
to allow generators to cache generated hash codes for\n * faster re-generation; otherwise false
. Only applies to implementations of\n * {@link CachingHashCodeGenerator}.\n * @property {Nevis~HashCodeFilterPropertyCallback} [filterProperty] - A function to be called to filter properties\n * based on their name and value when generating hash codes for objects to determine whether they should be included.\n * This is not called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreHashCode] - true
to ignore the \"hashCode\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when generating hash codes\n * for objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when generating hash codes for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticHashCode = require('./')\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @constructor\n */\nfunction HashCodeBuilder(initial, multiplier) {\n if (initial == null) {\n initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE\n } else if (initial % 2 === 0) {\n throw new Error('initial must be an odd number')\n }\n\n if (multiplier == null) {\n multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE\n } else if (multiplier % 2 === 0) {\n throw new Error('multiplier must be an odd number')\n }\n\n /**\n * The current hash code for this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._hash = initial\n\n /**\n * The multiplier to be used by this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._multiplier = multiplier\n}\n\n/**\n * The default initial value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_INITIAL_VALUE = 17\n\n/**\n * The default multiplier value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_MULTIPLIER_VALUE = 37\n\n/**\n * Appends the specified value
to this {@link HashCodeBuilder}, generating the hash code for it using the\n * options
provided.\n *\n * @param {*} value - the value whose hash code is to be appended (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.append = function append(value, options) {\n this._hash = (this._hash * this._multiplier) + staticHashCode(value, options)\n\n return this\n}\n\n/**\n * Appends the result of computing the hash code for a super class to this {@link HashCodeBuilder}.\n *\n * @param {number} superHashCode - the result of computing the hash code for a super class\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.appendSuper = function appendSuper(superHashCode) {\n this._hash = (this._hash * this._multiplier) + superHashCode\n\n return this\n}\n\n/**\n * Returns the computed hash code.\n *\n * @return {number} The hash code based on the appended values.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.build = function build() {\n return this._hash\n}\n\n/**\n * Returns the hash code for this {@link HashCodeBuilder}.\n *\n * This method will return the computed hash code based on the appended values.\n *\n * @return {number} The hash code.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.hashCode = function hashCode() {\n return this._hash\n}\n\nmodule.exports = HashCodeBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n */\nfunction toString(value) {\n if (typeof value === 'undefined') {\n return 'undefined'\n }\n if (value == null) {\n return 'null'\n }\n\n return value.toString()\n}\n\nmodule.exports = toString\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsBuilder = require('./equals/builder')\nvar HashCodeBuilder = require('./hash-code/builder')\nvar Nevis = require('./nevis')\nvar staticEquals = require('./equals')\nvar staticHashCode = require('./hash-code')\nvar staticToString = require('./to-string')\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.equals = staticEquals\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.EqualsBuilder = EqualsBuilder\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.hashCode = staticHashCode\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.HashCodeBuilder = HashCodeBuilder\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.toString = staticToString\n\n/**\n * Returns whether this instance is \"equal to\" the specified obj
.\n *\n * This method implements an equivalence relation on non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, x.equals(x)
should return\n * true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * x.equals(y)
should return true
if and only if y.equals(x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if x.equals(y)
returns true
and y.equals(z)
returns true
, then\n * x.equals(z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of x.equals(y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, x.equals(null)
should return\n * false
. \n *
\n *\n * The default implementation of this method is the most discriminating possible equivalence relation on objects; that\n * is, for any non-null reference values x
and y
, this method returns true
if,\n * and only if, x
and y
are exactly equal (x === y
has the value\n * true
).\n *\n * Please note that it is generally necessary to override the {@link Nevis#hashCode} method whenever this method is\n * overridden, so as to maintain the general contract for the {@link Nevis#hashCode} method, which states that equal\n * objects must have equal hash codes.\n *\n * @param {*} obj - the reference to which this instance is to be compared (may be null
)\n * @return {boolean} true
if this instance is equal to obj
; otherwise false
.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.equals = function equals(obj) {\n return this === obj\n}\n\n/**\n * Returns the hash code for this instance. This method is supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same instance more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the instance is modified. This number need not remain consistent from one execution of an application\n * to another execution of the same application. \n * - If two instances are equal, that calling the
hashCode
method on each of the two instances must\n * produce the same number result. \n * - It is not required that if two instances are unequal, that calling the
hashCode
method on\n * each of the two instances must produce distinct number results. However, the programmer should be aware that\n * producing distinct number results for unequal instances may improve the performance of hash tables. \n *
\n *\n * The default implementation of this method will attempt to generate the hash code based on all of the fields on this\n * instance.\n *\n * Please note that it is generally necessary to override the {@link Nevis#equals} method whenever this method is\n * overridden, so as to maintain the above contract where equal objects must have equal hash codes.\n *\n * @return {number} The hash code.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.hashCode = function hashCode() {\n return staticHashCode(this, { ignoreHashCode: true })\n}\n\n/**\n * Returns a string representation of this instance.\n *\n * In general, the {@code Nevis#toString} method returns a string that \"textually represents\" this instance. The result\n * should be a concise but informative representation that is easy for a person to read.\n *\n * The default implementation of this method will return a string consisting of this instance's class name, the at-sign\n * character (@
), and the hexadecimal representation of the hash code of this instance.\n *\n * @return {string} A string representation of this instance.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.toString = function toString() {\n return this.constructor.class_ + '@' + this.hashCode().toString(16)\n}\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src')\n"],"names":["extend","EqualsComparator","CollectionEqualsComparator","HashEqualsComparator","ArrayEqualsComparator","DateEqualsComparator","NumberEqualsComparator","ObjectEqualsComparator","StringEqualsComparator","ToStringEqualsComparator","comparators","context","EqualsContext","staticEquals","HashCodeGenerator","CollectionHashCodeGenerator","HashHashCodeGenerator","CachingHashCodeGenerator","StringHashCodeGenerator","ArrayHashCodeGenerator","BooleanHashCodeGenerator","DateHashCodeGenerator","ObjectHashCodeGenerator","ToStringHashCodeGenerator","generators","HashCodeContext","staticHashCode","Nevis","EqualsBuilder","HashCodeBuilder","staticToString","require$$0"],"mappings":";;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;AAQA,MAAI,WAAW,8BAA8B,WAAW,EAAE,CAAA;;;;;;;AAO1D,MAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAA;;;;;;;AAOpD,MAAI,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAA;;;;;;;;;;;;AAYjC,EAAA,SAAS,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE;IAC3C,IAAI,MAAM,CAAA;;IAEV,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE;MACvC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;KAClC,MAAM;MACL,WAAW,CAAC,SAAS,GAAG,SAAS,CAAA;MACjC,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;MAC1B,WAAW,CAAC,SAAS,GAAG,IAAI,CAAA;KAC7B;;IAED,IAAI,UAAU,EAAE;MACd,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;KACvC;;IAED,OAAO,MAAM;GACd;;;;;;;;;;;;;;;;;;;;;;;AAuBD,EAAA,SAAS,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE;IACrD,IAAI,gBAAgB,GAAG,IAAI,CAAA;;IAE3B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;MAC5B,OAAO,GAAG,SAAS,CAAA;MACnB,SAAS,GAAG,WAAW,CAAA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comparator.js","../src/equals/comparators/collection-comparator.js","../src/equals/comparators/array-comparator.js","../src/equals/comparators/date-comparator.js","../src/equals/comparators/hash-comparator.js","../src/equals/comparators/map-comparator.js","../src/equals/comparators/number-comparator.js","../src/equals/comparators/object-comparator.js","../src/equals/comparators/set-comparator.js","../src/equals/comparators/string-comparator.js","../src/equals/comparators/to-string-comparator.js","../src/equals/comparators/index.js","../src/equals/context.js","../src/equals/index.js","../src/equals/builder.js","../src/hash-code/generators/generator.js","../src/hash-code/generators/collection-generator.js","../src/hash-code/generators/array-generator.js","../src/hash-code/generators/boolean-generator.js","../src/hash-code/generators/caching-generator.js","../src/hash-code/generators/date-generator.js","../src/hash-code/generators/hash-generator.js","../src/hash-code/generators/map-generator.js","../src/hash-code/generators/object-generator.js","../src/hash-code/generators/set-generator.js","../src/hash-code/generators/string-generator.js","../src/hash-code/generators/to-string-generator.js","../src/hash-code/generators/index.js","../src/hash-code/context.js","../src/hash-code/index.js","../src/hash-code/builder.js","../src/nevis.js","../src/to-string/index.js","../src/index.js","../index.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * The strings for all array types (incl. typed arrays), as generated by Object.prototype.toString
.\n *\n * @public\n * @type {string[]}\n */\nexports.typeStrings = [\n 'Array',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array'\n].map(function(str) {\n return '[object ' + str + ']'\n})\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore next */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for comparing the values within a specific {@link EqualsContext} to check whether they are equal.\n *\n * Individual EqualsComparator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly provide a more suitable comparison. The\n * {@link EqualsContext} should never be modified but can be copied via {@link EqualsContext#copy}.\n *\n * A EqualsComparator
is only called once it has been determined that the values within the\n * {@link EqualsContext} are not exactly equal, neither are null
, and both share the same type.\n *\n * Implementations must implement the {@link EqualsComparator#compare} and {@link EqualsComparator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction EqualsComparator() {}\nEqualsComparator.class_ = 'EqualsComparator'\nEqualsComparator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof EqualsComparator\n */\nEqualsComparator.extend = extend\n\n/**\n * Compares the values within the specified context
.\n *\n * This method is only called when {@link EqualsComparator#supports} indicates that this {@link EqualsComparator}\n * supports context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} whose values are to be compared\n * @return {boolean} true
if the values within context
are equal; otherwise\n * false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.compare = /* istanbul ignore next */ function compare(context) {}\n\n/**\n * Returns whether this {@link EqualsComparator} supports the specified context
.\n *\n * This method should only return true
when {@link EqualsComparator#compare} can compare the values within\n * context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} to be checked\n * @return {boolean} true
if this {@link EqualsComparator} can compare the values within\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = EqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * values types that contain a collection of other values. This is achieved by requesting the elements contained within\n * e value as an array from the implementation and then compares each element to determine whether the values are equal.\n *\n * Implementations must implement the {@link CollectionEqualsComparator#getElements} and\n * {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar CollectionEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionEqualsComparator#\n */\n compare: function compare(context) {\n var elements = this.getElements(context.value, context)\n var otherElements = this.getElements(context.other, context)\n var length = elements.length\n\n if (length !== otherElements.length) {\n return false\n }\n\n while (length--) {\n if (!context.equals(elements[length], otherElements[length])) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the elements contained within the specified collection
.\n *\n * @param {*} collection - the collection whose elements are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The elements contained within collection
.\n * @protected\n * @abstract\n * @memberof CollectionEqualsComparator#\n */\n getElements: /* istanbul ignore next */ function getElements(collection, context) {}\n\n})\n\nmodule.exports = CollectionEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar arrays = require('../../util/arrays')\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar ArrayEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n getElements: function getElements(collection) {\n return collection\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n supports: function supports(context) {\n return arrays.typeStrings.indexOf(context.string) >= 0\n }\n\n})\n\nmodule.exports = ArrayEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar DateEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.getTime() === context.other.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the keys contained within each\n * value as an array from the implementation and then compares each key/value pair to determine whether the values are\n * equal.\n *\n * Implementations must implement the {@link HashEqualsComparator#getKeys}, {@link HashEqualsComparator#getValue}\n * and {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar HashEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashEqualsComparator#\n */\n compare: function compare(context) {\n var value = context.value\n var other = context.other\n var keys = this.getKeys(value, context)\n var length = keys.length\n\n if (length !== this.getKeys(other, context).length) {\n return false\n }\n\n var key\n\n while (length--) {\n key = keys[length]\n\n if (!context.equals(this.getValue(value, key, context), this.getValue(other, key, context))) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the keys contained within the value of the specified hash
.\n *\n * @param {*} hash - the hash whose keys are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The keys contained within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getKeys: /* istanbul ignore next */ function getKeys(hash, context) {},\n\n /**\n * Returns the value associated with the specified key
in the hash
provided.\n *\n * @param {*} hash - the hash from which the value is to be returned\n * @param {*} key - the key for which the associated value is to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {*} The value for key
within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getValue: /* istanbul ignore next */ function getValue(hash, key, context) {}\n\n})\n\nmodule.exports = HashEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports map values.\n *\n * MapEqualsComparator
ignores insertion order when comparing maps.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar MapEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n getKeys: function getKeys(hash) {\n return Array.from(hash.keys())\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash.get(key)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Map]'\n }\n\n})\n\nmodule.exports = MapEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports number values (including NaN
).\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar NumberEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n compare: function compare(context) {\n return context.value !== context.value ? context.other !== context.other : context.value === context.other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'number'\n }\n\n})\n\nmodule.exports = NumberEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar ObjectEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getKeys: function getKeys(hash, context) {\n var keys = []\n var options = context.options\n var value\n\n for (var key in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, key)) {\n value = this.getValue(hash, key, context)\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(key, value, hash)) {\n keys.push(key)\n }\n }\n }\n\n return keys\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash[key]\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports set values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar SetEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetEqualsComparator#\n */\n getElements: function getElements(collection) {\n return Array.from(collection)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Set]'\n }\n\n})\n\nmodule.exports = SetEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar StringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n compare: function compare(context) {\n var other = context.other\n var value = context.value\n\n if (context.options.ignoreCase) {\n other = other.toLocaleUpperCase()\n value = value.toLocaleUpperCase()\n }\n\n return value === other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports miscellaneous values by comparing their string\n * representations (generated by calling toString
on each value).\n *\n * This {@link EqualsComparator} currently only supports functions and regular expressions.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar ToStringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.toString() === context.other.toString()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayEqualsComparator = require('./array-comparator')\nvar CollectionEqualsComparator = require('./collection-comparator')\nvar DateEqualsComparator = require('./date-comparator')\nvar EqualsComparator = require('./comparator')\nvar HashEqualsComparator = require('./hash-comparator')\nvar MapEqualsComparator = require('./map-comparator')\nvar NumberEqualsComparator = require('./number-comparator')\nvar ObjectEqualsComparator = require('./object-comparator')\nvar SetEqualsComparator = require('./set-comparator')\nvar StringEqualsComparator = require('./string-comparator')\nvar ToStringEqualsComparator = require('./to-string-comparator')\n\n/**\n * A hash containing constructors for all equals comparators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayEqualsComparator: ArrayEqualsComparator,\n CollectionEqualsComparator: CollectionEqualsComparator,\n DateEqualsComparator: DateEqualsComparator,\n EqualsComparator: EqualsComparator,\n HashEqualsComparator: HashEqualsComparator,\n MapEqualsComparator: MapEqualsComparator,\n NumberEqualsComparator: NumberEqualsComparator,\n ObjectEqualsComparator: ObjectEqualsComparator,\n SetEqualsComparator: SetEqualsComparator,\n StringEqualsComparator: StringEqualsComparator,\n ToStringEqualsComparator: ToStringEqualsComparator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the values whose equality is to be tested as well as the string representation and type for the value which\n * can be checked elsewhere for type-checking etc.\n *\n * A EqualsContext
is only created once it has been determined that both values not exactly equal\n * and neither are null
. Once instantiated, {@link EqualsContext#validate} should be called to ensure that\n * both values share the same type.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @param {Function} equals - a reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}\n * @param {?Nevis~EqualsOptions} options - the options to be used (may be null
)\n * @public\n * @constructor\n */\nfunction EqualsContext(value, other, equals, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}.\n *\n * @private\n * @type {Function}\n */\n this._equals = equals\n\n /**\n * The options to be used to test equality for both of the values.\n *\n * @public\n * @type {Nevis~EqualsOptions}\n */\n this.options = {\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreCase: Boolean(options.ignoreCase),\n ignoreEquals: Boolean(options.ignoreEquals),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The other value to be checked against the value
.\n *\n * @public\n * @type {*}\n */\n this.other = other\n\n /**\n * The string representation of the values to be tested for equality.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the values to be tested for equality.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value to be checked against the other
.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link EqualsContext} but for the specified value
and other
value\n * instead.\n *\n * This method can be useful for when an {@link EqualsComparator} implementation wants to test equality based on a value\n * derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @return {EqualsContext} A copy of this {@link EqualsContext} for value
and other
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.copy = function copy(value, other) {\n return new EqualsContext(value, other, this._equals, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.equals} from within an {@link EqualsComparator}.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.equals = function equals(value, other) {\n return this._equals(value, other, this.options)\n}\n\n/**\n * Validates this {@link EqualsContext} by checking whether its values share the same type.\n *\n * This method must be called before attempting to call any {@link EqualsComparator} as they are meant to be able\n * to assume that both values share the same type.\n *\n * @return {boolean} true
if both values share the same type; otherwise false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.validate = function validate() {\n return this.string === Object.prototype.toString.call(this.other) && this.type === typeof this.other\n}\n\nmodule.exports = EqualsContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar comparators = require('./comparators')\nvar EqualsContext = require('./context')\n\n/**\n * The list of active equals comparators that will be checked for any that support the values.\n *\n * @private\n * @type {EqualsComparator[]}\n */\nvar activeComparators = [\n new comparators.NumberEqualsComparator(),\n new comparators.StringEqualsComparator(),\n new comparators.DateEqualsComparator(),\n new comparators.ToStringEqualsComparator(),\n new comparators.ArrayEqualsComparator(),\n new comparators.SetEqualsComparator(),\n new comparators.MapEqualsComparator(),\n new comparators.ObjectEqualsComparator()\n]\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n */\nfunction equals(value, other, options) {\n if (value === other) {\n return true\n }\n if (value == null || other == null) {\n return value === other\n }\n\n var context = new EqualsContext(value, other, equals, options)\n\n if (!context.options.ignoreEquals && typeof value.equals === 'function') {\n return value.equals(other)\n }\n\n if (!context.validate()) {\n return false\n }\n\n var comparator\n var length = activeComparators.length\n\n for (var i = 0; i < length; i++) {\n comparator = activeComparators[i]\n\n if (comparator.supports(context)) {\n return comparator.compare(context)\n }\n }\n\n return false\n}\n\nmodule.exports = equals\n\n/**\n * Called with the name and value of a property belonging to an object whose equality is being tested to determine\n * whether the property should be checked against that on the other object within the equality test.\n *\n * Keep in mind that including a property on one object but not on the other will almost certainly result in\n * inequality.\n *\n * @callback Nevis~EqualsFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and that is being checked against another\n * @return {boolean} true
if the equality of the property should be tested against that on the other\n * object; otherwise false
.\n */\n\n/**\n * The options to be used to test equality.\n *\n * @typedef {Object} Nevis~EqualsOptions\n * @property {Nevis~EqualsFilterPropertyCallback} [filterProperty] - A function to be called to filter properties based\n * on their name and value when testing equality of objects to determine whether they should be tested. This is not\n * called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreCase] - true
to ignore case when testing equality for strings; otherwise\n * false
.\n * @property {boolean} [ignoreEquals] - true
to ignore the \"equals\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when testing equality for\n * objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when testing equality for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticEquals = require('./')\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @constructor\n */\nfunction EqualsBuilder() {\n /**\n * The current equals for this {@link EqualsBuilder}.\n *\n * @private\n * @type {boolean}\n */\n this._equals = true\n}\n\n/**\n * Appends the specified value
and other
to this {@link EqualsBuilder}, testing equality for\n * them using the options
provided.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to check equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.append = function append(value, other, options) {\n if (this._equals) {\n this._equals = staticEquals(value, other, options)\n }\n\n return this\n}\n\n/**\n * Appends the result of testing equality for a super class to this {@link EqualsBuilder}.\n *\n * @param {boolean} superEquals - the result of testing equality for a super class\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.appendSuper = function appendSuper(superEquals) {\n if (this._equals) {\n this._equals = superEquals\n }\n\n return this\n}\n\n/**\n * Returns whether the values that have been appended to this {@link EqualsBuilder} are all equal.\n *\n * @return {boolean} true
if all appended values are equal; otherwise false
.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.build = function build() {\n return this._equals\n}\n\nmodule.exports = EqualsBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for generating a hash code for a specific {@link HashCodeContext}.\n *\n * Individual HashCodeGenerator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly generate a more suitable hash code. The\n * {@link HashCodeContext} should never be modified but can be copied via {@link HashCodeContext#copy}.\n *\n * Implementations must implement the {@link HashCodeGenerator#generate} and {@link HashCodeGenerator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction HashCodeGenerator() {}\nHashCodeGenerator.class_ = 'HashCodeGenerator'\nHashCodeGenerator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof HashCodeGenerator\n */\nHashCodeGenerator.extend = extend\n\n/**\n * Returns a hash code for the specified context
.\n *\n * This method is only called when {@link HashCodeGenerator#supports} indicates that this {@link HashCodeGenerator}\n * supports context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.generate = /* istanbul ignore next */ function generate(context) {}\n\n/**\n * Returns whether this {@link HashCodeGenerator} supports the specified context
.\n *\n * This method should only return true
when {@link HashCodeGenerator#generate} can generate a hash code for\n * context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} to be checked\n * @return {boolean} true
if this {@link HashCodeGenerator} can generate a hash code for\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = HashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that contain a collection of other values. This is achieved by requesting the elements contained within\n * the value as an array from the implementation and then generates hash codes for each element to compute the hash code\n * for the value.\n *\n * Implementations must implement the {@link CollectionHashCodeGenerator#getElements} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CollectionHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionHashCodeGenerator#\n */\n generate: function generate(context) {\n var elements = this.getElements(context)\n\n return elements.reduce(function(hash, element) {\n return ((31 * hash) + context.hashCode(element)) | 0\n }, 1)\n },\n\n /**\n * Returns the elements contained within the value of the specified context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose children elements are to\n * be returned\n * @return {Array} The elements contained within the value of context
.\n * @protected\n * @abstract\n * @memberof CollectionHashCodeGenerator#\n */\n getElements: /* istanbul ignore next */ function getElements(context) {}\n\n})\n\nmodule.exports = CollectionHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar arrays = require('../../util/arrays')\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar ArrayHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return context.value\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n supports: function support(context) {\n return arrays.typeStrings.indexOf(context.string) >= 0\n }\n\n})\n\nmodule.exports = ArrayHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports boolean values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar BooleanHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value ? 1231 : 1237\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'boolean'\n }\n\n})\n\nmodule.exports = BooleanHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to cache\n * generated hash codes to avoid re-generating them for the same values. Obviously, this should only ever be done for\n * immutable values.\n *\n * Generated hash codes should only ever be cached when the allowCache
option is enabled, however, the\n * cache will always be checked before attempting to generate a hash code for a value.\n *\n * Implementations must implement the {@link CachingHashCodeGenerator#generateInternal} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CachingHashCodeGenerator = HashCodeGenerator.extend(function() {\n /**\n * A cache of values mapped to their previously generated hash codes.\n *\n * @private\n * @type {Object.<*, number>}\n * @memberof CachingHashCodeGenerator#\n */\n this._cache = {}\n}, {\n\n /**\n * Clears the cache of hash codes that have been previously generated by this {@link CachingHashCodeGenerator} while\n * the allowCache
option has been enabled.\n *\n * @return {void}\n * @public\n * @memberof CachingHashCodeGenerator#\n */\n clearCache: function clearCache() {\n this._cache = {}\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof CachingHashCodeGenerator#\n */\n generate: function generate(context) {\n var hash = this._cache[context.value]\n\n if (hash == null) {\n hash = this.generateInternal(context)\n\n if (context.options.allowCache) {\n this._cache[context.value] = hash\n }\n }\n\n return hash\n },\n\n /**\n * Returns a hash code for the specified context
.\n *\n * This method is called internally by {@link CachingHashCodeGenerator#generate} only when a hash code needs to be\n * generated (i.e. the cache doesn't contain a previously generated hash code for the value of context
).\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @protected\n * @abstract\n * @memberof CachingHashCodeGenerator#\n */\n generateInternal: /* istanbul ignore next */ function generateInternal(context) {}\n\n})\n\nmodule.exports = CachingHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar DateHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the entries of key/value pairs\n * contained within the value as an multi-dimensional array from the implementation and then generates hash codes for\n * each entry to compute the hash code for the value.\n *\n * Implementations must implement the {@link HashHashCodeGenerator#getEntries} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar HashHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashHashCodeGenerator#\n */\n generate: function generate(context) {\n var entries = this.getEntries(context)\n\n return entries.reduce(function(hash, entry) {\n return hash + (context.hashCode(entry[0]) ^ context.hashCode(entry[1]))\n }, 0)\n },\n\n /**\n * Returns the entries contained within the value of the specified context
.\n *\n * This method returns a multi-dimensional array where each entry is an array consisting of the key and value, in that\n * order.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose entries are to be\n * returned\n * @return {Array.} The entries contained within the value of context
.\n * @protected\n * @abstract\n * @memberof HashHashCodeGenerator#\n */\n getEntries: /* istanbul ignore next */ function getEntries(context) {}\n\n})\n\nmodule.exports = HashHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports map values.\n *\n * Insertion order should have no impact on the hash code generated by MapHashCodeGenerator
.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar MapHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n return Array.from(context.value.entries())\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Map]'\n }\n\n})\n\nmodule.exports = MapHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar ObjectHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n var entries = []\n var hash = context.value\n var options = context.options\n var value\n\n for (var name in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, name)) {\n value = hash[name]\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(name, value, hash)) {\n entries.push([ name, value ])\n }\n }\n }\n\n return entries\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports set values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar SetHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return Array.from(context.value)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetHashCodeGenerator#\n */\n supports: function support(context) {\n return context.string === '[object Set]'\n }\n\n})\n\nmodule.exports = SetHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CachingHashCodeGenerator = require('./caching-generator')\n\n/**\n * An implementation of {@link CachingHashCodeGenerator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends CachingHashCodeGenerator\n */\nvar StringHashCodeGenerator = CachingHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n generateInternal: function generateInternal(context) {\n var hash = 0\n var length = context.value.length\n\n for (var i = 0; i < length; i++) {\n hash = ((31 * hash) + context.value.charCodeAt(i)) | 0\n }\n\n return hash\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar StringHashCodeGenerator = require('./string-generator')\n\n/**\n * An extension of {@link StringHashCodeGenerator} that supports miscellaneous values by generating hash codes for their\n * string representations (generated by calling toString
on the value).\n *\n * This {@link HashCodeGenerator} currently only supports functions, numbers and regular expressions.\n *\n * @protected\n * @constructor\n * @extends StringHashCodeGenerator\n */\nvar ToStringHashCodeGenerator = StringHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n generate: function generate(context) {\n return ToStringHashCodeGenerator.super_.prototype.generate.call(this, context.copy(context.value.toString()))\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.type === 'number' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayHashCodeGenerator = require('./array-generator')\nvar BooleanHashCodeGenerator = require('./boolean-generator')\nvar CachingHashCodeGenerator = require('./caching-generator')\nvar CollectionHashCodeGenerator = require('./collection-generator')\nvar DateHashCodeGenerator = require('./date-generator')\nvar HashCodeGenerator = require('./generator')\nvar HashHashCodeGenerator = require('./hash-generator')\nvar MapHashCodeGenerator = require('./map-generator')\nvar ObjectHashCodeGenerator = require('./object-generator')\nvar SetHashCodeGenerator = require('./set-generator')\nvar StringHashCodeGenerator = require('./string-generator')\nvar ToStringHashCodeGenerator = require('./to-string-generator')\n\n/**\n * A hash containing constructors for all hash code generators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayHashCodeGenerator: ArrayHashCodeGenerator,\n BooleanHashCodeGenerator: BooleanHashCodeGenerator,\n CachingHashCodeGenerator: CachingHashCodeGenerator,\n CollectionHashCodeGenerator: CollectionHashCodeGenerator,\n DateHashCodeGenerator: DateHashCodeGenerator,\n HashCodeGenerator: HashCodeGenerator,\n HashHashCodeGenerator: HashHashCodeGenerator,\n MapHashCodeGenerator: MapHashCodeGenerator,\n ObjectHashCodeGenerator: ObjectHashCodeGenerator,\n SetHashCodeGenerator: SetHashCodeGenerator,\n StringHashCodeGenerator: StringHashCodeGenerator,\n ToStringHashCodeGenerator: ToStringHashCodeGenerator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the value for which a hash code is to be generated as well string representation and type of the value which\n * can be checked elsewhere for type-checking etc.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @param {Function} hashCode - a reference to {@link Nevis.hashCode} which can be called within a\n * {@link HashCodeGenerator}\n * @param {?Nevis~HashCodeOptions} options - the options to be used (may be null
)\n * @protected\n * @constructor\n */\nfunction HashCodeContext(value, hashCode, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.hashCode} which can be called within a {@link HashCodeGenerator}.\n *\n * @private\n * @type {Function}\n */\n this._hashCode = hashCode\n\n /**\n * The options to be used to generate the hash code for the value.\n *\n * @public\n * @type {Nevis~HashCodeOptions}\n */\n this.options = {\n allowCache: options.allowCache !== false,\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreHashCode: Boolean(options.ignoreHashCode),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The string representation of the value whose hash code is to be generated.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the value whose hash code is to be generated.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value whose hash code is to be generated.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link HashCodeContext} but for the specified value
instead.\n *\n * This method can be useful for when a {@link HashCodeGenerator} implementation wants to generate the hash code based\n * on a value derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @return {HashCodeContext} A copy of this {@link HashCodeContext} for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.copy = function copy(value) {\n return new HashCodeContext(value, this._hashCode, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.hashCode} from within a {@link HashCodeGenerator}.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @return {number} A hash code for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.hashCode = function hashCode(value) {\n return this._hashCode(value, this.options)\n}\n\nmodule.exports = HashCodeContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar generators = require('./generators')\nvar HashCodeContext = require('./context')\n\n/**\n * The list of active generators that will be checked for any that support the value before falling back to\n * {@link defaultGenerator}.\n *\n * @private\n * @type {HashCodeGenerator[]}\n */\nvar activeGenerators = [\n new generators.BooleanHashCodeGenerator(),\n new generators.StringHashCodeGenerator(),\n new generators.DateHashCodeGenerator(),\n new generators.ToStringHashCodeGenerator(),\n new generators.ArrayHashCodeGenerator(),\n new generators.SetHashCodeGenerator(),\n new generators.MapHashCodeGenerator()\n]\n\n/**\n * The default generator to be used when no others support the value.\n *\n * @private\n * @type {HashCodeGenerator}\n */\nvar defaultGenerator = new generators.ObjectHashCodeGenerator()\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n */\nfunction hashCode(value, options) {\n if (value == null) {\n return 0\n }\n\n var context = new HashCodeContext(value, hashCode, options)\n\n if (!context.options.ignoreHashCode && typeof value.hashCode === 'function') {\n return value.hashCode()\n }\n\n var generator\n var length = activeGenerators.length\n\n for (var i = 0; i < length; i++) {\n generator = activeGenerators[i]\n\n if (generator.supports(context)) {\n return generator.generate(context)\n }\n }\n\n return defaultGenerator.generate(context)\n}\n\n/**\n * Clears all previously generated hash codes that may been cached by any active {@link CachingHashCodeGenerator}\n * implementations.\n *\n * Such implementations only cache hash codes generated while the allowCache
option is enabled and it is\n * unlikely that an application would be required to call this method, however, it is here if needed and also for\n * testing purposes.\n *\n * @return {void}\n * @public\n * @static\n * @memberof hashCode\n */\nhashCode.clearCache = function clearCache() {\n activeGenerators.forEach(function(generator) {\n if (typeof generator.clearCache === 'function') {\n generator.clearCache()\n }\n })\n}\n\nmodule.exports = hashCode\n\n/**\n * Called with the name and value of a property belonging to an object for which a hash code is being generated to\n * determine whether the hash code for the property should be included in that generated for the object.\n *\n * @callback Nevis~HashCodeFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and whose hash code is being generated\n * @return {boolean} true
if the hash code for obj
should consist of that generated for the\n * given property; otherwise false
.\n */\n\n/**\n * The options to be used to generate the hash code.\n *\n * @typedef {Object} Nevis~HashCodeOptions\n * @property {boolean} [allowCache=true] - true
to allow generators to cache generated hash codes for\n * faster re-generation; otherwise false
. Only applies to implementations of\n * {@link CachingHashCodeGenerator}.\n * @property {Nevis~HashCodeFilterPropertyCallback} [filterProperty] - A function to be called to filter properties\n * based on their name and value when generating hash codes for objects to determine whether they should be included.\n * This is not called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreHashCode] - true
to ignore the \"hashCode\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when generating hash codes\n * for objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when generating hash codes for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticHashCode = require('./')\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @constructor\n */\nfunction HashCodeBuilder(initial, multiplier) {\n if (initial == null) {\n initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE\n } else if (initial % 2 === 0) {\n throw new Error('initial must be an odd number')\n }\n\n if (multiplier == null) {\n multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE\n } else if (multiplier % 2 === 0) {\n throw new Error('multiplier must be an odd number')\n }\n\n /**\n * The current hash code for this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._hash = initial\n\n /**\n * The multiplier to be used by this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._multiplier = multiplier\n}\n\n/**\n * The default initial value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_INITIAL_VALUE = 17\n\n/**\n * The default multiplier value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_MULTIPLIER_VALUE = 37\n\n/**\n * Appends the specified value
to this {@link HashCodeBuilder}, generating the hash code for it using the\n * options
provided.\n *\n * @param {*} value - the value whose hash code is to be appended (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.append = function append(value, options) {\n this._hash = (this._hash * this._multiplier) + staticHashCode(value, options)\n\n return this\n}\n\n/**\n * Appends the result of computing the hash code for a super class to this {@link HashCodeBuilder}.\n *\n * @param {number} superHashCode - the result of computing the hash code for a super class\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.appendSuper = function appendSuper(superHashCode) {\n this._hash = (this._hash * this._multiplier) + superHashCode\n\n return this\n}\n\n/**\n * Returns the computed hash code.\n *\n * @return {number} The hash code based on the appended values.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.build = function build() {\n return this._hash\n}\n\n/**\n * Returns the hash code for this {@link HashCodeBuilder}.\n *\n * This method will return the computed hash code based on the appended values.\n *\n * @return {number} The hash code.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.hashCode = function hashCode() {\n return this._hash\n}\n\nmodule.exports = HashCodeBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n */\nfunction toString(value) {\n if (typeof value === 'undefined') {\n return 'undefined'\n }\n if (value == null) {\n return 'null'\n }\n\n return value.toString()\n}\n\nmodule.exports = toString\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsBuilder = require('./equals/builder')\nvar HashCodeBuilder = require('./hash-code/builder')\nvar Nevis = require('./nevis')\nvar staticEquals = require('./equals')\nvar staticHashCode = require('./hash-code')\nvar staticToString = require('./to-string')\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.equals = staticEquals\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.EqualsBuilder = EqualsBuilder\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.hashCode = staticHashCode\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.HashCodeBuilder = HashCodeBuilder\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.toString = staticToString\n\n/**\n * Returns whether this instance is \"equal to\" the specified obj
.\n *\n * This method implements an equivalence relation on non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, x.equals(x)
should return\n * true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * x.equals(y)
should return true
if and only if y.equals(x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if x.equals(y)
returns true
and y.equals(z)
returns true
, then\n * x.equals(z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of x.equals(y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, x.equals(null)
should return\n * false
. \n *
\n *\n * The default implementation of this method is the most discriminating possible equivalence relation on objects; that\n * is, for any non-null reference values x
and y
, this method returns true
if,\n * and only if, x
and y
are exactly equal (x === y
has the value\n * true
).\n *\n * Please note that it is generally necessary to override the {@link Nevis#hashCode} method whenever this method is\n * overridden, so as to maintain the general contract for the {@link Nevis#hashCode} method, which states that equal\n * objects must have equal hash codes.\n *\n * @param {*} obj - the reference to which this instance is to be compared (may be null
)\n * @return {boolean} true
if this instance is equal to obj
; otherwise false
.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.equals = function equals(obj) {\n return this === obj\n}\n\n/**\n * Returns the hash code for this instance. This method is supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same instance more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the instance is modified. This number need not remain consistent from one execution of an application\n * to another execution of the same application. \n * - If two instances are equal, that calling the
hashCode
method on each of the two instances must\n * produce the same number result. \n * - It is not required that if two instances are unequal, that calling the
hashCode
method on\n * each of the two instances must produce distinct number results. However, the programmer should be aware that\n * producing distinct number results for unequal instances may improve the performance of hash tables. \n *
\n *\n * The default implementation of this method will attempt to generate the hash code based on all of the fields on this\n * instance.\n *\n * Please note that it is generally necessary to override the {@link Nevis#equals} method whenever this method is\n * overridden, so as to maintain the above contract where equal objects must have equal hash codes.\n *\n * @return {number} The hash code.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.hashCode = function hashCode() {\n return staticHashCode(this, { ignoreHashCode: true })\n}\n\n/**\n * Returns a string representation of this instance.\n *\n * In general, the {@code Nevis#toString} method returns a string that \"textually represents\" this instance. The result\n * should be a concise but informative representation that is easy for a person to read.\n *\n * The default implementation of this method will return a string consisting of this instance's class name, the at-sign\n * character (@
), and the hexadecimal representation of the hash code of this instance.\n *\n * @return {string} A string representation of this instance.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.toString = function toString() {\n return this.constructor.class_ + '@' + this.hashCode().toString(16)\n}\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src')\n"],"names":["extend","EqualsComparator","CollectionEqualsComparator","HashEqualsComparator","ArrayEqualsComparator","DateEqualsComparator","MapEqualsComparator","NumberEqualsComparator","ObjectEqualsComparator","SetEqualsComparator","StringEqualsComparator","ToStringEqualsComparator","comparators","context","EqualsContext","staticEquals","HashCodeGenerator","CollectionHashCodeGenerator","HashHashCodeGenerator","CachingHashCodeGenerator","StringHashCodeGenerator","ArrayHashCodeGenerator","BooleanHashCodeGenerator","DateHashCodeGenerator","MapHashCodeGenerator","ObjectHashCodeGenerator","SetHashCodeGenerator","ToStringHashCodeGenerator","generators","HashCodeContext","staticHashCode","Nevis","EqualsBuilder","HashCodeBuilder","staticToString","require$$0"],"mappings":";;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;AAQA,iBAAmB,GAAG;IACpB,OAAO;IACP,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,aAAa;IACb,cAAc;IACd,cAAc;GACf,CAAC,GAAG,CAAC,SAAS,GAAG,EAAE;IAClB,OAAO,UAAU,GAAG,GAAG,GAAG,GAAG;GAC9B,CAAC,CAAA;;;;;;EC3CF;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;AAQA,MAAI,WAAW,8BAA8B,WAAW,EAAE,CAAA;;;;;;;AAO1D,MAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAA;;;;;;;AAOpD,MAAI,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAA;;;;;;;;;;;;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AAED,aAAc,GAAGA,KAAK,CAAA;;AC5NtB,WAAc,GAAGI;;;;"}
\ No newline at end of file
diff --git a/dist/nevis.min.js b/dist/nevis.min.js
index d45a001..fa9579e 100644
--- a/dist/nevis.min.js
+++ b/dist/nevis.min.js
@@ -1,4 +1,4 @@
-/*! Nevis v0.3.0 | (C) 2017 Alasdair Mercer, Skelp | MIT License */
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("nevis",t):e.Nevis=t()}(this,function(){"use strict";function e(e,t){var n;return"function"==typeof Object.create?n=Object.create(e):(f.prototype=e,n=new f,f.prototype=null),t&&r(!0,n,t),n}function t(t,n,o,a){var i=this;return"string"!=typeof t&&(a=o,o=n,n=t,t=null),"function"!=typeof n&&(a=o,o=n,n=function(){return i.apply(this,arguments)}),r(!1,n,i,a),n.prototype=e(i.prototype,o),n.prototype.constructor=n,n.class_=t||i.class_,n.super_=i,n}function r(e,t,r){r=d.call(arguments,2);for(var n,o,a=0,i=r.length;a=0}}),b=q,w=v.extend({compare:function(e){return e.value.getTime()===e.other.getTime()},supports:function(e){return"[object Date]"===e.string}}),x=w,A=v.extend({compare:function(e){var t=e.value,r=e.other,n=this.getKeys(t,e),o=n.length;if(o!==this.getKeys(r,e).length)return!1;for(var a;o--;)if(a=n[o],!e.equals(this.getValue(t,a,e),this.getValue(r,a,e)))return!1;return!0},getKeys:function(e,t){},getValue:function(e,t,r){}}),S=A,H=S.extend({getKeys:function(e){return Array.from(e.keys())},getValue:function(e,t){return e.get(t)},supports:function(e){return"[object Map]"===e.string}}),j=H,I=v.extend({compare:function(e){return e.value!==e.value?e.other!==e.other:e.value===e.other},supports:function(e){return"number"===e.type}}),G=I,O=S.extend({getKeys:function(e,t){var r,n=[],o=t.options;for(var a in e)o.ignoreInherited&&!Object.prototype.hasOwnProperty.call(e,a)||(r=this.getValue(e,a,t),"function"==typeof r&&o.ignoreMethods||!o.filterProperty(a,r,e)||n.push(a));return n},getValue:function(e,t){return e[t]},supports:function(e){return"object"===e.type}}),L=O,U=_.extend({getElements:function(e){return Array.from(e)},supports:function(e){return"[object Set]"===e.string}}),T=U,M=v.extend({compare:function(e){var t=e.other,r=e.value;return e.options.ignoreCase&&(t=t.toLocaleUpperCase(),r=r.toLocaleUpperCase()),r===t},supports:function(e){return"string"===e.type}}),P=M,B=v.extend({compare:function(e){return e.value.toString()===e.other.toString()},supports:function(e){return"function"===e.type||"[object RegExp]"===e.string}}),D=B,V={ArrayEqualsComparator:b,CollectionEqualsComparator:_,DateEqualsComparator:x,EqualsComparator:v,HashEqualsComparator:S,MapEqualsComparator:j,NumberEqualsComparator:G,ObjectEqualsComparator:L,SetEqualsComparator:T,StringEqualsComparator:P,ToStringEqualsComparator:D};o.prototype.copy=function(e,t){return new o(e,t,this._equals,this.options)},o.prototype.equals=function(e,t){return this._equals(e,t,this.options)},o.prototype.validate=function(){return this.string===Object.prototype.toString.call(this.other)&&this.type===typeof this.other};var F=o,N=[new V.NumberEqualsComparator,new V.StringEqualsComparator,new V.DateEqualsComparator,new V.ToStringEqualsComparator,new V.ArrayEqualsComparator,new V.SetEqualsComparator,new V.MapEqualsComparator,new V.ObjectEqualsComparator],K=a;i.prototype.append=function(e,t,r){return this._equals&&(this._equals=K(e,t,r)),this},i.prototype.appendSuper=function(e){return this._equals&&(this._equals=e),this},i.prototype.build=function(){return this._equals};var R=i;u.class_="HashCodeGenerator",u.super_=Object,u.extend=m,u.prototype.generate=function(e){},u.prototype.supports=function(e){};var k=u,z=k.extend({generate:function(e){var t=this.getElements(e);return t.reduce(function(t,r){return 31*t+e.hashCode(r)|0},1)},getElements:function(e){}}),J=z,Q=J.extend({getElements:function(e){return e.value},supports:function(e){return g.typeStrings.indexOf(e.string)>=0}}),W=Q,X=k.extend({generate:function(e){return e.value?1231:1237},supports:function(e){return"boolean"===e.type}}),Y=X,Z=k.extend(function(){this._cache={}},{clearCache:function(){this._cache={}},generate:function(e){var t=this._cache[e.value];return null==t&&(t=this.generateInternal(e),e.options.allowCache&&(this._cache[e.value]=t)),t},generateInternal:function(e){}}),$=Z,ee=k.extend({generate:function(e){return e.value.getTime()},supports:function(e){return"[object Date]"===e.string}}),te=ee,re=k.extend({generate:function(e){var t=this.getEntries(e);return t.reduce(function(t,r){return t+(e.hashCode(r[0])^e.hashCode(r[1]))},0)},getEntries:function(e){}}),ne=re,oe=ne.extend({getEntries:function(e){return Array.from(e.value.entries())},supports:function(e){return"[object Map]"===e.string}}),ae=oe,ie=ne.extend({getEntries:function(e){var t,r=[],n=e.value,o=e.options;for(var a in n)o.ignoreInherited&&!Object.prototype.hasOwnProperty.call(n,a)||(t=n[a],"function"==typeof t&&o.ignoreMethods||!o.filterProperty(a,t,n)||r.push([a,t]));return r},supports:function(e){return"object"===e.type}}),ue=ie,se=J.extend({getElements:function(e){return Array.from(e.value)},supports:function(e){return"[object Set]"===e.string}}),pe=se,le=$.extend({generateInternal:function(e){for(var t=0,r=e.value.length,n=0;nObject.prototype.hasOwnProperty.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore else */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for comparing the values within a specific {@link EqualsContext} to check whether they are equal.\n *\n * Individual EqualsComparator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly provide a more suitable comparison. The\n * {@link EqualsContext} should never be modified but can be copied via {@link EqualsContext#copy}.\n *\n * A EqualsComparator
is only called once it has been determined that the values within the\n * {@link EqualsContext} are not exactly equal, neither are null
, and both share the same type.\n *\n * Implementations must implement the {@link EqualsComparator#compare} and {@link EqualsComparator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction EqualsComparator() {}\nEqualsComparator.class_ = 'EqualsComparator'\nEqualsComparator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof EqualsComparator\n */\nEqualsComparator.extend = extend\n\n/**\n * Compares the values within the specified context
.\n *\n * This method is only called when {@link EqualsComparator#supports} indicates that this {@link EqualsComparator}\n * supports context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} whose values are to be compared\n * @return {boolean} true
if the values within context
are equal; otherwise\n * false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.compare = /* istanbul ignore next */ function compare(context) {}\n\n/**\n * Returns whether this {@link EqualsComparator} supports the specified context
.\n *\n * This method should only return true
when {@link EqualsComparator#compare} can compare the values within\n * context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} to be checked\n * @return {boolean} true
if this {@link EqualsComparator} can compare the values within\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = EqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the values whose equality is to be tested as well as the string representation and type for the value which\n * can be checked elsewhere for type-checking etc.\n *\n * A EqualsContext
is only created once it has been determined that both values not exactly equal\n * and neither are null
. Once instantiated, {@link EqualsContext#validate} should be called to ensure that\n * both values share the same type.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @param {Function} equals - a reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}\n * @param {?Nevis~EqualsOptions} options - the options to be used (may be null
)\n * @public\n * @constructor\n */\nfunction EqualsContext(value, other, equals, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}.\n *\n * @private\n * @type {Function}\n */\n this._equals = equals\n\n /**\n * The options to be used to test equality for both of the values.\n *\n * @public\n * @type {Nevis~EqualsOptions}\n */\n this.options = {\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreCase: Boolean(options.ignoreCase),\n ignoreEquals: Boolean(options.ignoreEquals),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The other value to be checked against the value
.\n *\n * @public\n * @type {*}\n */\n this.other = other\n\n /**\n * The string representation of the values to be tested for equality.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the values to be tested for equality.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value to be checked against the other
.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link EqualsContext} but for the specified value
and other
value\n * instead.\n *\n * This method can be useful for when an {@link EqualsComparator} implementation wants to test equality based on a value\n * derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @return {EqualsContext} A copy of this {@link EqualsContext} for value
and other
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.copy = function copy(value, other) {\n return new EqualsContext(value, other, this._equals, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.equals} from within an {@link EqualsComparator}.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.equals = function equals(value, other) {\n return this._equals(value, other, this.options)\n}\n\n/**\n * Validates this {@link EqualsContext} by checking whether its values share the same type.\n *\n * This method must be called before attempting to call any {@link EqualsComparator} as they are meant to be able\n * to assume that both values share the same type.\n *\n * @return {boolean} true
if both values share the same type; otherwise false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.validate = function validate() {\n return this.string === Object.prototype.toString.call(this.other) && this.type === typeof this.other\n}\n\nmodule.exports = EqualsContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar comparators = require('./comparators')\nvar EqualsContext = require('./context')\n\n/**\n * The list of active equals comparators that will be checked for any that support the values.\n *\n * @private\n * @type {EqualsComparator[]}\n */\nvar activeComparators = [\n new comparators.NumberEqualsComparator(),\n new comparators.StringEqualsComparator(),\n new comparators.DateEqualsComparator(),\n new comparators.ToStringEqualsComparator(),\n new comparators.ArrayEqualsComparator(),\n new comparators.ObjectEqualsComparator()\n]\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n */\nfunction equals(value, other, options) {\n if (value === other) {\n return true\n }\n if (value == null || other == null) {\n return value === other\n }\n\n var context = new EqualsContext(value, other, equals, options)\n\n if (!context.options.ignoreEquals && typeof value.equals === 'function') {\n return value.equals(other)\n }\n\n if (!context.validate()) {\n return false\n }\n\n var comparator\n var length = activeComparators.length\n\n for (var i = 0; i < length; i++) {\n comparator = activeComparators[i]\n\n if (comparator.supports(context)) {\n return comparator.compare(context)\n }\n }\n\n return false\n}\n\nmodule.exports = equals\n\n/**\n * Called with the name and value of a property belonging to an object whose equality is being tested to determine\n * whether the property should be checked against that on the other object within the equality test.\n *\n * Keep in mind that including a property on one object but not on the other will almost certainly result in\n * inequality.\n *\n * @callback Nevis~EqualsFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and that is being checked against another\n * @return {boolean} true
if the equality of the property should be tested against that on the other\n * object; otherwise false
.\n */\n\n/**\n * The options to be used to test equality.\n *\n * @typedef {Object} Nevis~EqualsOptions\n * @property {Nevis~EqualsFilterPropertyCallback} [filterProperty] - A function to be called to filter properties based\n * on their name and value when testing equality of objects to determine whether they should be tested. This is not\n * called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreCase] - true
to ignore case when testing equality for strings; otherwise\n * false
.\n * @property {boolean} [ignoreEquals] - true
to ignore the \"equals\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when testing equality for\n * objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when testing equality for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticEquals = require('./')\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @constructor\n */\nfunction EqualsBuilder() {\n /**\n * The current equals for this {@link EqualsBuilder}.\n *\n * @private\n * @type {boolean}\n */\n this._equals = true\n}\n\n/**\n * Appends the specified value
and other
to this {@link EqualsBuilder}, testing equality for\n * them using the options
provided.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to check equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.append = function append(value, other, options) {\n if (this._equals) {\n this._equals = staticEquals(value, other, options)\n }\n\n return this\n}\n\n/**\n * Appends the result of testing equality for a super class to this {@link EqualsBuilder}.\n *\n * @param {boolean} superEquals - the result of testing equality for a super class\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.appendSuper = function appendSuper(superEquals) {\n if (this._equals) {\n this._equals = superEquals\n }\n\n return this\n}\n\n/**\n * Returns whether the values that have been appended to this {@link EqualsBuilder} are all equal.\n *\n * @return {boolean} true
if all appended values are equal; otherwise false
.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.build = function build() {\n return this._equals\n}\n\nmodule.exports = EqualsBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for generating a hash code for a specific {@link HashCodeContext}.\n *\n * Individual HashCodeGenerator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly generate a more suitable hash code. The\n * {@link HashCodeContext} should never be modified but can be copied via {@link HashCodeContext#copy}.\n *\n * Implementations must implement the {@link HashCodeGenerator#generate} and {@link HashCodeGenerator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction HashCodeGenerator() {}\nHashCodeGenerator.class_ = 'HashCodeGenerator'\nHashCodeGenerator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof HashCodeGenerator\n */\nHashCodeGenerator.extend = extend\n\n/**\n * Returns a hash code for the specified context
.\n *\n * This method is only called when {@link HashCodeGenerator#supports} indicates that this {@link HashCodeGenerator}\n * supports context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.generate = /* istanbul ignore next */ function generate(context) {}\n\n/**\n * Returns whether this {@link HashCodeGenerator} supports the specified context
.\n *\n * This method should only return true
when {@link HashCodeGenerator#generate} can generate a hash code for\n * context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} to be checked\n * @return {boolean} true
if this {@link HashCodeGenerator} can generate a hash code for\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = HashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the value for which a hash code is to be generated as well string representation and type of the value which\n * can be checked elsewhere for type-checking etc.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @param {Function} hashCode - a reference to {@link Nevis.hashCode} which can be called within a\n * {@link HashCodeGenerator}\n * @param {?Nevis~HashCodeOptions} options - the options to be used (may be null
)\n * @protected\n * @constructor\n */\nfunction HashCodeContext(value, hashCode, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.hashCode} which can be called within a {@link HashCodeGenerator}.\n *\n * @private\n * @type {Function}\n */\n this._hashCode = hashCode\n\n /**\n * The options to be used to generate the hash code for the value.\n *\n * @public\n * @type {Nevis~HashCodeOptions}\n */\n this.options = {\n allowCache: options.allowCache !== false,\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreHashCode: Boolean(options.ignoreHashCode),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The string representation of the value whose hash code is to be generated.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the value whose hash code is to be generated.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value whose hash code is to be generated.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link HashCodeContext} but for the specified value
instead.\n *\n * This method can be useful for when a {@link HashCodeGenerator} implementation wants to generate the hash code based\n * on a value derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @return {HashCodeContext} A copy of this {@link HashCodeContext} for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.copy = function copy(value) {\n return new HashCodeContext(value, this._hashCode, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.hashCode} from within a {@link HashCodeGenerator}.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @return {number} A hash code for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.hashCode = function hashCode(value) {\n return this._hashCode(value, this.options)\n}\n\nmodule.exports = HashCodeContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar generators = require('./generators')\nvar HashCodeContext = require('./context')\n\n/**\n * The list of active generators that will be checked for any that support the value before falling back to\n * {@link defaultGenerator}.\n *\n * @private\n * @type {HashCodeGenerator[]}\n */\nvar activeGenerators = [\n new generators.BooleanHashCodeGenerator(),\n new generators.StringHashCodeGenerator(),\n new generators.DateHashCodeGenerator(),\n new generators.ToStringHashCodeGenerator(),\n new generators.ArrayHashCodeGenerator()\n]\n\n/**\n * The default generator to be used when no others support the value.\n *\n * @private\n * @type {HashCodeGenerator}\n */\nvar defaultGenerator = new generators.ObjectHashCodeGenerator()\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n */\nfunction hashCode(value, options) {\n if (value == null) {\n return 0\n }\n\n var context = new HashCodeContext(value, hashCode, options)\n\n if (!context.options.ignoreHashCode && typeof value.hashCode === 'function') {\n return value.hashCode()\n }\n\n var generator\n var length = activeGenerators.length\n\n for (var i = 0; i < length; i++) {\n generator = activeGenerators[i]\n\n if (generator.supports(context)) {\n return generator.generate(context)\n }\n }\n\n return defaultGenerator.generate(context)\n}\n\n/**\n * Clears all previously generated hash codes that may been cached by any active {@link CachingHashCodeGenerator}\n * implementations.\n *\n * Such implementations only cache hash codes generated while the allowCache
option is enabled and it is\n * unlikely that an application would be required to call this method, however, it is here if needed and also for\n * testing purposes.\n *\n * @return {void}\n * @public\n * @static\n * @memberof hashCode\n */\nhashCode.clearCache = function clearCache() {\n activeGenerators.forEach(function(generator) {\n if (typeof generator.clearCache === 'function') {\n generator.clearCache()\n }\n })\n}\n\nmodule.exports = hashCode\n\n/**\n * Called with the name and value of a property belonging to an object for which a hash code is being generated to\n * determine whether the hash code for the property should be included in that generated for the object.\n *\n * @callback Nevis~HashCodeFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and whose hash code is being generated\n * @return {boolean} true
if the hash code for obj
should consist of that generated for the\n * given property; otherwise false
.\n */\n\n/**\n * The options to be used to generate the hash code.\n *\n * @typedef {Object} Nevis~HashCodeOptions\n * @property {boolean} [allowCache=true] - true
to allow generators to cache generated hash codes for\n * faster re-generation; otherwise false
. Only applies to implementations of\n * {@link CachingHashCodeGenerator}.\n * @property {Nevis~HashCodeFilterPropertyCallback} [filterProperty] - A function to be called to filter properties\n * based on their name and value when generating hash codes for objects to determine whether they should be included.\n * This is not called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreHashCode] - true
to ignore the \"hashCode\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when generating hash codes\n * for objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when generating hash codes for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticHashCode = require('./')\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @constructor\n */\nfunction HashCodeBuilder(initial, multiplier) {\n if (initial == null) {\n initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE\n } else if (initial % 2 === 0) {\n throw new Error('initial must be an odd number')\n }\n\n if (multiplier == null) {\n multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE\n } else if (multiplier % 2 === 0) {\n throw new Error('multiplier must be an odd number')\n }\n\n /**\n * The current hash code for this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._hash = initial\n\n /**\n * The multiplier to be used by this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._multiplier = multiplier\n}\n\n/**\n * The default initial value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_INITIAL_VALUE = 17\n\n/**\n * The default multiplier value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_MULTIPLIER_VALUE = 37\n\n/**\n * Appends the specified value
to this {@link HashCodeBuilder}, generating the hash code for it using the\n * options
provided.\n *\n * @param {*} value - the value whose hash code is to be appended (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.append = function append(value, options) {\n this._hash = (this._hash * this._multiplier) + staticHashCode(value, options)\n\n return this\n}\n\n/**\n * Appends the result of computing the hash code for a super class to this {@link HashCodeBuilder}.\n *\n * @param {number} superHashCode - the result of computing the hash code for a super class\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.appendSuper = function appendSuper(superHashCode) {\n this._hash = (this._hash * this._multiplier) + superHashCode\n\n return this\n}\n\n/**\n * Returns the computed hash code.\n *\n * @return {number} The hash code based on the appended values.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.build = function build() {\n return this._hash\n}\n\n/**\n * Returns the hash code for this {@link HashCodeBuilder}.\n *\n * This method will return the computed hash code based on the appended values.\n *\n * @return {number} The hash code.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.hashCode = function hashCode() {\n return this._hash\n}\n\nmodule.exports = HashCodeBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n */\nfunction toString(value) {\n if (typeof value === 'undefined') {\n return 'undefined'\n }\n if (value == null) {\n return 'null'\n }\n\n return value.toString()\n}\n\nmodule.exports = toString\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * values types that contain a collection of other values. This is achieved by requesting the elements contained within\n * e value as an array from the implementation and then compares each element to determine whether the values are equal.\n *\n * Implementations must implement the {@link CollectionEqualsComparator#getElements} and\n * {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar CollectionEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionEqualsComparator#\n */\n compare: function compare(context) {\n var elements = this.getElements(context.value, context)\n var otherElements = this.getElements(context.other, context)\n var length = elements.length\n\n if (length !== otherElements.length) {\n return false\n }\n\n while (length--) {\n if (!context.equals(elements[length], otherElements[length])) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the elements contained within the specified collection
.\n *\n * @param {*} collection - the collection whose elements are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The elements contained within collection
.\n * @protected\n * @abstract\n * @memberof CollectionEqualsComparator#\n */\n getElements: /* istanbul ignore next */ function getElements(collection, context) {}\n\n})\n\nmodule.exports = CollectionEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar ArrayEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n getElements: function getElements(collection) {\n return collection\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Array]'\n }\n\n})\n\nmodule.exports = ArrayEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar DateEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.getTime() === context.other.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the keys contained within each\n * value as an array from the implementation and then compares each key/value pair to determine whether the values are\n * equal.\n *\n * Implementations must implement the {@link HashEqualsComparator#getKeys}, {@link HashEqualsComparator#getValue}\n * and {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar HashEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashEqualsComparator#\n */\n compare: function compare(context) {\n var value = context.value\n var other = context.other\n var keys = this.getKeys(value, context)\n var length = keys.length\n\n if (length !== this.getKeys(other, context).length) {\n return false\n }\n\n var key\n\n while (length--) {\n key = keys[length]\n\n if (!context.equals(this.getValue(value, key, context), this.getValue(other, key, context))) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the keys contained within the value of the specified hash
.\n *\n * @param {*} hash - the hash whose keys are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The keys contained within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getKeys: /* istanbul ignore next */ function getKeys(hash, context) {},\n\n /**\n * Returns the value associated with the specified key
in the hash
provided.\n *\n * @param {*} hash - the hash from which the value is to be returned\n * @param {*} key - the key for which the associated value is to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {*} The value for key
within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getValue: /* istanbul ignore next */ function getValue(hash, key, context) {}\n\n})\n\nmodule.exports = HashEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports number values (including NaN
).\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar NumberEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n compare: function compare(context) {\n return context.value !== context.value ? context.other !== context.other : context.value === context.other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'number'\n }\n\n})\n\nmodule.exports = NumberEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar ObjectEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getKeys: function getKeys(hash, context) {\n var keys = []\n var options = context.options\n var value\n\n for (var key in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, key)) {\n value = this.getValue(hash, key, context)\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(key, value, hash)) {\n keys.push(key)\n }\n }\n }\n\n return keys\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash[key]\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar StringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n compare: function compare(context) {\n var other = context.other\n var value = context.value\n\n if (context.options.ignoreCase) {\n other = other.toLocaleUpperCase()\n value = value.toLocaleUpperCase()\n }\n\n return value === other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports miscellaneous values by comparing their string\n * representations (generated by calling toString
on each value).\n *\n * This {@link EqualsComparator} currently only supports functions and regular expressions.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar ToStringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.toString() === context.other.toString()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayEqualsComparator = require('./array-comparator')\nvar CollectionEqualsComparator = require('./collection-comparator')\nvar DateEqualsComparator = require('./date-comparator')\nvar EqualsComparator = require('./comparator')\nvar HashEqualsComparator = require('./hash-comparator')\nvar NumberEqualsComparator = require('./number-comparator')\nvar ObjectEqualsComparator = require('./object-comparator')\nvar StringEqualsComparator = require('./string-comparator')\nvar ToStringEqualsComparator = require('./to-string-comparator')\n\n/**\n * A hash containing constructors for all equals comparators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayEqualsComparator: ArrayEqualsComparator,\n CollectionEqualsComparator: CollectionEqualsComparator,\n DateEqualsComparator: DateEqualsComparator,\n EqualsComparator: EqualsComparator,\n HashEqualsComparator: HashEqualsComparator,\n NumberEqualsComparator: NumberEqualsComparator,\n ObjectEqualsComparator: ObjectEqualsComparator,\n StringEqualsComparator: StringEqualsComparator,\n ToStringEqualsComparator: ToStringEqualsComparator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that contain a collection of other values. This is achieved by requesting the elements contained within\n * the value as an array from the implementation and then generates hash codes for each element to compute the hash code\n * for the value.\n *\n * Implementations must implement the {@link CollectionHashCodeGenerator#getElements} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CollectionHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionHashCodeGenerator#\n */\n generate: function generate(context) {\n var elements = this.getElements(context)\n\n return elements.reduce(function(hash, element) {\n return ((31 * hash) + context.hashCode(element)) | 0\n }, 1)\n },\n\n /**\n * Returns the elements contained within the value of the specified context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose children elements are to\n * be returned\n * @return {Array} The elements contained within the value of context
.\n * @protected\n * @abstract\n * @memberof CollectionHashCodeGenerator#\n */\n getElements: /* istanbul ignore next */ function getElements(context) {}\n\n})\n\nmodule.exports = CollectionHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar ArrayHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return context.value\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n supports: function support(context) {\n return context.string === '[object Array]'\n }\n\n})\n\nmodule.exports = ArrayHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports boolean values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar BooleanHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value ? 1231 : 1237\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'boolean'\n }\n\n})\n\nmodule.exports = BooleanHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to cache\n * generated hash codes to avoid re-generating them for the same values. Obviously, this should only ever be done for\n * immutable values.\n *\n * Generated hash codes should only ever be cached when the allowCache
option is enabled, however, the\n * cache will always be checked before attempting to generate a hash code for a value.\n *\n * Implementations must implement the {@link CachingHashCodeGenerator#generateInternal} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CachingHashCodeGenerator = HashCodeGenerator.extend(function() {\n /**\n * A cache of values mapped to their previously generated hash codes.\n *\n * @private\n * @type {Object.<*, number>}\n * @memberof CachingHashCodeGenerator#\n */\n this._cache = {}\n}, {\n\n /**\n * Clears the cache of hash codes that have been previously generated by this {@link CachingHashCodeGenerator} while\n * the allowCache
option has been enabled.\n *\n * @return {void}\n * @public\n * @memberof CachingHashCodeGenerator#\n */\n clearCache: function clearCache() {\n this._cache = {}\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof CachingHashCodeGenerator#\n */\n generate: function generate(context) {\n var hash = this._cache[context.value]\n\n if (hash == null) {\n hash = this.generateInternal(context)\n\n if (context.options.allowCache) {\n this._cache[context.value] = hash\n }\n }\n\n return hash\n },\n\n /**\n * Returns a hash code for the specified context
.\n *\n * This method is called internally by {@link CachingHashCodeGenerator#generate} only when a hash code needs to be\n * generated (i.e. the cache doesn't contain a previously generated hash code for the value of context
).\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @protected\n * @abstract\n * @memberof CachingHashCodeGenerator#\n */\n generateInternal: /* istanbul ignore next */ function generateInternal(context) {}\n\n})\n\nmodule.exports = CachingHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar DateHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the entries of key/value pairs\n * contained within the value as an multi-dimensional array from the implementation and then generates hash codes for\n * each entry to compute the hash code for the value.\n *\n * Implementations must implement the {@link HashHashCodeGenerator#getEntries} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar HashHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashHashCodeGenerator#\n */\n generate: function generate(context) {\n var entries = this.getEntries(context)\n\n return entries.reduce(function(hash, entry) {\n return hash + (context.hashCode(entry[0]) ^ context.hashCode(entry[1]))\n }, 0)\n },\n\n /**\n * Returns the entries contained within the value of the specified context
.\n *\n * This method returns a multi-dimensional array where each entry is an array consisting of the key and value, in that\n * order.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose entries are to be\n * returned\n * @return {Array.} The entries contained within the value of context
.\n * @protected\n * @abstract\n * @memberof HashHashCodeGenerator#\n */\n getEntries: /* istanbul ignore next */ function getEntries(context) {}\n\n})\n\nmodule.exports = HashHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar ObjectHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n var entries = []\n var hash = context.value\n var options = context.options\n var value\n\n for (var name in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, name)) {\n value = hash[name]\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(name, value, hash)) {\n entries.push([ name, value ])\n }\n }\n }\n\n return entries\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CachingHashCodeGenerator = require('./caching-generator')\n\n/**\n * An implementation of {@link CachingHashCodeGenerator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends CachingHashCodeGenerator\n */\nvar StringHashCodeGenerator = CachingHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n generateInternal: function generateInternal(context) {\n var hash = 0\n var length = context.value.length\n\n for (var i = 0; i < length; i++) {\n hash = ((31 * hash) + context.value.charCodeAt(i)) | 0\n }\n\n return hash\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar StringHashCodeGenerator = require('./string-generator')\n\n/**\n * An extension of {@link StringHashCodeGenerator} that supports miscellaneous values by generating hash codes for their\n * string representations (generated by calling toString
on the value).\n *\n * This {@link HashCodeGenerator} currently only supports functions, numbers and regular expressions.\n *\n * @protected\n * @constructor\n * @extends StringHashCodeGenerator\n */\nvar ToStringHashCodeGenerator = StringHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n generate: function generate(context) {\n return ToStringHashCodeGenerator.super_.prototype.generate.call(this, context.copy(context.value.toString()))\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.type === 'number' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayHashCodeGenerator = require('./array-generator')\nvar BooleanHashCodeGenerator = require('./boolean-generator')\nvar CachingHashCodeGenerator = require('./caching-generator')\nvar CollectionHashCodeGenerator = require('./collection-generator')\nvar DateHashCodeGenerator = require('./date-generator')\nvar HashCodeGenerator = require('./generator')\nvar HashHashCodeGenerator = require('./hash-generator')\nvar ObjectHashCodeGenerator = require('./object-generator')\nvar StringHashCodeGenerator = require('./string-generator')\nvar ToStringHashCodeGenerator = require('./to-string-generator')\n\n/**\n * A hash containing constructors for all hash code generators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayHashCodeGenerator: ArrayHashCodeGenerator,\n BooleanHashCodeGenerator: BooleanHashCodeGenerator,\n CachingHashCodeGenerator: CachingHashCodeGenerator,\n CollectionHashCodeGenerator: CollectionHashCodeGenerator,\n DateHashCodeGenerator: DateHashCodeGenerator,\n HashCodeGenerator: HashCodeGenerator,\n HashHashCodeGenerator: HashHashCodeGenerator,\n ObjectHashCodeGenerator: ObjectHashCodeGenerator,\n StringHashCodeGenerator: StringHashCodeGenerator,\n ToStringHashCodeGenerator: ToStringHashCodeGenerator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsBuilder = require('./equals/builder')\nvar HashCodeBuilder = require('./hash-code/builder')\nvar Nevis = require('./nevis')\nvar staticEquals = require('./equals')\nvar staticHashCode = require('./hash-code')\nvar staticToString = require('./to-string')\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.equals = staticEquals\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.EqualsBuilder = EqualsBuilder\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.hashCode = staticHashCode\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.HashCodeBuilder = HashCodeBuilder\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.toString = staticToString\n\n/**\n * Returns whether this instance is \"equal to\" the specified obj
.\n *\n * This method implements an equivalence relation on non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, x.equals(x)
should return\n * true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * x.equals(y)
should return true
if and only if y.equals(x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if x.equals(y)
returns true
and y.equals(z)
returns true
, then\n * x.equals(z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of x.equals(y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, x.equals(null)
should return\n * false
. \n *
\n *\n * The default implementation of this method is the most discriminating possible equivalence relation on objects; that\n * is, for any non-null reference values x
and y
, this method returns true
if,\n * and only if, x
and y
are exactly equal (x === y
has the value\n * true
).\n *\n * Please note that it is generally necessary to override the {@link Nevis#hashCode} method whenever this method is\n * overridden, so as to maintain the general contract for the {@link Nevis#hashCode} method, which states that equal\n * objects must have equal hash codes.\n *\n * @param {*} obj - the reference to which this instance is to be compared (may be null
)\n * @return {boolean} true
if this instance is equal to obj
; otherwise false
.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.equals = function equals(obj) {\n return this === obj\n}\n\n/**\n * Returns the hash code for this instance. This method is supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same instance more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the instance is modified. This number need not remain consistent from one execution of an application\n * to another execution of the same application. \n * - If two instances are equal, that calling the
hashCode
method on each of the two instances must\n * produce the same number result. \n * - It is not required that if two instances are unequal, that calling the
hashCode
method on\n * each of the two instances must produce distinct number results. However, the programmer should be aware that\n * producing distinct number results for unequal instances may improve the performance of hash tables. \n *
\n *\n * The default implementation of this method will attempt to generate the hash code based on all of the fields on this\n * instance.\n *\n * Please note that it is generally necessary to override the {@link Nevis#equals} method whenever this method is\n * overridden, so as to maintain the above contract where equal objects must have equal hash codes.\n *\n * @return {number} The hash code.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.hashCode = function hashCode() {\n return staticHashCode(this, { ignoreHashCode: true })\n}\n\n/**\n * Returns a string representation of this instance.\n *\n * In general, the {@code Nevis#toString} method returns a string that \"textually represents\" this instance. The result\n * should be a concise but informative representation that is easy for a person to read.\n *\n * The default implementation of this method will return a string consisting of this instance's class name, the at-sign\n * character (@
), and the hexadecimal representation of the hash code of this instance.\n *\n * @return {string} A string representation of this instance.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.toString = function toString() {\n return this.constructor.class_ + '@' + this.hashCode().toString(16)\n}\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src')\n"],"names":["createObject","prototype","properties","result","Object","create","Constructor","extendObject","extend","name","constructor","statics","superConstructor","this","apply","arguments","class_","super_","own","target","sources","slice","call","property","source","i","length","hasOwnProperty","EqualsComparator","EqualsContext","value","other","equals","options","_equals","filterProperty","ignoreCase","Boolean","ignoreEquals","ignoreInherited","ignoreMethods","string","toString","type","context","validate","comparator","activeComparators","supports","compare","EqualsBuilder","HashCodeGenerator","HashCodeContext","hashCode","_hashCode","allowCache","ignoreHashCode","generator","activeGenerators","generate","defaultGenerator","HashCodeBuilder","initial","multiplier","DEFAULT_INITIAL_VALUE","Error","DEFAULT_MULTIPLIER_VALUE","_hash","_multiplier","Nevis","Array","CollectionEqualsComparator","elements","getElements","otherElements","collection","ArrayEqualsComparator","DateEqualsComparator","getTime","HashEqualsComparator","keys","getKeys","key","getValue","hash","NumberEqualsComparator","ObjectEqualsComparator","push","StringEqualsComparator","toLocaleUpperCase","ToStringEqualsComparator","copy","comparators","append","staticEquals","appendSuper","superEquals","build","CollectionHashCodeGenerator","reduce","element","ArrayHashCodeGenerator","BooleanHashCodeGenerator","CachingHashCodeGenerator","_cache","clearCache","generateInternal","DateHashCodeGenerator","HashHashCodeGenerator","entries","getEntries","entry","ObjectHashCodeGenerator","StringHashCodeGenerator","charCodeAt","ToStringHashCodeGenerator","generators","forEach","staticHashCode","superHashCode","staticToString","obj","require$$0"],"mappings":";wLAwDA,SAASA,GAAaC,EAAWC,GAC/B,GAAIC,EAcJ,OAZ6B,kBAAlBC,QAAOC,OAChBF,EAASC,OAAOC,OAAOJ,IAEvBK,EAAYL,UAAYA,EACxBE,EAAS,GAAIG,GACbA,EAAYL,UAAY,MAGtBC,GACFK,GAAa,EAAMJ,EAAQD,GAGtBC,EAwBT,QAASK,GAAOC,EAAMC,EAAaT,EAAWU,GAC5C,GAAIC,GAAmBC,IAyBvB,OAvBoB,gBAATJ,KACTE,EAAUV,EACVA,EAAYS,EACZA,EAAcD,EACdA,EAAO,MAGkB,kBAAhBC,KACTC,EAAUV,EACVA,EAAYS,EACZA,EAAc,WACZ,MAAOE,GAAiBE,MAAMD,KAAME,aAIxCR,GAAa,EAAOG,EAAaE,EAAkBD,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sources":["../src/extend.js","../src/equals/comparators/comparator.js","../src/equals/context.js","../src/equals/index.js","../src/equals/builder.js","../src/hash-code/generators/generator.js","../src/hash-code/context.js","../src/hash-code/index.js","../src/hash-code/builder.js","../src/nevis.js","../src/to-string/index.js","../src/util/arrays.js","../src/equals/comparators/collection-comparator.js","../src/equals/comparators/array-comparator.js","../src/equals/comparators/date-comparator.js","../src/equals/comparators/hash-comparator.js","../src/equals/comparators/map-comparator.js","../src/equals/comparators/number-comparator.js","../src/equals/comparators/object-comparator.js","../src/equals/comparators/set-comparator.js","../src/equals/comparators/string-comparator.js","../src/equals/comparators/to-string-comparator.js","../src/equals/comparators/index.js","../src/hash-code/generators/collection-generator.js","../src/hash-code/generators/array-generator.js","../src/hash-code/generators/boolean-generator.js","../src/hash-code/generators/caching-generator.js","../src/hash-code/generators/date-generator.js","../src/hash-code/generators/hash-generator.js","../src/hash-code/generators/map-generator.js","../src/hash-code/generators/object-generator.js","../src/hash-code/generators/set-generator.js","../src/hash-code/generators/string-generator.js","../src/hash-code/generators/to-string-generator.js","../src/hash-code/generators/index.js","../src/index.js","../index.js"],"sourcesContent":["/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * A bare-bones constructor for surrogate prototype swapping.\n *\n * @private\n * @constructor\n */\nvar Constructor = /* istanbul ignore next */ function() {}\n/**\n * A reference to Object.prototype.hasOwnProperty
.\n *\n * @private\n * @type {Function}\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n/**\n * A reference to Array.prototype.slice
.\n *\n * @private\n * @type {Function}\n */\nvar slice = Array.prototype.slice\n\n/**\n * Creates an object which inherits the given prototype
.\n *\n * Optionally, the created object can be extended further with the specified properties
.\n *\n * @param {Object} prototype - the prototype to be inherited by the created object\n * @param {Object} [properties] - the optional properties to be extended by the created object\n * @return {Object} The newly created object.\n * @private\n */\nfunction createObject(prototype, properties) {\n var result\n /* istanbul ignore next */\n if (typeof Object.create === 'function') {\n result = Object.create(prototype)\n } else {\n Constructor.prototype = prototype\n result = new Constructor()\n Constructor.prototype = null\n }\n\n if (properties) {\n extendObject(true, result, properties)\n }\n\n return result\n}\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n */\nfunction extend(name, constructor, prototype, statics) {\n var superConstructor = this\n\n if (typeof name !== 'string') {\n statics = prototype\n prototype = constructor\n constructor = name\n name = null\n }\n\n if (typeof constructor !== 'function') {\n statics = prototype\n prototype = constructor\n constructor = function() {\n return superConstructor.apply(this, arguments)\n }\n }\n\n extendObject(false, constructor, superConstructor, statics)\n\n constructor.prototype = createObject(superConstructor.prototype, prototype)\n constructor.prototype.constructor = constructor\n\n constructor.class_ = name || superConstructor.class_\n constructor.super_ = superConstructor\n\n return constructor\n}\n\n/**\n * Extends the specified target
object with the properties in each of the sources
provided.\n *\n * if any source is null
it will be ignored.\n *\n * @param {boolean} own - true
to only copy own properties from sources
onto\n * target
; otherwise false
\n * @param {Object} target - the target object which should be extended\n * @param {...Object} [sources] - the source objects whose properties are to be copied onto target
\n * @return {void}\n * @private\n */\nfunction extendObject(own, target, sources) {\n sources = slice.call(arguments, 2)\n\n var property\n var source\n\n for (var i = 0, length = sources.length; i < length; i++) {\n source = sources[i]\n\n for (property in source) {\n if (!own || hasOwnProperty.call(source, property)) {\n target[property] = source[property]\n }\n }\n }\n}\n\nmodule.exports = extend\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for comparing the values within a specific {@link EqualsContext} to check whether they are equal.\n *\n * Individual EqualsComparator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly provide a more suitable comparison. The\n * {@link EqualsContext} should never be modified but can be copied via {@link EqualsContext#copy}.\n *\n * A EqualsComparator
is only called once it has been determined that the values within the\n * {@link EqualsContext} are not exactly equal, neither are null
, and both share the same type.\n *\n * Implementations must implement the {@link EqualsComparator#compare} and {@link EqualsComparator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction EqualsComparator() {}\nEqualsComparator.class_ = 'EqualsComparator'\nEqualsComparator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof EqualsComparator\n */\nEqualsComparator.extend = extend\n\n/**\n * Compares the values within the specified context
.\n *\n * This method is only called when {@link EqualsComparator#supports} indicates that this {@link EqualsComparator}\n * supports context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} whose values are to be compared\n * @return {boolean} true
if the values within context
are equal; otherwise\n * false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.compare = /* istanbul ignore next */ function compare(context) {}\n\n/**\n * Returns whether this {@link EqualsComparator} supports the specified context
.\n *\n * This method should only return true
when {@link EqualsComparator#compare} can compare the values within\n * context
.\n *\n * @param {EqualsContext} context - the {@link EqualsContext} to be checked\n * @return {boolean} true
if this {@link EqualsComparator} can compare the values within\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof EqualsComparator#\n */\nEqualsComparator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = EqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the values whose equality is to be tested as well as the string representation and type for the value which\n * can be checked elsewhere for type-checking etc.\n *\n * A EqualsContext
is only created once it has been determined that both values not exactly equal\n * and neither are null
. Once instantiated, {@link EqualsContext#validate} should be called to ensure that\n * both values share the same type.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @param {Function} equals - a reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}\n * @param {?Nevis~EqualsOptions} options - the options to be used (may be null
)\n * @public\n * @constructor\n */\nfunction EqualsContext(value, other, equals, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.equals} which can be called within an {@link EqualsComparator}.\n *\n * @private\n * @type {Function}\n */\n this._equals = equals\n\n /**\n * The options to be used to test equality for both of the values.\n *\n * @public\n * @type {Nevis~EqualsOptions}\n */\n this.options = {\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreCase: Boolean(options.ignoreCase),\n ignoreEquals: Boolean(options.ignoreEquals),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The other value to be checked against the value
.\n *\n * @public\n * @type {*}\n */\n this.other = other\n\n /**\n * The string representation of the values to be tested for equality.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the values to be tested for equality.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value to be checked against the other
.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link EqualsContext} but for the specified value
and other
value\n * instead.\n *\n * This method can be useful for when an {@link EqualsComparator} implementation wants to test equality based on a value\n * derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value to be checked against other
\n * @param {*} other - the other value to be checked against value
\n * @return {EqualsContext} A copy of this {@link EqualsContext} for value
and other
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.copy = function copy(value, other) {\n return new EqualsContext(value, other, this._equals, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.equals} from within an {@link EqualsComparator}.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.equals = function equals(value, other) {\n return this._equals(value, other, this.options)\n}\n\n/**\n * Validates this {@link EqualsContext} by checking whether its values share the same type.\n *\n * This method must be called before attempting to call any {@link EqualsComparator} as they are meant to be able\n * to assume that both values share the same type.\n *\n * @return {boolean} true
if both values share the same type; otherwise false
.\n * @public\n * @memberof EqualsContext#\n */\nEqualsContext.prototype.validate = function validate() {\n return this.string === Object.prototype.toString.call(this.other) && this.type === typeof this.other\n}\n\nmodule.exports = EqualsContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar comparators = require('./comparators')\nvar EqualsContext = require('./context')\n\n/**\n * The list of active equals comparators that will be checked for any that support the values.\n *\n * @private\n * @type {EqualsComparator[]}\n */\nvar activeComparators = [\n new comparators.NumberEqualsComparator(),\n new comparators.StringEqualsComparator(),\n new comparators.DateEqualsComparator(),\n new comparators.ToStringEqualsComparator(),\n new comparators.ArrayEqualsComparator(),\n new comparators.SetEqualsComparator(),\n new comparators.MapEqualsComparator(),\n new comparators.ObjectEqualsComparator()\n]\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n */\nfunction equals(value, other, options) {\n if (value === other) {\n return true\n }\n if (value == null || other == null) {\n return value === other\n }\n\n var context = new EqualsContext(value, other, equals, options)\n\n if (!context.options.ignoreEquals && typeof value.equals === 'function') {\n return value.equals(other)\n }\n\n if (!context.validate()) {\n return false\n }\n\n var comparator\n var length = activeComparators.length\n\n for (var i = 0; i < length; i++) {\n comparator = activeComparators[i]\n\n if (comparator.supports(context)) {\n return comparator.compare(context)\n }\n }\n\n return false\n}\n\nmodule.exports = equals\n\n/**\n * Called with the name and value of a property belonging to an object whose equality is being tested to determine\n * whether the property should be checked against that on the other object within the equality test.\n *\n * Keep in mind that including a property on one object but not on the other will almost certainly result in\n * inequality.\n *\n * @callback Nevis~EqualsFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and that is being checked against another\n * @return {boolean} true
if the equality of the property should be tested against that on the other\n * object; otherwise false
.\n */\n\n/**\n * The options to be used to test equality.\n *\n * @typedef {Object} Nevis~EqualsOptions\n * @property {Nevis~EqualsFilterPropertyCallback} [filterProperty] - A function to be called to filter properties based\n * on their name and value when testing equality of objects to determine whether they should be tested. This is not\n * called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreCase] - true
to ignore case when testing equality for strings; otherwise\n * false
.\n * @property {boolean} [ignoreEquals] - true
to ignore the \"equals\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when testing equality for\n * objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when testing equality for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticEquals = require('./')\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @constructor\n */\nfunction EqualsBuilder() {\n /**\n * The current equals for this {@link EqualsBuilder}.\n *\n * @private\n * @type {boolean}\n */\n this._equals = true\n}\n\n/**\n * Appends the specified value
and other
to this {@link EqualsBuilder}, testing equality for\n * them using the options
provided.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to check equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.append = function append(value, other, options) {\n if (this._equals) {\n this._equals = staticEquals(value, other, options)\n }\n\n return this\n}\n\n/**\n * Appends the result of testing equality for a super class to this {@link EqualsBuilder}.\n *\n * @param {boolean} superEquals - the result of testing equality for a super class\n * @return {EqualsBuilder} A reference to this {@link EqualsBuilder} for chaining purposes.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.appendSuper = function appendSuper(superEquals) {\n if (this._equals) {\n this._equals = superEquals\n }\n\n return this\n}\n\n/**\n * Returns whether the values that have been appended to this {@link EqualsBuilder} are all equal.\n *\n * @return {boolean} true
if all appended values are equal; otherwise false
.\n * @public\n * @memberof EqualsBuilder#\n */\nEqualsBuilder.prototype.build = function build() {\n return this._equals\n}\n\nmodule.exports = EqualsBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('../../extend')\n\n/**\n * Responsible for generating a hash code for a specific {@link HashCodeContext}.\n *\n * Individual HashCodeGenerator
implementations should attempt to concentrate on specific value types to\n * keep them small and targeted, allowing other implementations to possibly generate a more suitable hash code. The\n * {@link HashCodeContext} should never be modified but can be copied via {@link HashCodeContext#copy}.\n *\n * Implementations must implement the {@link HashCodeGenerator#generate} and {@link HashCodeGenerator#supports}\n * methods.\n *\n * @protected\n * @constructor\n */\nfunction HashCodeGenerator() {}\nHashCodeGenerator.class_ = 'HashCodeGenerator'\nHashCodeGenerator.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof HashCodeGenerator\n */\nHashCodeGenerator.extend = extend\n\n/**\n * Returns a hash code for the specified context
.\n *\n * This method is only called when {@link HashCodeGenerator#supports} indicates that this {@link HashCodeGenerator}\n * supports context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.generate = /* istanbul ignore next */ function generate(context) {}\n\n/**\n * Returns whether this {@link HashCodeGenerator} supports the specified context
.\n *\n * This method should only return true
when {@link HashCodeGenerator#generate} can generate a hash code for\n * context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} to be checked\n * @return {boolean} true
if this {@link HashCodeGenerator} can generate a hash code for\n * context
; otherwise false
.\n * @public\n * @abstract\n * @memberof HashCodeGenerator#\n */\nHashCodeGenerator.prototype.supports = /* istanbul ignore next */ function supports(context) {}\n\nmodule.exports = HashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Contains the value for which a hash code is to be generated as well string representation and type of the value which\n * can be checked elsewhere for type-checking etc.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @param {Function} hashCode - a reference to {@link Nevis.hashCode} which can be called within a\n * {@link HashCodeGenerator}\n * @param {?Nevis~HashCodeOptions} options - the options to be used (may be null
)\n * @protected\n * @constructor\n */\nfunction HashCodeContext(value, hashCode, options) {\n if (options == null) {\n options = {}\n }\n\n /**\n * A reference to {@link Nevis.hashCode} which can be called within a {@link HashCodeGenerator}.\n *\n * @private\n * @type {Function}\n */\n this._hashCode = hashCode\n\n /**\n * The options to be used to generate the hash code for the value.\n *\n * @public\n * @type {Nevis~HashCodeOptions}\n */\n this.options = {\n allowCache: options.allowCache !== false,\n filterProperty: options.filterProperty != null ? options.filterProperty : function() {\n return true\n },\n ignoreHashCode: Boolean(options.ignoreHashCode),\n ignoreInherited: Boolean(options.ignoreInherited),\n ignoreMethods: Boolean(options.ignoreMethods)\n }\n\n /**\n * The string representation of the value whose hash code is to be generated.\n *\n * This is generated using Object.prototype.toString
and is intended to be primarily used for more\n * specific type-checking.\n *\n * @public\n * @type {string}\n */\n this.string = Object.prototype.toString.call(value)\n\n /**\n * The type of the value whose hash code is to be generated.\n *\n * This is generated using typeof
and is intended to be primarily used for simple type-checking.\n *\n * @public\n * @type {string}\n */\n this.type = typeof value\n\n /**\n * The value whose hash code is to be generated.\n *\n * @public\n * @type {*}\n */\n this.value = value\n}\n\n/**\n * Creates a copy of this {@link HashCodeContext} but for the specified value
instead.\n *\n * This method can be useful for when a {@link HashCodeGenerator} implementation wants to generate the hash code based\n * on a value derived from the original value (e.g. a string representation) and then passing it to a super class.\n *\n * @param {*} value - the value whose hash code is to be generated\n * @return {HashCodeContext} A copy of this {@link HashCodeContext} for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.copy = function copy(value) {\n return new HashCodeContext(value, this._hashCode, this.options)\n}\n\n/**\n * A convenient shorthand for calling {@link Nevis.hashCode} from within a {@link HashCodeGenerator}.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @return {number} A hash code for value
.\n * @public\n * @memberof HashCodeContext#\n */\nHashCodeContext.prototype.hashCode = function hashCode(value) {\n return this._hashCode(value, this.options)\n}\n\nmodule.exports = HashCodeContext\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar generators = require('./generators')\nvar HashCodeContext = require('./context')\n\n/**\n * The list of active generators that will be checked for any that support the value before falling back to\n * {@link defaultGenerator}.\n *\n * @private\n * @type {HashCodeGenerator[]}\n */\nvar activeGenerators = [\n new generators.BooleanHashCodeGenerator(),\n new generators.StringHashCodeGenerator(),\n new generators.DateHashCodeGenerator(),\n new generators.ToStringHashCodeGenerator(),\n new generators.ArrayHashCodeGenerator(),\n new generators.SetHashCodeGenerator(),\n new generators.MapHashCodeGenerator()\n]\n\n/**\n * The default generator to be used when no others support the value.\n *\n * @private\n * @type {HashCodeGenerator}\n */\nvar defaultGenerator = new generators.ObjectHashCodeGenerator()\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n */\nfunction hashCode(value, options) {\n if (value == null) {\n return 0\n }\n\n var context = new HashCodeContext(value, hashCode, options)\n\n if (!context.options.ignoreHashCode && typeof value.hashCode === 'function') {\n return value.hashCode()\n }\n\n var generator\n var length = activeGenerators.length\n\n for (var i = 0; i < length; i++) {\n generator = activeGenerators[i]\n\n if (generator.supports(context)) {\n return generator.generate(context)\n }\n }\n\n return defaultGenerator.generate(context)\n}\n\n/**\n * Clears all previously generated hash codes that may been cached by any active {@link CachingHashCodeGenerator}\n * implementations.\n *\n * Such implementations only cache hash codes generated while the allowCache
option is enabled and it is\n * unlikely that an application would be required to call this method, however, it is here if needed and also for\n * testing purposes.\n *\n * @return {void}\n * @public\n * @static\n * @memberof hashCode\n */\nhashCode.clearCache = function clearCache() {\n activeGenerators.forEach(function(generator) {\n if (typeof generator.clearCache === 'function') {\n generator.clearCache()\n }\n })\n}\n\nmodule.exports = hashCode\n\n/**\n * Called with the name and value of a property belonging to an object for which a hash code is being generated to\n * determine whether the hash code for the property should be included in that generated for the object.\n *\n * @callback Nevis~HashCodeFilterPropertyCallback\n * @param {string} name - the name of the property being checked\n * @param {*} value - the value of the property being checked\n * @param {Object} obj - the object to which the property belongs and whose hash code is being generated\n * @return {boolean} true
if the hash code for obj
should consist of that generated for the\n * given property; otherwise false
.\n */\n\n/**\n * The options to be used to generate the hash code.\n *\n * @typedef {Object} Nevis~HashCodeOptions\n * @property {boolean} [allowCache=true] - true
to allow generators to cache generated hash codes for\n * faster re-generation; otherwise false
. Only applies to implementations of\n * {@link CachingHashCodeGenerator}.\n * @property {Nevis~HashCodeFilterPropertyCallback} [filterProperty] - A function to be called to filter properties\n * based on their name and value when generating hash codes for objects to determine whether they should be included.\n * This is not called for method properties when ignoreMethods
is enabled.\n * @property {boolean} [ignoreHashCode] - true
to ignore the \"hashCode\" method on value, when present;\n * otherwise false
.\n * @property {boolean} [ignoreInherited] - true
to ignore inherited properties when generating hash codes\n * for objects; otherwise false
.\n * @property {boolean} [ignoreMethods] - true
to ignore method properties when generating hash codes for\n * objects; otherwise false
.\n */\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar staticHashCode = require('./')\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @constructor\n */\nfunction HashCodeBuilder(initial, multiplier) {\n if (initial == null) {\n initial = HashCodeBuilder.DEFAULT_INITIAL_VALUE\n } else if (initial % 2 === 0) {\n throw new Error('initial must be an odd number')\n }\n\n if (multiplier == null) {\n multiplier = HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE\n } else if (multiplier % 2 === 0) {\n throw new Error('multiplier must be an odd number')\n }\n\n /**\n * The current hash code for this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._hash = initial\n\n /**\n * The multiplier to be used by this {@link HashCodeBuilder}.\n *\n * @private\n * @type {number}\n */\n this._multiplier = multiplier\n}\n\n/**\n * The default initial value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_INITIAL_VALUE = 17\n\n/**\n * The default multiplier value to use in hash code building.\n *\n * @public\n * @static\n * @type {number}\n * @memberof HashCodeBuilder\n */\nHashCodeBuilder.DEFAULT_MULTIPLIER_VALUE = 37\n\n/**\n * Appends the specified value
to this {@link HashCodeBuilder}, generating the hash code for it using the\n * options
provided.\n *\n * @param {*} value - the value whose hash code is to be appended (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.append = function append(value, options) {\n this._hash = (this._hash * this._multiplier) + staticHashCode(value, options)\n\n return this\n}\n\n/**\n * Appends the result of computing the hash code for a super class to this {@link HashCodeBuilder}.\n *\n * @param {number} superHashCode - the result of computing the hash code for a super class\n * @return {HashCodeBuilder} A reference to this {@link HashCodeBuilder} for chaining purposes.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.appendSuper = function appendSuper(superHashCode) {\n this._hash = (this._hash * this._multiplier) + superHashCode\n\n return this\n}\n\n/**\n * Returns the computed hash code.\n *\n * @return {number} The hash code based on the appended values.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.build = function build() {\n return this._hash\n}\n\n/**\n * Returns the hash code for this {@link HashCodeBuilder}.\n *\n * This method will return the computed hash code based on the appended values.\n *\n * @return {number} The hash code.\n * @public\n * @memberof HashCodeBuilder#\n */\nHashCodeBuilder.prototype.hashCode = function hashCode() {\n return this._hash\n}\n\nmodule.exports = HashCodeBuilder\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar extend = require('./extend')\n\n/**\n * The base class from which all others should extend.\n *\n * @public\n * @constructor\n */\nfunction Nevis() {}\nNevis.class_ = 'Nevis'\nNevis.super_ = Object\n\n/**\n * Extends the constructor to which this method is associated with the prototype
and/or\n * statics
provided.\n *\n * If name
is provided, it will be used as the class name and can be accessed via a special\n * class_
property on the child constructor, otherwise the class name of the super constructor will be used\n * instead. The class name may also be used string representation for instances of the child constructor (via\n * toString
), but this is not applicable to the lite version of Nevis.\n *\n * If constructor
is provided, it will be used as the constructor for the child, otherwise a simple\n * constructor which only calls the super constructor will be used instead.\n *\n * The super constructor can be accessed via a special super_
property on the child constructor.\n *\n * @param {string} [name=this.class_] - the class name to be used for the child constructor\n * @param {Function} [constructor] - the constructor for the child\n * @param {Object} [prototype] - the prototype properties to be defined for the child\n * @param {Object} [statics] - the static properties to be defined for the child\n * @return {Function} The child constructor
provided or the one created if none was given.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.extend = extend\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n */\nfunction toString(value) {\n if (typeof value === 'undefined') {\n return 'undefined'\n }\n if (value == null) {\n return 'null'\n }\n\n return value.toString()\n}\n\nmodule.exports = toString\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\n/**\n * The strings for all array types (incl. typed arrays), as generated by Object.prototype.toString
.\n *\n * @public\n * @type {string[]}\n */\nexports.typeStrings = [\n 'Array',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array'\n].map(function(str) {\n return '[object ' + str + ']'\n})\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * values types that contain a collection of other values. This is achieved by requesting the elements contained within\n * e value as an array from the implementation and then compares each element to determine whether the values are equal.\n *\n * Implementations must implement the {@link CollectionEqualsComparator#getElements} and\n * {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar CollectionEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionEqualsComparator#\n */\n compare: function compare(context) {\n var elements = this.getElements(context.value, context)\n var otherElements = this.getElements(context.other, context)\n var length = elements.length\n\n if (length !== otherElements.length) {\n return false\n }\n\n while (length--) {\n if (!context.equals(elements[length], otherElements[length])) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the elements contained within the specified collection
.\n *\n * @param {*} collection - the collection whose elements are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The elements contained within collection
.\n * @protected\n * @abstract\n * @memberof CollectionEqualsComparator#\n */\n getElements: /* istanbul ignore next */ function getElements(collection, context) {}\n\n})\n\nmodule.exports = CollectionEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar arrays = require('../../util/arrays')\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar ArrayEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n getElements: function getElements(collection) {\n return collection\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayEqualsComparator#\n */\n supports: function supports(context) {\n return arrays.typeStrings.indexOf(context.string) >= 0\n }\n\n})\n\nmodule.exports = ArrayEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar DateEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.getTime() === context.other.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An abstract implementation of {@link EqualsComparator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the keys contained within each\n * value as an array from the implementation and then compares each key/value pair to determine whether the values are\n * equal.\n *\n * Implementations must implement the {@link HashEqualsComparator#getKeys}, {@link HashEqualsComparator#getValue}\n * and {@link EqualsComparator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar HashEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashEqualsComparator#\n */\n compare: function compare(context) {\n var value = context.value\n var other = context.other\n var keys = this.getKeys(value, context)\n var length = keys.length\n\n if (length !== this.getKeys(other, context).length) {\n return false\n }\n\n var key\n\n while (length--) {\n key = keys[length]\n\n if (!context.equals(this.getValue(value, key, context), this.getValue(other, key, context))) {\n return false\n }\n }\n\n return true\n },\n\n /**\n * Returns the keys contained within the value of the specified hash
.\n *\n * @param {*} hash - the hash whose keys are to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {Array} The keys contained within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getKeys: /* istanbul ignore next */ function getKeys(hash, context) {},\n\n /**\n * Returns the value associated with the specified key
in the hash
provided.\n *\n * @param {*} hash - the hash from which the value is to be returned\n * @param {*} key - the key for which the associated value is to be returned\n * @param {EqualsContext} context - the current {@link EqualsContext}\n * @return {*} The value for key
within hash
.\n * @protected\n * @abstract\n * @memberof HashEqualsComparator#\n */\n getValue: /* istanbul ignore next */ function getValue(hash, key, context) {}\n\n})\n\nmodule.exports = HashEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports map values.\n *\n * MapEqualsComparator
ignores insertion order when comparing maps.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar MapEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n getKeys: function getKeys(hash) {\n return Array.from(hash.keys())\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash.get(key)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Map]'\n }\n\n})\n\nmodule.exports = MapEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports number values (including NaN
).\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar NumberEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n compare: function compare(context) {\n return context.value !== context.value ? context.other !== context.other : context.value === context.other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof NumberEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'number'\n }\n\n})\n\nmodule.exports = NumberEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashEqualsComparator = require('./hash-comparator')\n\n/**\n * An implementation of {@link HashEqualsComparator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashEqualsComparator\n */\nvar ObjectEqualsComparator = HashEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getKeys: function getKeys(hash, context) {\n var keys = []\n var options = context.options\n var value\n\n for (var key in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, key)) {\n value = this.getValue(hash, key, context)\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(key, value, hash)) {\n keys.push(key)\n }\n }\n }\n\n return keys\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n getValue: function getValue(hash, key) {\n return hash[key]\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionEqualsComparator = require('./collection-comparator')\n\n/**\n * An implementation of {@link CollectionEqualsComparator} that supports set values.\n *\n * @protected\n * @constructor\n * @extends CollectionEqualsComparator\n */\nvar SetEqualsComparator = CollectionEqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetEqualsComparator#\n */\n getElements: function getElements(collection) {\n return Array.from(collection)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetEqualsComparator#\n */\n supports: function supports(context) {\n return context.string === '[object Set]'\n }\n\n})\n\nmodule.exports = SetEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar StringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n compare: function compare(context) {\n var other = context.other\n var value = context.value\n\n if (context.options.ignoreCase) {\n other = other.toLocaleUpperCase()\n value = value.toLocaleUpperCase()\n }\n\n return value === other\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsComparator = require('./comparator')\n\n/**\n * An implementation of {@link EqualsComparator} that supports miscellaneous values by comparing their string\n * representations (generated by calling toString
on each value).\n *\n * This {@link EqualsComparator} currently only supports functions and regular expressions.\n *\n * @protected\n * @constructor\n * @extends EqualsComparator\n */\nvar ToStringEqualsComparator = EqualsComparator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n compare: function compare(context) {\n return context.value.toString() === context.other.toString()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringEqualsComparator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringEqualsComparator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayEqualsComparator = require('./array-comparator')\nvar CollectionEqualsComparator = require('./collection-comparator')\nvar DateEqualsComparator = require('./date-comparator')\nvar EqualsComparator = require('./comparator')\nvar HashEqualsComparator = require('./hash-comparator')\nvar MapEqualsComparator = require('./map-comparator')\nvar NumberEqualsComparator = require('./number-comparator')\nvar ObjectEqualsComparator = require('./object-comparator')\nvar SetEqualsComparator = require('./set-comparator')\nvar StringEqualsComparator = require('./string-comparator')\nvar ToStringEqualsComparator = require('./to-string-comparator')\n\n/**\n * A hash containing constructors for all equals comparators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayEqualsComparator: ArrayEqualsComparator,\n CollectionEqualsComparator: CollectionEqualsComparator,\n DateEqualsComparator: DateEqualsComparator,\n EqualsComparator: EqualsComparator,\n HashEqualsComparator: HashEqualsComparator,\n MapEqualsComparator: MapEqualsComparator,\n NumberEqualsComparator: NumberEqualsComparator,\n ObjectEqualsComparator: ObjectEqualsComparator,\n SetEqualsComparator: SetEqualsComparator,\n StringEqualsComparator: StringEqualsComparator,\n ToStringEqualsComparator: ToStringEqualsComparator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that contain a collection of other values. This is achieved by requesting the elements contained within\n * the value as an array from the implementation and then generates hash codes for each element to compute the hash code\n * for the value.\n *\n * Implementations must implement the {@link CollectionHashCodeGenerator#getElements} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CollectionHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof CollectionHashCodeGenerator#\n */\n generate: function generate(context) {\n var elements = this.getElements(context)\n\n return elements.reduce(function(hash, element) {\n return ((31 * hash) + context.hashCode(element)) | 0\n }, 1)\n },\n\n /**\n * Returns the elements contained within the value of the specified context
.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose children elements are to\n * be returned\n * @return {Array} The elements contained within the value of context
.\n * @protected\n * @abstract\n * @memberof CollectionHashCodeGenerator#\n */\n getElements: /* istanbul ignore next */ function getElements(context) {}\n\n})\n\nmodule.exports = CollectionHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar arrays = require('../../util/arrays')\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports array values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar ArrayHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return context.value\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ArrayHashCodeGenerator#\n */\n supports: function support(context) {\n return arrays.typeStrings.indexOf(context.string) >= 0\n }\n\n})\n\nmodule.exports = ArrayHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports boolean values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar BooleanHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value ? 1231 : 1237\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof BooleanHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'boolean'\n }\n\n})\n\nmodule.exports = BooleanHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to cache\n * generated hash codes to avoid re-generating them for the same values. Obviously, this should only ever be done for\n * immutable values.\n *\n * Generated hash codes should only ever be cached when the allowCache
option is enabled, however, the\n * cache will always be checked before attempting to generate a hash code for a value.\n *\n * Implementations must implement the {@link CachingHashCodeGenerator#generateInternal} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar CachingHashCodeGenerator = HashCodeGenerator.extend(function() {\n /**\n * A cache of values mapped to their previously generated hash codes.\n *\n * @private\n * @type {Object.<*, number>}\n * @memberof CachingHashCodeGenerator#\n */\n this._cache = {}\n}, {\n\n /**\n * Clears the cache of hash codes that have been previously generated by this {@link CachingHashCodeGenerator} while\n * the allowCache
option has been enabled.\n *\n * @return {void}\n * @public\n * @memberof CachingHashCodeGenerator#\n */\n clearCache: function clearCache() {\n this._cache = {}\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof CachingHashCodeGenerator#\n */\n generate: function generate(context) {\n var hash = this._cache[context.value]\n\n if (hash == null) {\n hash = this.generateInternal(context)\n\n if (context.options.allowCache) {\n this._cache[context.value] = hash\n }\n }\n\n return hash\n },\n\n /**\n * Returns a hash code for the specified context
.\n *\n * This method is called internally by {@link CachingHashCodeGenerator#generate} only when a hash code needs to be\n * generated (i.e. the cache doesn't contain a previously generated hash code for the value of context
).\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} for which the hash code is to be generated\n * @return {number} The hash code generated for context
.\n * @protected\n * @abstract\n * @memberof CachingHashCodeGenerator#\n */\n generateInternal: /* istanbul ignore next */ function generateInternal(context) {}\n\n})\n\nmodule.exports = CachingHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An implementation of {@link HashCodeGenerator} that supports date values.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar DateHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n generate: function generate(context) {\n return context.value.getTime()\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof DateHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Date]'\n }\n\n})\n\nmodule.exports = DateHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashCodeGenerator = require('./generator')\n\n/**\n * An abstract implementation of {@link HashCodeGenerator} that is intended for implementations that wish to support\n * value types that represent a hash of key/value pairs. This is achieved by requesting the entries of key/value pairs\n * contained within the value as an multi-dimensional array from the implementation and then generates hash codes for\n * each entry to compute the hash code for the value.\n *\n * Implementations must implement the {@link HashHashCodeGenerator#getEntries} and\n * {@link HashCodeGenerator#supports} methods.\n *\n * @protected\n * @constructor\n * @extends HashCodeGenerator\n */\nvar HashHashCodeGenerator = HashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof HashHashCodeGenerator#\n */\n generate: function generate(context) {\n var entries = this.getEntries(context)\n\n return entries.reduce(function(hash, entry) {\n return hash + (context.hashCode(entry[0]) ^ context.hashCode(entry[1]))\n }, 0)\n },\n\n /**\n * Returns the entries contained within the value of the specified context
.\n *\n * This method returns a multi-dimensional array where each entry is an array consisting of the key and value, in that\n * order.\n *\n * @param {HashCodeContext} context - the {@link HashCodeContext} containing the value whose entries are to be\n * returned\n * @return {Array.} The entries contained within the value of context
.\n * @protected\n * @abstract\n * @memberof HashHashCodeGenerator#\n */\n getEntries: /* istanbul ignore next */ function getEntries(context) {}\n\n})\n\nmodule.exports = HashHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports map values.\n *\n * Insertion order should have no impact on the hash code generated by MapHashCodeGenerator
.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar MapHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n return Array.from(context.value.entries())\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof MapHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.string === '[object Map]'\n }\n\n})\n\nmodule.exports = MapHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar HashHashCodeGenerator = require('./hash-generator')\n\n/**\n * An implementation of {@link HashHashCodeGenerator} that supports plain old object values.\n *\n * @protected\n * @constructor\n * @extends HashHashCodeGenerator\n */\nvar ObjectHashCodeGenerator = HashHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n getEntries: function getEntries(context) {\n var entries = []\n var hash = context.value\n var options = context.options\n var value\n\n for (var name in hash) {\n if (!options.ignoreInherited || Object.prototype.hasOwnProperty.call(hash, name)) {\n value = hash[name]\n\n if ((typeof value !== 'function' || !options.ignoreMethods) && options.filterProperty(name, value, hash)) {\n entries.push([ name, value ])\n }\n }\n }\n\n return entries\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ObjectHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'object'\n }\n\n})\n\nmodule.exports = ObjectHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CollectionHashCodeGenerator = require('./collection-generator')\n\n/**\n * An implementation of {@link CollectionHashCodeGenerator} that supports set values.\n *\n * @protected\n * @constructor\n * @extends CollectionHashCodeGenerator\n */\nvar SetHashCodeGenerator = CollectionHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetHashCodeGenerator#\n */\n getElements: function getElements(context) {\n return Array.from(context.value)\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof SetHashCodeGenerator#\n */\n supports: function support(context) {\n return context.string === '[object Set]'\n }\n\n})\n\nmodule.exports = SetHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar CachingHashCodeGenerator = require('./caching-generator')\n\n/**\n * An implementation of {@link CachingHashCodeGenerator} that supports string values.\n *\n * @protected\n * @constructor\n * @extends CachingHashCodeGenerator\n */\nvar StringHashCodeGenerator = CachingHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n generateInternal: function generateInternal(context) {\n var hash = 0\n var length = context.value.length\n\n for (var i = 0; i < length; i++) {\n hash = ((31 * hash) + context.value.charCodeAt(i)) | 0\n }\n\n return hash\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof StringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'string'\n }\n\n})\n\nmodule.exports = StringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar StringHashCodeGenerator = require('./string-generator')\n\n/**\n * An extension of {@link StringHashCodeGenerator} that supports miscellaneous values by generating hash codes for their\n * string representations (generated by calling toString
on the value).\n *\n * This {@link HashCodeGenerator} currently only supports functions, numbers and regular expressions.\n *\n * @protected\n * @constructor\n * @extends StringHashCodeGenerator\n */\nvar ToStringHashCodeGenerator = StringHashCodeGenerator.extend({\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n generate: function generate(context) {\n return ToStringHashCodeGenerator.super_.prototype.generate.call(this, context.copy(context.value.toString()))\n },\n\n /**\n * @inheritdoc\n * @override\n * @memberof ToStringHashCodeGenerator#\n */\n supports: function supports(context) {\n return context.type === 'function' || context.type === 'number' || context.string === '[object RegExp]'\n }\n\n})\n\nmodule.exports = ToStringHashCodeGenerator\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar ArrayHashCodeGenerator = require('./array-generator')\nvar BooleanHashCodeGenerator = require('./boolean-generator')\nvar CachingHashCodeGenerator = require('./caching-generator')\nvar CollectionHashCodeGenerator = require('./collection-generator')\nvar DateHashCodeGenerator = require('./date-generator')\nvar HashCodeGenerator = require('./generator')\nvar HashHashCodeGenerator = require('./hash-generator')\nvar MapHashCodeGenerator = require('./map-generator')\nvar ObjectHashCodeGenerator = require('./object-generator')\nvar SetHashCodeGenerator = require('./set-generator')\nvar StringHashCodeGenerator = require('./string-generator')\nvar ToStringHashCodeGenerator = require('./to-string-generator')\n\n/**\n * A hash containing constructors for all hash code generators.\n *\n * @public\n * @type {Object.}\n */\nmodule.exports = {\n ArrayHashCodeGenerator: ArrayHashCodeGenerator,\n BooleanHashCodeGenerator: BooleanHashCodeGenerator,\n CachingHashCodeGenerator: CachingHashCodeGenerator,\n CollectionHashCodeGenerator: CollectionHashCodeGenerator,\n DateHashCodeGenerator: DateHashCodeGenerator,\n HashCodeGenerator: HashCodeGenerator,\n HashHashCodeGenerator: HashHashCodeGenerator,\n MapHashCodeGenerator: MapHashCodeGenerator,\n ObjectHashCodeGenerator: ObjectHashCodeGenerator,\n SetHashCodeGenerator: SetHashCodeGenerator,\n StringHashCodeGenerator: StringHashCodeGenerator,\n ToStringHashCodeGenerator: ToStringHashCodeGenerator\n}\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nvar EqualsBuilder = require('./equals/builder')\nvar HashCodeBuilder = require('./hash-code/builder')\nvar Nevis = require('./nevis')\nvar staticEquals = require('./equals')\nvar staticHashCode = require('./hash-code')\nvar staticToString = require('./to-string')\n\n/**\n * Returns whether the specified value
is \"equal to\" the other
provided using the given\n * options
.\n *\n * Consequently, if both arguments are null
, true
is returned and if exactly one argument is\n * null
, false
is returned. Otherwise, this method implements an equivalence relation on\n * non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, equals(x, x)
should\n * return true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * equals(x, y)
should return true
if and only if equals(y, x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if equals(x, y)
returns true
and equals(y, z)
returns true
,\n * then equals(x, z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of equals(x, y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, equals(x, null)
should return\n * false
. \n *
\n *\n * If neither value is null
and both are not exactly (strictly) equal, this method will first check whether\n * value
has a method named \"equals\" and, if so, return the result of calling that method with\n * other
passed to it. If no \"equals\" method exists on value
or if the\n * ignoreEquals
option is enabled, it will attempt to test the equality internally based on their type.\n *\n * Plain objects are tested recursively for their properties and collections (e.g. arrays) are also tested recursively\n * for their elements.\n *\n * @param {*} value - the value to be checked against other
(may be null
)\n * @param {Function} [value.equals] - the method to be used to test equality for value
and\n * other
, when present\n * @param {*} other - the other value to be checked against value
(may be null
)\n * @param {Nevis~EqualsOptions} [options] - the options to be used (may be null
)\n * @return {boolean} true
if value
is equal to other
; otherwise\n * false
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.equals = staticEquals\n\n/**\n * Assists in building good equals for complex classes.\n *\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.EqualsBuilder = EqualsBuilder\n\n/**\n * Returns a hash code for the specified value
using the options
provided. This method is\n * supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same value more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the value is modified. This number need not remain consistent from one execution of an application to\n * another execution of the same application. \n * - If two values are equal, that calling the
hashCode
method on each of the two values must produce\n * the same number result. \n * - It is not required that if two values are unequal, that calling the
hashCode
method on each\n * of the two values must produce distinct number results. However, the programmer should be aware that producing\n * distinct number results for unequal values may improve the performance of hash tables. \n *
\n *\n * If value
is null
, this method will always return zero. Otherwise, it will check whether\n * value
has a method named \"hashCode\" and, if so, return the result of calling that method. If no\n * \"hashCode\" method exists on value
or if the ignoreHashCode
option is enabled, it will\n * attempt to generate the hash code internally based on its type.\n *\n * Plain objects are hashed recursively for their properties and collections (e.g. arrays) are also hashed recursively\n * for their elements.\n *\n * @param {*} value - the value whose hash code is to be returned (may be null
)\n * @param {Function} [value.hashCode] - the method used to produce the hash code for value
, when present\n * @param {Nevis~HashCodeOptions} [options] - the options to be used (may be null
)\n * @return {number} A hash code for value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.hashCode = staticHashCode\n\n/**\n * Assists in building hash codes for complex classes.\n *\n * Ideally the initial
value and multiplier
should be different for each class, however, this\n * is not vital. Prime numbers are preferred, especially for multiplier
.\n *\n * @param {number} [initial=HashCodeBuilder.DEFAULT_INITIAL_VALUE] - the initial value to be used (may be\n * null
but cannot be even)\n * @param {number} [multiplier=HashCodeBuilder.DEFAULT_MULTIPLIER_VALUE] - the multiplier to be used (may be\n * null
but cannot be even)\n * @throws {Error} If either initial
or multiplier
are even numbers.\n * @public\n * @static\n * @constructor\n * @memberof Nevis\n */\nNevis.HashCodeBuilder = HashCodeBuilder\n\n/**\n * Returns the result of calling the toString
method on the specified value
when it is\n * non-null.\n *\n * If value
is null
or undefined
, this method will return \"null\"
or\n * \"undefined\"
respectively.\n *\n * @param {*} value - the value whose string representation is to be returned (may be null
)\n * @return {string} The string representation of value
.\n * @public\n * @static\n * @memberof Nevis\n */\nNevis.toString = staticToString\n\n/**\n * Returns whether this instance is \"equal to\" the specified obj
.\n *\n * This method implements an equivalence relation on non-null object references:\n *\n * \n * - It is reflexive: for any non-null reference value
x
, x.equals(x)
should return\n * true
. \n * - It is symmetric: for any non-null reference values
x
and y
,\n * x.equals(y)
should return true
if and only if y.equals(x)
returns\n * true
. \n * - It is transitive: for any non-null reference values
x
, y
, and z
,\n * if x.equals(y)
returns true
and y.equals(z)
returns true
, then\n * x.equals(z)
should return true
. \n * - It is consistent: for any non-null reference values
x
and y
, multiple\n * invocations of x.equals(y)
consistently return true
or consistently return\n * false
, provided no information used in equals
comparisons on the objects is\n * modified. \n * - For any non-null reference value
x
, x.equals(null)
should return\n * false
. \n *
\n *\n * The default implementation of this method is the most discriminating possible equivalence relation on objects; that\n * is, for any non-null reference values x
and y
, this method returns true
if,\n * and only if, x
and y
are exactly equal (x === y
has the value\n * true
).\n *\n * Please note that it is generally necessary to override the {@link Nevis#hashCode} method whenever this method is\n * overridden, so as to maintain the general contract for the {@link Nevis#hashCode} method, which states that equal\n * objects must have equal hash codes.\n *\n * @param {*} obj - the reference to which this instance is to be compared (may be null
)\n * @return {boolean} true
if this instance is equal to obj
; otherwise false
.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.equals = function equals(obj) {\n return this === obj\n}\n\n/**\n * Returns the hash code for this instance. This method is supported for the benefit of hash tables.\n *\n * The general contract of hashCode
is:\n *\n * \n * - Whenever it is invoked on the same instance more than once during an execution of an application, the\n *
hashCode
method must consistently return the same number, provided no information used to generate the\n * hash code on the instance is modified. This number need not remain consistent from one execution of an application\n * to another execution of the same application. \n * - If two instances are equal, that calling the
hashCode
method on each of the two instances must\n * produce the same number result. \n * - It is not required that if two instances are unequal, that calling the
hashCode
method on\n * each of the two instances must produce distinct number results. However, the programmer should be aware that\n * producing distinct number results for unequal instances may improve the performance of hash tables. \n *
\n *\n * The default implementation of this method will attempt to generate the hash code based on all of the fields on this\n * instance.\n *\n * Please note that it is generally necessary to override the {@link Nevis#equals} method whenever this method is\n * overridden, so as to maintain the above contract where equal objects must have equal hash codes.\n *\n * @return {number} The hash code.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.hashCode = function hashCode() {\n return staticHashCode(this, { ignoreHashCode: true })\n}\n\n/**\n * Returns a string representation of this instance.\n *\n * In general, the {@code Nevis#toString} method returns a string that \"textually represents\" this instance. The result\n * should be a concise but informative representation that is easy for a person to read.\n *\n * The default implementation of this method will return a string consisting of this instance's class name, the at-sign\n * character (@
), and the hexadecimal representation of the hash code of this instance.\n *\n * @return {string} A string representation of this instance.\n * @public\n * @memberof Nevis#\n */\nNevis.prototype.toString = function toString() {\n return this.constructor.class_ + '@' + this.hashCode().toString(16)\n}\n\nmodule.exports = Nevis\n","/*\n * Copyright (C) 2017 Alasdair Mercer, Skelp\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n'use strict'\n\nmodule.exports = require('./src')\n"],"names":["createObject","prototype","properties","result","Object","create","Constructor","extendObject","extend","name","constructor","statics","superConstructor","this","apply","arguments","class_","super_","own","target","sources","slice","call","property","source","i","length","hasOwnProperty","EqualsComparator","EqualsContext","value","other","equals","options","_equals","filterProperty","ignoreCase","Boolean","ignoreEquals","ignoreInherited","ignoreMethods","string","toString","type","context","validate","comparator","activeComparators","supports","compare","EqualsBuilder","HashCodeGenerator","HashCodeContext","hashCode","_hashCode","allowCache","ignoreHashCode","generator","activeGenerators","generate","defaultGenerator","HashCodeBuilder","initial","multiplier","DEFAULT_INITIAL_VALUE","Error","DEFAULT_MULTIPLIER_VALUE","_hash","_multiplier","Nevis","map","str","Array","CollectionEqualsComparator","elements","getElements","otherElements","collection","ArrayEqualsComparator","arrays","typeStrings","indexOf","DateEqualsComparator","getTime","HashEqualsComparator","keys","getKeys","key","getValue","hash","MapEqualsComparator","from","get","NumberEqualsComparator","ObjectEqualsComparator","push","SetEqualsComparator","StringEqualsComparator","toLocaleUpperCase","ToStringEqualsComparator","copy","comparators","append","staticEquals","appendSuper","superEquals","build","CollectionHashCodeGenerator","reduce","element","ArrayHashCodeGenerator","BooleanHashCodeGenerator","CachingHashCodeGenerator","_cache","clearCache","generateInternal","DateHashCodeGenerator","HashHashCodeGenerator","entries","getEntries","entry","MapHashCodeGenerator","ObjectHashCodeGenerator","SetHashCodeGenerator","StringHashCodeGenerator","charCodeAt","ToStringHashCodeGenerator","generators","forEach","staticHashCode","superHashCode","staticToString","obj","require$$0"],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G,GACvC,MAAOvH,QAASuH,MA8BZnI,UAAUoD,SAAW,WACzB,MAAO4E,IAAepH,MAAQ2C,gBAAgB,QAgB1CvD,UAAUyC,SAAW,WACzB,MAAO7B,MAAKH,YAAYM,OAAS,IAAMH,KAAKwC,WAAWX,SAAS,YAGjD2B,MC5NAgE"}
\ No newline at end of file
diff --git a/package.json b/package.json
index a3b625d..f610734 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nevis",
- "version": "0.3.0",
+ "version": "0.4.0",
"description": "Makes JavaScript more object-orientated",
"homepage": "https://github.com/Skelp/nevis",
"bugs": {
@@ -53,6 +53,7 @@
"browser": "dist/nevis.js",
"scripts": {
"build": "grunt build",
+ "ci": "grunt ci",
"report-coverage": "grunt coveralls",
"test": "grunt test"
}
diff --git a/src/equals/comparators/array-comparator.js b/src/equals/comparators/array-comparator.js
index 65d62c9..925850a 100644
--- a/src/equals/comparators/array-comparator.js
+++ b/src/equals/comparators/array-comparator.js
@@ -22,6 +22,7 @@
'use strict'
+var arrays = require('../../util/arrays')
var CollectionEqualsComparator = require('./collection-comparator')
/**
@@ -48,7 +49,7 @@ var ArrayEqualsComparator = CollectionEqualsComparator.extend({
* @memberof ArrayEqualsComparator#
*/
supports: function supports(context) {
- return context.string === '[object Array]'
+ return arrays.typeStrings.indexOf(context.string) >= 0
}
})
diff --git a/src/equals/comparators/index.js b/src/equals/comparators/index.js
index d43fe91..5c6f6c9 100644
--- a/src/equals/comparators/index.js
+++ b/src/equals/comparators/index.js
@@ -27,8 +27,10 @@ var CollectionEqualsComparator = require('./collection-comparator')
var DateEqualsComparator = require('./date-comparator')
var EqualsComparator = require('./comparator')
var HashEqualsComparator = require('./hash-comparator')
+var MapEqualsComparator = require('./map-comparator')
var NumberEqualsComparator = require('./number-comparator')
var ObjectEqualsComparator = require('./object-comparator')
+var SetEqualsComparator = require('./set-comparator')
var StringEqualsComparator = require('./string-comparator')
var ToStringEqualsComparator = require('./to-string-comparator')
@@ -44,8 +46,10 @@ module.exports = {
DateEqualsComparator: DateEqualsComparator,
EqualsComparator: EqualsComparator,
HashEqualsComparator: HashEqualsComparator,
+ MapEqualsComparator: MapEqualsComparator,
NumberEqualsComparator: NumberEqualsComparator,
ObjectEqualsComparator: ObjectEqualsComparator,
+ SetEqualsComparator: SetEqualsComparator,
StringEqualsComparator: StringEqualsComparator,
ToStringEqualsComparator: ToStringEqualsComparator
}
diff --git a/src/equals/comparators/map-comparator.js b/src/equals/comparators/map-comparator.js
new file mode 100644
index 0000000..1c277b1
--- /dev/null
+++ b/src/equals/comparators/map-comparator.js
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var HashEqualsComparator = require('./hash-comparator')
+
+/**
+ * An implementation of {@link HashEqualsComparator} that supports map values.
+ *
+ * MapEqualsComparator
ignores insertion order when comparing maps.
+ *
+ * @protected
+ * @constructor
+ * @extends HashEqualsComparator
+ */
+var MapEqualsComparator = HashEqualsComparator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ getKeys: function getKeys(hash) {
+ return Array.from(hash.keys())
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ getValue: function getValue(hash, key) {
+ return hash.get(key)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapEqualsComparator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Map]'
+ }
+
+})
+
+module.exports = MapEqualsComparator
diff --git a/src/equals/comparators/set-comparator.js b/src/equals/comparators/set-comparator.js
new file mode 100644
index 0000000..cfafa09
--- /dev/null
+++ b/src/equals/comparators/set-comparator.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var CollectionEqualsComparator = require('./collection-comparator')
+
+/**
+ * An implementation of {@link CollectionEqualsComparator} that supports set values.
+ *
+ * @protected
+ * @constructor
+ * @extends CollectionEqualsComparator
+ */
+var SetEqualsComparator = CollectionEqualsComparator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetEqualsComparator#
+ */
+ getElements: function getElements(collection) {
+ return Array.from(collection)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetEqualsComparator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Set]'
+ }
+
+})
+
+module.exports = SetEqualsComparator
diff --git a/src/equals/index.js b/src/equals/index.js
index 4bec682..1a23561 100644
--- a/src/equals/index.js
+++ b/src/equals/index.js
@@ -37,6 +37,8 @@ var activeComparators = [
new comparators.DateEqualsComparator(),
new comparators.ToStringEqualsComparator(),
new comparators.ArrayEqualsComparator(),
+ new comparators.SetEqualsComparator(),
+ new comparators.MapEqualsComparator(),
new comparators.ObjectEqualsComparator()
]
diff --git a/src/extend.js b/src/extend.js
index 26be75c..027169b 100644
--- a/src/extend.js
+++ b/src/extend.js
@@ -56,7 +56,7 @@ var slice = Array.prototype.slice
*/
function createObject(prototype, properties) {
var result
- /* istanbul ignore else */
+ /* istanbul ignore next */
if (typeof Object.create === 'function') {
result = Object.create(prototype)
} else {
diff --git a/src/hash-code/generators/array-generator.js b/src/hash-code/generators/array-generator.js
index e25b6d6..b1f746c 100644
--- a/src/hash-code/generators/array-generator.js
+++ b/src/hash-code/generators/array-generator.js
@@ -22,6 +22,7 @@
'use strict'
+var arrays = require('../../util/arrays')
var CollectionHashCodeGenerator = require('./collection-generator')
/**
@@ -48,7 +49,7 @@ var ArrayHashCodeGenerator = CollectionHashCodeGenerator.extend({
* @memberof ArrayHashCodeGenerator#
*/
supports: function support(context) {
- return context.string === '[object Array]'
+ return arrays.typeStrings.indexOf(context.string) >= 0
}
})
diff --git a/src/hash-code/generators/index.js b/src/hash-code/generators/index.js
index 3fd9a20..b4be78c 100644
--- a/src/hash-code/generators/index.js
+++ b/src/hash-code/generators/index.js
@@ -29,7 +29,9 @@ var CollectionHashCodeGenerator = require('./collection-generator')
var DateHashCodeGenerator = require('./date-generator')
var HashCodeGenerator = require('./generator')
var HashHashCodeGenerator = require('./hash-generator')
+var MapHashCodeGenerator = require('./map-generator')
var ObjectHashCodeGenerator = require('./object-generator')
+var SetHashCodeGenerator = require('./set-generator')
var StringHashCodeGenerator = require('./string-generator')
var ToStringHashCodeGenerator = require('./to-string-generator')
@@ -47,7 +49,9 @@ module.exports = {
DateHashCodeGenerator: DateHashCodeGenerator,
HashCodeGenerator: HashCodeGenerator,
HashHashCodeGenerator: HashHashCodeGenerator,
+ MapHashCodeGenerator: MapHashCodeGenerator,
ObjectHashCodeGenerator: ObjectHashCodeGenerator,
+ SetHashCodeGenerator: SetHashCodeGenerator,
StringHashCodeGenerator: StringHashCodeGenerator,
ToStringHashCodeGenerator: ToStringHashCodeGenerator
}
diff --git a/src/hash-code/generators/map-generator.js b/src/hash-code/generators/map-generator.js
new file mode 100644
index 0000000..7d7bddf
--- /dev/null
+++ b/src/hash-code/generators/map-generator.js
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var HashHashCodeGenerator = require('./hash-generator')
+
+/**
+ * An implementation of {@link HashHashCodeGenerator} that supports map values.
+ *
+ * Insertion order should have no impact on the hash code generated by MapHashCodeGenerator
.
+ *
+ * @protected
+ * @constructor
+ * @extends HashHashCodeGenerator
+ */
+var MapHashCodeGenerator = HashHashCodeGenerator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapHashCodeGenerator#
+ */
+ getEntries: function getEntries(context) {
+ return Array.from(context.value.entries())
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof MapHashCodeGenerator#
+ */
+ supports: function supports(context) {
+ return context.string === '[object Map]'
+ }
+
+})
+
+module.exports = MapHashCodeGenerator
diff --git a/src/hash-code/generators/set-generator.js b/src/hash-code/generators/set-generator.js
new file mode 100644
index 0000000..28d4627
--- /dev/null
+++ b/src/hash-code/generators/set-generator.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var CollectionHashCodeGenerator = require('./collection-generator')
+
+/**
+ * An implementation of {@link CollectionHashCodeGenerator} that supports set values.
+ *
+ * @protected
+ * @constructor
+ * @extends CollectionHashCodeGenerator
+ */
+var SetHashCodeGenerator = CollectionHashCodeGenerator.extend({
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetHashCodeGenerator#
+ */
+ getElements: function getElements(context) {
+ return Array.from(context.value)
+ },
+
+ /**
+ * @inheritdoc
+ * @override
+ * @memberof SetHashCodeGenerator#
+ */
+ supports: function support(context) {
+ return context.string === '[object Set]'
+ }
+
+})
+
+module.exports = SetHashCodeGenerator
diff --git a/src/hash-code/index.js b/src/hash-code/index.js
index 1536480..44f4abe 100644
--- a/src/hash-code/index.js
+++ b/src/hash-code/index.js
@@ -37,7 +37,9 @@ var activeGenerators = [
new generators.StringHashCodeGenerator(),
new generators.DateHashCodeGenerator(),
new generators.ToStringHashCodeGenerator(),
- new generators.ArrayHashCodeGenerator()
+ new generators.ArrayHashCodeGenerator(),
+ new generators.SetHashCodeGenerator(),
+ new generators.MapHashCodeGenerator()
]
/**
diff --git a/src/util/arrays.js b/src/util/arrays.js
new file mode 100644
index 0000000..283600d
--- /dev/null
+++ b/src/util/arrays.js
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+/**
+ * The strings for all array types (incl. typed arrays), as generated by Object.prototype.toString
.
+ *
+ * @public
+ * @type {string[]}
+ */
+exports.typeStrings = [
+ 'Array',
+ 'Int8Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Int16Array',
+ 'Uint16Array',
+ 'Int32Array',
+ 'Uint32Array',
+ 'Float32Array',
+ 'Float64Array'
+].map(function(str) {
+ return '[object ' + str + ']'
+})
diff --git a/test/.eslintrc.json b/test/.eslintrc.json
index 3108303..a4ffeb1 100644
--- a/test/.eslintrc.json
+++ b/test/.eslintrc.json
@@ -1,6 +1,7 @@
{
"extends": "../.eslintrc.json",
"env": {
+ "es6": true,
"mocha": true
},
"rules": {
diff --git a/test/equals/comparators/array-comparator.spec.js b/test/equals/comparators/array-comparator.spec.js
index 940b140..767b982 100644
--- a/test/equals/comparators/array-comparator.spec.js
+++ b/test/equals/comparators/array-comparator.spec.js
@@ -45,6 +45,9 @@ describe('equals/comparators/array-comparator:ArrayEqualsComparator', function()
it('should return true', function() {
expect(comparator.compare(new EqualsContext([], [], equals))).to.be.true
expect(comparator.compare(new EqualsContext([ 'foo', 'bar', 123 ], [ 'foo', 'bar', 123 ], equals))).to.be.true
+ expect(comparator.compare(new EqualsContext(new Int8Array(), new Int8Array(), equals))).to.be.true
+ expect(comparator.compare(new EqualsContext(new Int8Array([ 123, 321 ]), new Int8Array([ 123, 321 ]), equals)))
+ .to.be.true
})
})
@@ -53,6 +56,9 @@ describe('equals/comparators/array-comparator:ArrayEqualsComparator', function()
expect(comparator.compare(new EqualsContext([], [ 'foo', 'bar', 123 ], equals))).to.be.false
expect(comparator.compare(new EqualsContext([ 'foo', 'bar', 123 ], [ 'fu', 'baz', 321 ], equals))).to.be.false
expect(comparator.compare(new EqualsContext([ 'foo', 'bar', 123 ], [ 123, 'bar', 'foo' ], equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Int8Array(), new Int8Array([ 123, 321 ]), equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Int8Array([ 123, 321 ]), new Int8Array([ 321, 123 ]), equals)))
+ .to.be.false
})
})
})
@@ -60,6 +66,15 @@ describe('equals/comparators/array-comparator:ArrayEqualsComparator', function()
describe('#supports', function() {
it('should return true for array values', function() {
expect(comparator.supports(new EqualsContext([], null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Int8Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Uint8Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Uint8ClampedArray(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Int16Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Uint16Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Int32Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Uint32Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Float32Array(), null, equals))).to.be.true
+ expect(comparator.supports(new EqualsContext(new Float64Array(), null, equals))).to.be.true
})
it('should return false for other values', function() {
@@ -70,6 +85,8 @@ describe('equals/comparators/array-comparator:ArrayEqualsComparator', function()
expect(comparator.supports(new EqualsContext(/foo/, null, equals))).to.be.false
expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
})
})
})
diff --git a/test/equals/comparators/date-comparator.spec.js b/test/equals/comparators/date-comparator.spec.js
index f1e5911..80440ec 100644
--- a/test/equals/comparators/date-comparator.spec.js
+++ b/test/equals/comparators/date-comparator.spec.js
@@ -70,6 +70,8 @@ describe('equals/comparators/date-comparator:DateEqualsComparator', function() {
expect(comparator.supports(new EqualsContext(/foo/, null, equals))).to.be.false
expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
})
})
})
diff --git a/test/equals/comparators/index.spec.js b/test/equals/comparators/index.spec.js
index b80d8ee..df2a779 100644
--- a/test/equals/comparators/index.spec.js
+++ b/test/equals/comparators/index.spec.js
@@ -30,8 +30,10 @@ var EqualsComparator = require('../../../src/equals/comparators/comparator')
var comparators = require('../../../src/equals/comparators')
var DateEqualsComparator = require('../../../src/equals/comparators/date-comparator')
var HashEqualsComparator = require('../../../src/equals/comparators/hash-comparator')
+var MapEqualsComparator = require('../../../src/equals/comparators/map-comparator')
var NumberEqualsComparator = require('../../../src/equals/comparators/number-comparator')
var ObjectEqualsComparator = require('../../../src/equals/comparators/object-comparator')
+var SetEqualsComparator = require('../../../src/equals/comparators/set-comparator')
var StringEqualsComparator = require('../../../src/equals/comparators/string-comparator')
var ToStringEqualsComparator = require('../../../src/equals/comparators/to-string-comparator')
@@ -43,8 +45,10 @@ describe('equals/comparators/index', function() {
DateEqualsComparator: DateEqualsComparator,
EqualsComparator: EqualsComparator,
HashEqualsComparator: HashEqualsComparator,
+ MapEqualsComparator: MapEqualsComparator,
NumberEqualsComparator: NumberEqualsComparator,
ObjectEqualsComparator: ObjectEqualsComparator,
+ SetEqualsComparator: SetEqualsComparator,
StringEqualsComparator: StringEqualsComparator,
ToStringEqualsComparator: ToStringEqualsComparator
})
diff --git a/test/equals/comparators/map-comparator.spec.js b/test/equals/comparators/map-comparator.spec.js
new file mode 100644
index 0000000..d2ddd03
--- /dev/null
+++ b/test/equals/comparators/map-comparator.spec.js
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var expect = require('chai').expect
+
+var equals = require('../../../src/equals/index')
+var EqualsContext = require('../../../src/equals/context')
+var HashEqualsComparator = require('../../../src/equals/comparators/hash-comparator')
+var MapEqualsComparator = require('../../../src/equals/comparators/map-comparator')
+
+describe('equals/comparators/map-comparator:MapEqualsComparator', function() {
+ var comparator
+
+ before(function() {
+ comparator = new MapEqualsComparator()
+ })
+
+ it('should be a HashEqualsComparator', function() {
+ expect(comparator).to.be.an.instanceof(HashEqualsComparator)
+ })
+
+ describe('#compare', function() {
+ context('when map values are equal', function() {
+ it('should return true', function() {
+ expect(comparator.compare(new EqualsContext(new Map(), new Map(), equals))).to.be.true
+ expect(comparator.compare(new EqualsContext(new Map([
+ [ 'foo', 'bar' ]
+ ]), new Map([
+ [ 'foo', 'bar' ]
+ ]), equals))).to.be.true
+ expect(comparator.compare(new EqualsContext(new Map([
+ [ 'foo', 'bar' ],
+ [ 'fu', 'baz' ]
+ ]), new Map([
+ [ 'fu', 'baz' ],
+ [ 'foo', 'bar' ]
+ ]), equals))).to.be.true
+ })
+ })
+
+ context('when map values are not equal', function() {
+ it('should return false', function() {
+ expect(comparator.compare(new EqualsContext(new Map(), new Map([
+ [ 'foo', 'bar' ]
+ ]), equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Map([
+ [ 'foo', 'bar' ]
+ ]), new Map([
+ [ 'bar', 'foo' ]
+ ]), equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Map([
+ [ 'foo', 'bar' ],
+ [ 'fu', 'baz' ]
+ ]), new Map([
+ [ 'fu', 'baz' ]
+ ]), equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Map([
+ [ 'foo', 'bar' ],
+ [ 'fu', 'baz' ]
+ ]), new Map([
+ [ 'fizz', 'buz' ],
+ [ 'quux', 213 ]
+ ]), equals))).to.be.false
+ })
+ })
+ })
+
+ describe('#supports', function() {
+ it('should return true for map values', function() {
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.true
+ })
+
+ it('should return false for other values', function() {
+ expect(comparator.supports(new EqualsContext(true, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(123, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext('foo', null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(function foo() {}, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(/foo/, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
+ })
+ })
+})
diff --git a/test/equals/comparators/number-comparator.spec.js b/test/equals/comparators/number-comparator.spec.js
index 169ac7f..8b16f35 100644
--- a/test/equals/comparators/number-comparator.spec.js
+++ b/test/equals/comparators/number-comparator.spec.js
@@ -88,6 +88,8 @@ describe('equals/comparators/number-comparator:NumberEqualsComparator', function
expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
})
})
})
diff --git a/test/equals/comparators/object-comparator.spec.js b/test/equals/comparators/object-comparator.spec.js
index 6fac751..fc8ce4e 100644
--- a/test/equals/comparators/object-comparator.spec.js
+++ b/test/equals/comparators/object-comparator.spec.js
@@ -134,4 +134,3 @@ describe('equals/comparators/object-comparator:ObjectEqualsComparator', function
})
})
})
-
diff --git a/test/equals/comparators/set-comparator.spec.js b/test/equals/comparators/set-comparator.spec.js
new file mode 100644
index 0000000..9c0a259
--- /dev/null
+++ b/test/equals/comparators/set-comparator.spec.js
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var expect = require('chai').expect
+
+var CollectionEqualsComparator = require('../../../src/equals/comparators/collection-comparator')
+var equals = require('../../../src/equals/index')
+var EqualsContext = require('../../../src/equals/context')
+var SetEqualsComparator = require('../../../src/equals/comparators/set-comparator')
+
+describe('equals/comparators/set-comparator:SetEqualsComparator', function() {
+ var comparator
+
+ before(function() {
+ comparator = new SetEqualsComparator()
+ })
+
+ it('should be a CollectionEqualsComparator', function() {
+ expect(comparator).to.be.an.instanceof(CollectionEqualsComparator)
+ })
+
+ describe('#compare', function() {
+ context('when set values are equal', function() {
+ it('should return true', function() {
+ expect(comparator.compare(new EqualsContext(new Set(), new Set(), equals))).to.be.true
+ expect(comparator.compare(new EqualsContext(new Set([ 'foo', 'bar', 123 ]), new Set([ 'foo', 'bar', 123 ]),
+ equals))).to.be.true
+ })
+ })
+
+ context('when set values are not equal', function() {
+ it('should return false', function() {
+ expect(comparator.compare(new EqualsContext(new Set(), new Set([ 'foo', 'bar', 123 ]), equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Set([ 'foo', 'bar', 123 ]), new Set([ 'fu', 'baz', 321 ]),
+ equals))).to.be.false
+ expect(comparator.compare(new EqualsContext(new Set([ 'foo', 'bar', 123 ]), new Set([ 123, 'bar', 'foo' ]),
+ equals))).to.be.false
+ })
+ })
+ })
+
+ describe('#supports', function() {
+ it('should return true for set values', function() {
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.true
+ })
+
+ it('should return false for other values', function() {
+ expect(comparator.supports(new EqualsContext(true, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(123, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext('foo', null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(function foo() {}, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(/foo/, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ })
+ })
+})
diff --git a/test/equals/comparators/string-comparator.spec.js b/test/equals/comparators/string-comparator.spec.js
index 1dd7ca2..238028a 100644
--- a/test/equals/comparators/string-comparator.spec.js
+++ b/test/equals/comparators/string-comparator.spec.js
@@ -85,6 +85,8 @@ describe('equals/comparators/string-comparator:StringEqualsComparator', function
expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
})
})
})
diff --git a/test/equals/comparators/to-string-comparator.spec.js b/test/equals/comparators/to-string-comparator.spec.js
index d27f4cc..5909237 100644
--- a/test/equals/comparators/to-string-comparator.spec.js
+++ b/test/equals/comparators/to-string-comparator.spec.js
@@ -101,6 +101,8 @@ describe('equals/comparators/to-string-comparator:ToStringEqualsComparator', fun
expect(comparator.supports(new EqualsContext(new Date(), null, equals))).to.be.false
expect(comparator.supports(new EqualsContext([ 'foo', 'bar' ], null, equals))).to.be.false
expect(comparator.supports(new EqualsContext({ foo: 'bar' }, null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Map(), null, equals))).to.be.false
+ expect(comparator.supports(new EqualsContext(new Set(), null, equals))).to.be.false
})
})
})
diff --git a/test/hash-code/generators/array-generator.spec.js b/test/hash-code/generators/array-generator.spec.js
index 02585da..1462dd0 100644
--- a/test/hash-code/generators/array-generator.spec.js
+++ b/test/hash-code/generators/array-generator.spec.js
@@ -44,12 +44,22 @@ describe('hash-code/generators/array-generator:ArrayHashCodeGenerator', function
it('should generate hash code for array values', function() {
expect(generator.generate(new HashCodeContext([], hashCode))).to.equal(1)
expect(generator.generate(new HashCodeContext([ 'foo', 123 ], hashCode))).to.equal(3198445)
+ expect(generator.generate(new HashCodeContext(new Int8Array([ 123, 321 ]), hashCode))).to.equal(1512078)
})
})
describe('#supports', function() {
it('should return true for array values', function() {
expect(generator.supports(new HashCodeContext([], hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Int8Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Uint8Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Uint8ClampedArray(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Int16Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Uint16Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Int32Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Uint32Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Float32Array(), hashCode))).to.be.true
+ expect(generator.supports(new HashCodeContext(new Float64Array(), hashCode))).to.be.true
})
it('should return false for other values', function() {
@@ -60,6 +70,8 @@ describe('hash-code/generators/array-generator:ArrayHashCodeGenerator', function
expect(generator.supports(new HashCodeContext(/foo/, hashCode))).to.be.false
expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
})
})
})
diff --git a/test/hash-code/generators/boolean-generator.spec.js b/test/hash-code/generators/boolean-generator.spec.js
index 351ed43..334ebbc 100644
--- a/test/hash-code/generators/boolean-generator.spec.js
+++ b/test/hash-code/generators/boolean-generator.spec.js
@@ -61,6 +61,8 @@ describe('hash-code/generators/boolean-generator:BooleanHashCodeGenerator', func
expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
})
})
})
diff --git a/test/hash-code/generators/date-generator.spec.js b/test/hash-code/generators/date-generator.spec.js
index e36b590..553a56d 100644
--- a/test/hash-code/generators/date-generator.spec.js
+++ b/test/hash-code/generators/date-generator.spec.js
@@ -65,6 +65,8 @@ describe('hash-code/generators/date-generator:DateHashCodeGenerator', function()
expect(generator.supports(new HashCodeContext(/foo/, hashCode))).to.be.false
expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
})
})
})
diff --git a/test/hash-code/generators/index.spec.js b/test/hash-code/generators/index.spec.js
index 38f4f98..008a119 100644
--- a/test/hash-code/generators/index.spec.js
+++ b/test/hash-code/generators/index.spec.js
@@ -32,7 +32,9 @@ var DateHashCodeGenerator = require('../../../src/hash-code/generators/date-gene
var HashCodeGenerator = require('../../../src/hash-code/generators/generator')
var generators = require('../../../src/hash-code/generators')
var HashHashCodeGenerator = require('../../../src/hash-code/generators/hash-generator')
+var MapHashCodeGenerator = require('../../../src/hash-code/generators/map-generator')
var ObjectHashCodeGenerator = require('../../../src/hash-code/generators/object-generator')
+var SetHashCodeGenerator = require('../../../src/hash-code/generators/set-generator')
var StringHashCodeGenerator = require('../../../src/hash-code/generators/string-generator')
var ToStringHashCodeGenerator = require('../../../src/hash-code/generators/to-string-generator')
@@ -46,7 +48,9 @@ describe('hash-code/generators/index', function() {
DateHashCodeGenerator: DateHashCodeGenerator,
HashCodeGenerator: HashCodeGenerator,
HashHashCodeGenerator: HashHashCodeGenerator,
+ MapHashCodeGenerator: MapHashCodeGenerator,
ObjectHashCodeGenerator: ObjectHashCodeGenerator,
+ SetHashCodeGenerator: SetHashCodeGenerator,
StringHashCodeGenerator: StringHashCodeGenerator,
ToStringHashCodeGenerator: ToStringHashCodeGenerator
})
diff --git a/test/hash-code/generators/map-generator.spec.js b/test/hash-code/generators/map-generator.spec.js
new file mode 100644
index 0000000..a21d698
--- /dev/null
+++ b/test/hash-code/generators/map-generator.spec.js
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var expect = require('chai').expect
+
+var hashCode = require('../../../src/hash-code/index')
+var HashCodeContext = require('../../../src/hash-code/context')
+var HashHashCodeGenerator = require('../../../src/hash-code/generators/hash-generator')
+var MapHashCodeGenerator = require('../../../src/hash-code/generators/map-generator')
+
+describe('hash-code/generators/map-generator:MapHashCodeGenerator', function() {
+ var generator
+
+ before(function() {
+ generator = new MapHashCodeGenerator()
+ })
+
+ it('should be a HashHashCodeGenerator', function() {
+ expect(generator).to.be.an.instanceof(HashHashCodeGenerator)
+ })
+
+ describe('#generate', function() {
+ it('should generate hash code for map values', function() {
+ expect(generator.generate(new HashCodeContext(new Map(), hashCode))).to.equal(0)
+ expect(generator.generate(new HashCodeContext(new Map([
+ [ 'foo', 'bar' ],
+ [ 'fu', 'baz' ]
+ ]), hashCode))).to.equal(156073)
+ })
+ })
+
+ describe('#supports', function() {
+ it('should return true for map values', function() {
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.true
+ })
+
+ it('should return false for other values', function() {
+ expect(generator.supports(new HashCodeContext(true, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(123, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext('foo', hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(function foo() {}, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(/foo/, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
+ })
+ })
+})
diff --git a/test/hash-code/generators/set-generator.spec.js b/test/hash-code/generators/set-generator.spec.js
new file mode 100644
index 0000000..300f09f
--- /dev/null
+++ b/test/hash-code/generators/set-generator.spec.js
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var expect = require('chai').expect
+
+var CollectionHashCodeGenerator = require('../../../src/hash-code/generators/collection-generator')
+var hashCode = require('../../../src/hash-code/index')
+var HashCodeContext = require('../../../src/hash-code/context')
+var SetHashCodeGenerator = require('../../../src/hash-code/generators/set-generator')
+
+describe('hash-code/generators/set-generator:SetHashCodeGenerator', function() {
+ var generator
+
+ before(function() {
+ generator = new SetHashCodeGenerator()
+ })
+
+ it('should be a CollectionHashCodeGenerator', function() {
+ expect(generator).to.be.an.instanceof(CollectionHashCodeGenerator)
+ })
+
+ describe('#generate', function() {
+ it('should generate hash code for set values', function() {
+ expect(generator.generate(new HashCodeContext(new Set(), hashCode))).to.equal(1)
+ expect(generator.generate(new HashCodeContext(new Set([ 'foo', 123 ]), hashCode))).to.equal(3198445)
+ })
+ })
+
+ describe('#supports', function() {
+ it('should return true for set values', function() {
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.true
+ })
+
+ it('should return false for other values', function() {
+ expect(generator.supports(new HashCodeContext(true, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(123, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext('foo', hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(function foo() {}, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(/foo/, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ })
+ })
+})
diff --git a/test/hash-code/generators/string-generator.spec.js b/test/hash-code/generators/string-generator.spec.js
index 0da86b5..f646df1 100644
--- a/test/hash-code/generators/string-generator.spec.js
+++ b/test/hash-code/generators/string-generator.spec.js
@@ -64,6 +64,8 @@ describe('hash-code/generators/string-generator:StringHashCodeGenerator', functi
expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
})
})
})
diff --git a/test/hash-code/generators/to-string-generator.spec.js b/test/hash-code/generators/to-string-generator.spec.js
index 50d9704..1a3da0a 100644
--- a/test/hash-code/generators/to-string-generator.spec.js
+++ b/test/hash-code/generators/to-string-generator.spec.js
@@ -90,6 +90,8 @@ describe('hash-code/generators/to-string-generator:ToStringHashCodeGenerator', f
expect(generator.supports(new HashCodeContext(new Date(), hashCode))).to.be.false
expect(generator.supports(new HashCodeContext([ 'foo', 'bar' ], hashCode))).to.be.false
expect(generator.supports(new HashCodeContext({ foo: 'bar' }, hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Map(), hashCode))).to.be.false
+ expect(generator.supports(new HashCodeContext(new Set(), hashCode))).to.be.false
})
})
})
diff --git a/test/util/arrays.spec.js b/test/util/arrays.spec.js
new file mode 100644
index 0000000..69d5fa7
--- /dev/null
+++ b/test/util/arrays.spec.js
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017 Alasdair Mercer, Skelp
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+'use strict'
+
+var expect = require('chai').expect
+
+var arrays = require('../../src/util/arrays')
+
+describe('util/util/arrays', function() {
+ describe('.typeStrings', function() {
+ it('should contain all array type strings', function() {
+ expect(arrays.typeStrings).to.deep.equal([
+ '[object Array]',
+ '[object Int8Array]',
+ '[object Uint8Array]',
+ '[object Uint8ClampedArray]',
+ '[object Int16Array]',
+ '[object Uint16Array]',
+ '[object Int32Array]',
+ '[object Uint32Array]',
+ '[object Float32Array]',
+ '[object Float64Array]'
+ ])
+ })
+ })
+})