syndicate-2017/js/src/seal.js

19 lines
392 B
JavaScript
Raw Permalink Normal View History

2016-02-06 20:06:59 +00:00
var Immutable = require('immutable');
2016-02-06 12:42:16 +00:00
function Seal(contents) {
this.sealContents = contents;
2016-02-06 20:06:59 +00:00
Object.freeze(this);
2016-02-06 12:42:16 +00:00
}
Seal.prototype.equals = function (other) {
if (!(other instanceof Seal)) return false;
return Immutable.is(this.sealContents, other.sealContents);
};
2016-02-06 20:06:59 +00:00
function seal(contents) {
return new Seal(contents);
}
2016-02-06 12:42:16 +00:00
module.exports.Seal = Seal;
2016-02-06 20:06:59 +00:00
module.exports.seal = seal;