Tabnine Logo For Javascript
LoDashStatic.repeat
Code IndexAdd Tabnine to your IDE (free)

How to use
repeat
function
in
LoDashStatic

Best JavaScript code snippets using lodash.LoDashStatic.repeat(Showing top 15 results out of 315)

origin: FormidableLabs/nodejs-dashboard

const getFormattedContent = function (prev, details) {
  prev += `{cyan-fg}{bold}${details.label}{/}${
   _.repeat(" ", longestLabel - details.label.length + 1)
  }{green-fg}${details.data}{/}\n`;
  return prev;
 }
origin: NiXXeD/adventofcode

_.remove(todoHashes, todo => {
      if (todo.index + 1000 < index) {
        return true
      }
      if (hash.includes(_.repeat(todo.char, 5))) {
        validHashes.push(todo.index)
        return true
      }
      return false
    })
origin: sqmk/chump

describe('get/set urlTitle', () => {
  it('should set urlTitle', () => {
   let urlTitle          = 'Test URL title';
   this.message.urlTitle = urlTitle;

   expect(this.message.urlTitle).to.equal(urlTitle);
  });

  it('should throw exception on invalid value', () => {
   expect(() => {
    this.message.urlTitle = _.repeat('*', 51);
   }).to.throw(Error);
  });
 });
origin: gaccettola/mortis

function print_script ( script )
  {
    console.log ( chalk.white ( _.repeat ( '-', 88 ) ) );

    var script_header = sprintf ( "-- %s :: %s",
      _.padEnd ( script.alias + '[' + script.index + ']', 40 ),
      script.route
    );

    console.log ( script_header );

    console.log ( _.trim ( script.script ) );
  }
origin: merklejerk/flex-contract

before(async function() {
    accounts = _.times(16, () => ({
      secretKey: crypto.randomBytes(32),
      balance: 100 + _.repeat('0', 18)
    }));
    provider = ganache.provider({
      accounts: accounts,
    });
    // Suppress max listener warnings.
    provider.setMaxListeners(4096);
    provider.engine.setMaxListeners(4096);
  });
origin: node-diameter/node-diameter

var avpsToString = function(avps, indent) {
  var indentString = _.repeat(' ', indent);
  return _.reduce(avps, function(out, avp) {
    out += indentString + chalk.cyan(avp[0]) + ': ';
    if (avp[1] instanceof Array) {
      out += '\n' + avpsToString(avp[1], indent + 2);
    } else {
      if (_.isString(avp[1])) {
        out += '"' + avp[1] + '"';
      } else if (Buffer.isBuffer(avp[1])) {
        out += '0x' + avp[1].toString('hex');
      } else {
        out += avp[1];
      }
      out += '\n';
    }
    return out;
  }, '');
}
origin: wxs77577/adonis-rest

