npmtest-vue-loader (v0.0.2)

Code coverage report for node-npmtest-vue-loader/node_modules/vue-loader/lib/component-normalizer.js

Statements: 4.76% (1 / 21)      Branches: 0% (0 / 16)      Functions: 0% (0 / 3)      Lines: 5% (1 / 20)      Ignored: none     

All files » node-npmtest-vue-loader/node_modules/vue-loader/lib/ » component-normalizer.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 42 43 44 45 46 47 48 49 50 51 52 53      1                                                                                                  
// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle
 
module.exports = function normalizeComponent (
  rawScriptExports,
  compiledTemplate,
  scopeId,
  cssModules
) {
  var esModule
  var scriptExports = rawScriptExports = rawScriptExports || {}
 
  // ES6 modules interop
  var type = typeof rawScriptExports.default
  if (type === 'object' || type === 'function') {
    esModule = rawScriptExports
    scriptExports = rawScriptExports.default
  }
 
  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports
 
  // render functions
  if (compiledTemplate) {
    options.render = compiledTemplate.render
    options.staticRenderFns = compiledTemplate.staticRenderFns
  }
 
  // scopedId
  if (scopeId) {
    options._scopeId = scopeId
  }
 
  // inject cssModules
  if (cssModules) {
    var computed = Object.create(options.computed || null)
    Object.keys(cssModules).forEach(function (key) {
      var module = cssModules[key]
      computed[key] = function () { return module }
    })
    options.computed = computed
  }
 
  return {
    esModule: esModule,
    exports: scriptExports,
    options: options
  }
}