all files / lib/ mapping.js

100% Statements 6/6
100% Branches 7/7
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15              1× 1× 7× 6× 1× 1×    
/**
*Author: Iván Israel Sabido Cortés
*Fecha: 19/07/2016
*Prueba para intelisis
**/
 
 
var _ = require('underscore');
exports.Mapping = function (map, scope){
  if(_.isUndefined(map) || _.isUndefined(scope) || _.isNull(map) || _.isNull(scope) || _.isUndefined(scope.data))
    return null;
    var mapFunction = new Function('map', 'data', 'return eval("("+map+")")');
    return mapFunction(map, scope.data);
}