UNPKG

liquid-node

Version:

Node.js port of Tobias Lütke's Liquid template engine.

32 lines (23 loc) 1.07 kB
// Generated by CoffeeScript 1.10.0 (function() { var Decrement, Liquid, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; Liquid = require("../../liquid"); module.exports = Decrement = (function(superClass) { extend(Decrement, superClass); function Decrement(template, tagName, markup) { this.variable = markup.trim(); Decrement.__super__.constructor.apply(this, arguments); } Decrement.prototype.render = function(context) { var base, name, value; value = (base = context.environments[0])[name = this.variable] || (base[name] = 0); value = value - 1; context.environments[0][this.variable] = value; return value.toString(); }; return Decrement; })(Liquid.Tag); }).call(this); //# sourceMappingURL=decrement.js.map