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

How to use
toNumber
function
in
LoDashStatic

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

origin: formio/formio

.replace(/\.\./g, '.')
.split('.')
.map(part => _.defaultTo(_.toNumber(part), part));
origin: swestmoreland/scormcloud-api-wrapper

var getCourseAttributeValue = function (name, value) {

  switch (_.get(COURSE_ATTRIBUTES, name)) {
    case "boolean":
      return _.lowerCase(value) === 'true' ? true : false;
    case "number":
      return _.toNumber(value);
    case "integer":
      return _.toInteger(value);
    // Value is a string by default.
    default:
      return value;
  }

}
origin: mariobermudezjr/ecommerce-react-graphql-stripe

role.permissions.reduce((acc, permission) => {
   _.set(acc, `${permission.type}.controllers.${permission.controller}.${permission.action}`, {
    enabled: _.toNumber(permission.enabled) == true,
    policy: permission.policy
   });

   if (permission.type !== 'application' && !acc[permission.type].information) {
    acc[permission.type].information = plugins.find(plugin => plugin.id === permission.type) || {};
   }

   return acc;
  }, {})
origin: matthew1000/node-snowmix

/**
   * Returns commands to delete matching lines of a command
   * @private
   */
  getCommandsToDeleteLinesThatMatch(regexp, commandName, offset) {
    if (!offset) offset = 0
    return this.getLinesThatMatch(regexp, commandName)
    .then(matching => {
      let lineNumbers = Object.keys(matching).map(_.toNumber)

      // Delete in reverse order, otherwise they all shuffle down!
      let deleteCommands = lineNumbers.sort((a,b)=>b-a)
      .map(n => { return `command deleteline ${commandName} ${n+offset}` })
      return deleteCommands
    })
  }
origin: me-io/node-currency-swap

self.fetchContent(url, function (err, content) {
  if (err) {
   return callback(err, null);
  }

  // Parse the content fetch from google finance
  var bid = self.parseContent(content);

  if (_.isNull(bid) || _.isUndefined(bid) || bid.length === 0) {
   return callback(new UnsupportedCurrencyPairException(currencyPair, Provider), null);
  }

  // split the fetched rate to remove currency symbol and verify if its number
  var parts = _.split(bid, ' ');
  if (parts.length == 0 || !_.toNumber(parts[0])) {
   return callback(new UnsupportedCurrencyPairException(currencyPair, Provider), null);
  }

  return callback(null, new Rate(parts[0], new Date(), Provider));
 });
origin: qrvey/qrveydrsample-csv

//Transform CSV data
function transformCSVRowFromMetadata(row, numericCols) {
 var val;
 _.forEach(numericCols, function (col) {
  if (!_.isNull(row[col])) row[col] = _.toNumber(row[col]);
  else row[col] = null;
 });

 return row;
}
origin: mariobermudezjr/ecommerce-react-graphql-stripe

this.query(function(qb) {
   _.forEach(params.where, (where, key) => {
    if (_.isArray(where.value) && where.symbol !== 'IN' && where.symbol !== 'NOT IN') {
     for (const value in where.value) {
      qb[parseInt(value) ? 'orWhere' : 'where'](key, where.symbol, where.value[value]);
     }
    } else {
     qb.where(key, where.symbol, where.value);
    }
   });

   if (params.sort) {
    qb.orderBy(params.sort.key, params.sort.order);
   }

   if (params.skip) {
    qb.offset(_.toNumber(params.skip));
   }

   if (params.limit) {
    qb.limit(_.toNumber(params.limit));
   }
  }).fetchAll({
   withRelated: populate || this.associations.map(x => x.alias)
  }).then(data => raw ? data.toJSON() : data)
origin: mariobermudezjr/ecommerce-react-graphql-stripe