const option = {
 value: item[lhs],
 text: _.repeat(' ', level) + item[rhs]
origin: APIDevTools/swagger-express-middleware

it("should support very large strings", (done) => {
      _.find(api.paths["/pets"][method].parameters, { name: "PetData" }).schema = { type: "string" };
      api.paths["/pets"][method].responses[201].schema = { type: "string" };
      api.paths["/pets/{PetName}"].get.responses[200].schema = { type: "string" };
      api.paths["/pets"][method].consumes = ["text/plain"];
      api.paths["/pets"][method].produces = ["text/plain"];
      api.paths["/pets/{PetName}"].get.produces = ["text/plain"];
      helper.initTest(api, (supertest) => {
       let veryLongString = _.repeat("abcdefghijklmnopqrstuvwxyz", 5000);

       supertest[method]("/api/pets")
        .set("Content-Type", "text/plain")
        .send(veryLongString)

       // The full value should be returned
        .expect(201, veryLongString)

       // The resource URL should be truncated to 2000 characters, for compatibility with some browsers
        .expect("Location", "/api/pets/" + veryLongString.substring(0, 2000))
        .end(helper.checkResults(done, (res) => {

         // Verify that the full value was stored
         supertest
          .get(res.headers.location)
          .expect(200, veryLongString)
          .end(helper.checkResults(done));
        }));
      });
     });
origin: masumsoft/express-cassandra

buildTableQueryForDataRow(keyspace, tableInfo, row) {
  row = _.omitBy(row, (item) => (item === null));
  let query = util.format('INSERT INTO "%s"."%s" ("%s") VALUES (?%s)', keyspace, tableInfo.name, _.keys(row).join('","'), _.repeat(',?', _.keys(row).length - 1));
  let params = _.values(row);
  if (tableInfo.isCounterTable) {
   const primaryKeyFields = _.pick(row, tableInfo.primaryKeys);
   const otherKeyFields = _.omit(row, tableInfo.primaryKeys);
   const setQueries = _.map(_.keys(otherKeyFields), (key) => util.format('"%s"="%s" + ?', key, key));
   const whereQueries = _.map(_.keys(primaryKeyFields), (key) => util.format('"%s"=?', key));
   query = util.format('UPDATE "%s"."%s" SET %s WHERE %s', keyspace, tableInfo.name, setQueries.join(', '), whereQueries.join(' AND '));
   params = _.values(otherKeyFields).concat(_.values(primaryKeyFields));
  }
  params = _.map(params, (param) => {
   if (_.isPlainObject(param)) {
    if (param.type === 'Buffer') {
     return Buffer.from(param);
    }
    const omittedParams = _.omitBy(param, (item) => (item === null));
    Object.keys(omittedParams).forEach((key) => {
     if (_.isObject(omittedParams[key]) && omittedParams[key].type === 'Buffer') {
      omittedParams[key] = Buffer.from(omittedParams[key]);
     }
    });
    return omittedParams;
   }
   return param;
  });
  return { query, params };
 }
origin: gaccettola/mortis

console.log ( chalk.red ( _.repeat ( '-', 88 ) ) );
console.log ( chalk.red ( 'query complete, with error - ', err_query ) );
console.log ( chalk.red ( '', query_script ) );
console.log ( chalk.red ( _.repeat ( '-', 88 ) ) );
origin: cryptocurs/hidecoin

log(data) {
  let dataToWrite = ''
  let level = 0
  
  const toStr = (d) => {
   level++
   if (typeof d === 'object') {
    if (d instanceof Buffer) {
     dataToWrite += '(buffer)' + d.toString('hex') + '\n'
    } else {
     const isArray = d instanceof Array
     dataToWrite += (isArray ? '[\n' : '{\n')
     for (let i in d) {
      const isArray = d instanceof Array
      dataToWrite += _.repeat(tab, level) + '"' + i + '": '
      toStr(d[i])
     }
     dataToWrite += _.repeat(tab, level - 1) + (isArray ? ']' : '}') + '\n'
    }
   } else {
    dataToWrite += '(' + typeof d + ')' + d + '\n'
   }
   level--
  }
  
  toStr(data)
  fs.appendFileSync(path, dataToWrite)
 }
origin: NiXXeD/adventofcode

_.remove(todoHashes, todo => {
      if (todo.index + 1000 < index) {
        return true
      }
      if (hash.includes(_.repeat(todo.char, 5))) {
        validHashes.push(todo.index)
        fs.writeFileSync('./2016/day14/cache.json', JSON.stringify(validHashes))
        return true
      }
      return false
    })
origin: sqmk/chump

describe('get/set title', () => {
  it('should set title', () => {
   let title          = 'Test title';
   this.message.title = title;

   expect(this.message.title).to.equal(title);
  });

  it('should throw exception on invalid value', () => {
   expect(() => {
    this.message.title = _.repeat('*', 101);
   }).to.throw(Error);
  });
 });
origin: sqmk/chump

describe('get/set url', () => {
  it('should set url', () => {
   let url          = 'Test URL';
   this.message.url = url;

   expect(this.message.url).to.equal(url);
  });

  it('should throw exception on invalid value', () => {
   expect(() => {
    this.message.url = _.repeat('*', 501);
   }).to.throw(Error);
  });
 });
origin: masumsoft/express-cassandra

 return item === null;
});
var query = util.format('INSERT INTO "%s"."%s" ("%s") VALUES (?%s)', keyspace, tableInfo.name, _.keys(row).join('","'), _.repeat(',?', _.keys(row).length - 1));
var params = _.values(row);
if (tableInfo.isCounterTable) {
lodash(npm)LoDashStaticrepeat

JSDoc

Repeats the given string n times.

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • colors
    get colors in your node.js console
  • body-parser
    Node.js body parsing middleware
  • semver
    The semantic version parser used by npm.
  • express
    Fast, unopinionated, minimalist web framework
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now