tasks/faker.js
function executeFunctionByName(functionName, args) {
    var namespaces = functionName.split(".");
    var nsLength = namespaces.length;
    var context = Faker;
    var parentContext = Faker;

    if (namespaces[0].toLowerCase() === 'definitions'){
      grunt.log.warn('The definitions module from Faker.js is not avail in this task.');
      return;
    }

    for(var i = 0; i < nsLength; i++) {
      context = context[namespaces[i]];
    }

    for(var j = 0; j < nsLength - 1; j++) {
      parentContext = parentContext[namespaces[j]];
    }

    return context.apply(parentContext, args);
  }
function executeFunctionByName(functionName, args) {
    var namespaces = functionName.split(".");
    var nsLength = namespaces.length;
    var context = Faker;
    var parentContext = Faker;

    if (namespaces[0].toLowerCase() === 'definitions'){
      grunt.log.warn('The definitions module from Faker.js is not avail in this task.');
      return;
    }

    for(var i = 0; i < nsLength; i++) {
      context = context[namespaces[i]];
    }

    for(var j = 0; j < nsLength - 1; j++) {
      parentContext = parentContext[namespaces[j]];
    }

    return context.apply(parentContext, args);
  }
function executeFunctionByName ( functionName , args ) { var namespaces = functionName . split ( "." ) ; var nsLength = namespaces . length ; var context = Faker ; var parentContext = Faker ; if ( namespaces [ 0 ] . toLowerCase ( ) === 'definitions' ) { grunt . log . warn ( 'The definitions module from Faker.js is not avail in this task.' ) ; return ; } for ( var i = 0 ; i < nsLength ; i ++ ) { context = context [ namespaces [ i ] ] ; } for ( var j = 0 ; j < nsLength - 1 ; j ++ ) { parentContext = parentContext [ namespaces [ j ] ] ; } return context . apply ( parentContext , args ) ; }
Execute function as string
Execute function as string