Object.keys(this.attributes).reduce((acc, curr) => {
   switch (this.attributes[curr].type) {
    case 'integer':
    case 'float':
    case 'decimal':
     if (!_.isNaN(_.toNumber(params.search))) {
      return acc.concat({ [curr]: params.search });
     }

     return acc;
    case 'string':
    case 'text':
    case 'password':
     return acc.concat({ [curr]: { $regex: params.search, $options: 'i' } });
    case 'boolean':
     if (params.search === 'true' || params.search === 'false') {
      return acc.concat({ [curr]: params.search === 'true' });
     }

     return acc;
    default:
     return acc;
   }
  }, [])
origin: kazaff/mosquito-coil-dog

_.filter(input.products, function(item){
              return _.toNumber(_.trim(item.price, '¥')) > 200;
            })
origin: pterodactyl/daemon

  newValue = this.getReplacement(value);
} else { newValue = value; }
if (!_.isBoolean(newValue) && !_.isNaN(_.toNumber(newValue))) {
  newValue = _.toNumber(newValue);
origin: mariobermudezjr/ecommerce-react-graphql-stripe

});
if (!_.isNaN(_.toNumber(query))) {
 searchInt.forEach(attribute => {
  qb.orWhereRaw(`${attribute} = ${_.toNumber(query)}`);
 });
  qb.orWhereRaw(`${attribute} = ${_.toNumber(query === 'true')}`);
 });
origin: matthew1000/node-snowmix

width: parseInt(mainMatch[5]),
height: parseInt(mainMatch[6]),
rotation: _.toNumber(mainMatch[7]),
alpha: _.toNumber(mainMatch[8]),
anchorX: parseInt(mainMatch[9]),
anchorY: parseInt(mainMatch[10]),
origin: matthew1000/node-snowmix

/**
   * Returns an object defining what the Show command is showing
   * @return {Promise}
   */
  showing() {
    return this.list('Show')
    .then(arrayOfLines => {
      if (!arrayOfLines) return // means no Show command yet
      let showingItems = {
        text: [],
        image: [],
        vfeed: []
      }
      arrayOfLines.forEach(l => {
        if (!l) return
        let match = l.match(/^(text|image|vfeed) overlay\s*(.+)$/)
        if (match) {
          let type = match[1]
          let ids = match[2].split(' ').map(_.toNumber)
          showingItems[type] = showingItems[type].concat(ids)
        }
      })

      return showingItems
    })
  }
origin: mariobermudezjr/ecommerce-react-graphql-stripe

});
if (!_.isNaN(_.toNumber(query))) {
 searchInt.forEach(attribute => {
  qb.orWhereRaw(`${attribute} = ${_.toNumber(query)}`);
 });
  qb.orWhereRaw(`${attribute} = ${_.toNumber(query === 'true')}`);
 });
 qb.offset(_.toNumber(filters.skip));
 qb.limit(_.toNumber(filters.limit));
origin: mariobermudezjr/ecommerce-react-graphql-stripe

Object.keys(this.attributes).reduce((acc, curr) => {
   switch (this.attributes[curr].type) {
    case 'integer':
    case 'float':
    case 'decimal':
     if (!_.isNaN(_.toNumber(params.search))) {
      return acc.concat({ [curr]: params.search });
     }

     return acc;
    case 'string':
    case 'text':
    case 'password':
     return acc.concat({ [curr]: { $regex: params.search, $options: 'i' } });
    case 'boolean':
     if (params.search === 'true' || params.search === 'false') {
      return acc.concat({ [curr]: params.search === 'true' });
     }

     return acc;
    default:
     return acc;
   }
  }, [])
lodash(npm)LoDashStatictoNumber

JSDoc

Converts `value` to a number.

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

  • chalk
    Terminal string styling done right
  • axios
    Promise based HTTP client for the browser and node.js
  • moment
    Parse, validate, manipulate, and display dates
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • minimatch
    a glob matcher in javascript
  • semver
    The semantic version parser used by npm.
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • aws-sdk
    AWS SDK for JavaScript
  • CodeWhisperer alternatives
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