thelounge/client/js/libs/handlebars/equal.js

17 lines
269 B
JavaScript
Raw Normal View History

"use strict";
2016-12-18 16:53:28 +01:00
module.exports = function(a, b, opt) {
if (arguments.length !== 3) {
throw new Error("Handlebars helper `equal` expects 3 arguments");
}
2016-12-18 16:53:28 +01:00
a = a.toString();
b = b.toString();
2016-12-18 16:53:28 +01:00
if (a === b) {
return opt.fn(this);
2014-07-20 21:49:44 +02:00
}
2016-12-18 16:53:28 +01:00
return opt.inverse(this);
};