| 1 2 3 4 5 6 7 8 9 10 11 12 | 1× 1× 7× 6× 1× 1× | /**
*Author: Iván Israel Sabido Cortés
**/
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);
}
|