Code coverage report for lib/parser/index.js

Statements: 93.33% (14 / 15)      Branches: 83.33% (5 / 6)      Functions: 50% (1 / 2)      Lines: 93.33% (14 / 15)      Ignored: 2 statements, 1 branch     

All files » lib/parser/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421 1 1         1                         12   12 1     11 11     11   11         1 1 1    
var parser  = require("./parser");
var scripts = {};
var parse;
 
/**
 */
 
module.exports = {
 
  /**
   */
 
  parse: parse = function(html) {
    return "\"use strict\";module.exports = " + parser.parse(html).toJavaScript();
  },
 
  /**
   */
 
  compile: function(nameOrContent) {
    var content;
 
    if (scripts[nameOrContent]) {
      return scripts[nameOrContent];
    }
 
    Eif (!content) {
      content = nameOrContent;
    }
 
    var source = "\"use strict\";return " + parser.parse(content).toJavaScript();
 
    return (scripts[nameOrContent] = new Function(source)());
  }
};
 
/* istanbul ignore if */
Iif (global.paperclip) {
  global.paperclip.parse           = module.exports.parse;
  global.paperclip.template.parser = module.exports;
}