Sha256: 6715518645a134d270df9f1100aed736acebdcb5f69c05f88b36117f6a99f348
Contents?: true
Size: 1003 Bytes
Versions: 19
Compression:
Stored size: 1003 Bytes
Contents
/** * class SafetyColons * * For JS developers who are colonfobic, concatenating JS files using * the module pattern usually leads to syntax errors. * * The `SafetyColons` processor will insert missing semicolons to the * end of the file. * * This behavior can be disabled with: * * environment.unregisterPostProcessor('application/javascript', SafetyColons); * * * ##### SUBCLASS OF * * [[Template]] **/ 'use strict'; // internal var Template = require('../template'); //////////////////////////////////////////////////////////////////////////////// // Class constructor var SafetyColons = module.exports = function SafetyColons() { Template.apply(this, arguments); }; require('util').inherits(SafetyColons, Template); // Process data SafetyColons.prototype.evaluate = function (/*context, locals*/) { var data = (this.data || '').trimRight().trimLeft(); if (';' !== data[data.length - 1]) { this.data = data + '\n;\n'; } return this.data; };
Version data entries
19 entries across 19 versions & 1 rubygems