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

How to use
trim
function
in
LoDashStatic

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

origin: lando/lando

/*
  * Post our key
  */
 postKey(key) {
  const postKey = ['users', _.get(this.session, 'user_id'), 'keys'];
  const options = (this.mode === 'node') ? {headers: {'User-Agent': 'Terminus/Lando'}} : {};
  const data = _.trim(fs.readFileSync(key, 'utf8'));
  return pantheonRequest(this.request, this.log, 'post', postKey, JSON.stringify(data), options);
 }
origin: lando/lando

compose('getId', data).then(id => {
   if (!_.isEmpty(id)) {
    // @todo: this assumes that the container we want
    // is probably the first id returned. What happens if that is
    // not true or we need other ids for this service?
    const ids = id.split('\n');
    return docker.scan(_.trim(ids.shift()));
   }
  })
origin: lando/lando

// Helper to get sites for autocomplete
const getAutoCompleteSites = (answers, lando, input = null) => {
 const api = new PlatformshApiClient({api_token: _.trim(answers['platformsh-auth'])});
 if (!_.isEmpty(platformshSites)) {
  return lando.Promise.resolve(platformshSites).filter(site => _.startsWith(site.name, input));
 } else {
  return api.getAccountInfo().then(me => {
   platformshSites = _.map(me.projects, project => ({name: project.title, value: project.name}));
   return platformshSites;
  })
  .catch(err => lando.Promise.reject(Error(err.error_description)));
 }
}
origin: lando/lando

shell.sh(['git', 'describe', '--tags', '--always', '--abbrev=1'], {mode: 'collect'})

// Trim the tag
.then(data => _.trim(data.slice(1)))

// Replace the version for our files
.then(version => {
 const packageJson = require('./../package.json');
 packageJson.version = version;
 log.info('Updating package.json to dev version %s', packageJson.version);
 fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
})

// Catch errors and do stuff so we can break builds when this fails
.catch(error => {
 log.error(error);
 process.exit(error.code || 555);
})
origin: lando/lando

// Helper to post a github ssh key
const postKey = (keyDir, token) => {
 // Auth
 github.authenticate({type: 'token', token});
 // Post key
 return github.users.createKey({
  title: 'lando',
  key: _.trim(fs.readFileSync(path.join(keyDir, `${gitHubLandoKey}.pub`), 'utf8')),
 })
 // Catch key already in use error
 .catch(err => {
  const message = JSON.parse(err.message);
  // Report error for everything else
  if (_.has(message.errors, '[0].message') && message.errors[0].message !== 'key is already in use') {
   throw Error(throwError(err));
  }
 });
}
origin: lando/lando

/*
 * Helper to build mac docker version get command
 */
const getMacProp = prop => shell.sh(['defaults', 'read', `${macOSBase}/Contents/Info.plist`, prop])
 .then(data => _.trim(data))
 .catch(() => null)
origin: shen100/mili

const pageSize: number = 20;
let  articles: Article[];
keyword = _.trim(keyword || '');
keyword = decodeURIComponent(keyword);
if (keyword) {
origin: lando/lando

// Handle build steps
 // Go through each service and run additional build commands as needed
 app.events.on('post-init', () => {
  // Add in build hashes
  app.meta.lastPreBuildHash = _.trim(lando.cache.get(app.preLockfile));
  app.meta.lastPostBuildHash = _.trim(lando.cache.get(app.postLockfile));
  // Make sure containers for this app exist; if they don't and we have build locks, we need to kill them
  const buildServices = _.get(app, 'opts.services', app.services);
  app.events.on('pre-start', () => {
   return lando.engine.list({project: app.project, all: true}).then(data => {
    if (_.isEmpty(data)) {
     lando.cache.remove(app.preLockfile);
     lando.cache.remove(app.postLockfile);
    }
   });
  });
  // Queue up both legacy and new build steps
  app.events.on('pre-start', 100, () => {
   const preBuild = utils.filterBuildSteps(buildServices, app, preRootSteps, preBuildSteps, true);
   return utils.runBuild(app, preBuild, app.preLockfile, app.configHash);
  });
  app.events.on('post-start', 100, () => {
   const postBuild = utils.filterBuildSteps(buildServices, app, postRootSteps, postBuildSteps);
   return utils.runBuild(app, postBuild, app.postLockfile, app.configHash);
  });
 });
origin: lando/lando

])
.then(data => ({
 compose: _.trim(data[1]),
 engine: _.trim(data[0]),
 desktop: false,
}));
origin: lando/lando

if (code !== 0 && _.isEmpty(stderr)) stderr = _.trim(_.last(_.compact(stdout.split(os.EOL))));
origin: uestcio/uestc-sdk

dStrs.map(function (dStr, n) {
    var place = _.trim(pStrs[n]) || '';
    var res = _.words(dStr, /[\S]+/g);
    var parity = _.startsWith(place, '单')? 1: (_.startsWith(place, '双')? 2: 4);
    if(parity !== 4) {
      place = _.words(place, /\S+/g)[1];
    }
    var day = Encoder.parseDayofWeek(res[0]);
    var indexes = Encoder.parseIndexes(res[1]);
    var weeks = Encoder.parseWeeks(res[2], parity);
    return new Duration(weeks, day, indexes, place);
  })
origin: leossnet/jetcalc

splittedInfo.forEach(function (rawInfo) {
      var info = rawInfo.split(':');
      var key   = _.trim(_.first(info));
      var value = _.trim(_.last(info));
      resultInfo[key] = value;
    });
origin: ohbarye/review-waiting-list-bot

convertToConditionArgs(matched) {
  return matched ? [
            _.compact(
             _.trim(matched[1])
              .split(',')
              .map((str) => str.replace(/["'“”]/g, ''))),
           !_.startsWith(matched[0], '-'),
           ]
           : []
 }
origin: leossnet/jetcalc

getRawCoreInfo(i, function (rawCoreInfo) {
        rawCoreInfo.forEach(function (rawInfo) {
          var info = rawInfo.split(':');
          
          var key   = _.camelCase(_.trim(_.first(info)));
          var value = _.trim(_.last(info));

          coreInfo[key] = value;
        });
      });
origin: gaccettola/mortis

function process_script ( line_array )
  {
    if ( ! _.isArray   ( line_array ) )  return;

    if ( 2 !== line_array.length )       return;

    var line_alias = _.trim ( line_array[0] );
    var line_route = _.trim ( line_array[1] );

    return process_route ( line_alias, line_route );
  }
lodash(npm)LoDashStatictrim

JSDoc

Removes leading and trailing whitespace or specified characters from string.

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

  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • fs
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • async
    Higher-order functions and common patterns for asynchronous code
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • postcss
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • minimist
    parse argument options
  • Best IntelliJ plugins
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