Skip to content

Commit

Permalink
chore: use String#trim instead of lodash/trim (#4602)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-f authored Oct 15, 2019
1 parent 211ede9 commit 2a96197
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/xo-server/src/xo-mixins/backups.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
once,
range,
sortBy,
trim,
} from 'lodash'
import {
chainVhd,
Expand Down Expand Up @@ -278,7 +277,7 @@ const mountLvmPv = (device, partition) => {
args.push('--show', '-f', device.path)

return execa('losetup', args).then(({ stdout }) => {
const path = trim(stdout)
const path = stdout.trim()
return {
path,
unmount: once(() =>
Expand Down
5 changes: 2 additions & 3 deletions packages/xo-web/src/xo-app/new/sr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Page from '../../page'
import PropTypes from 'prop-types'
import React from 'react'
import store from 'store'
import trim from 'lodash/trim'
import Wizard, { Section } from 'wizard'
import { confirm } from 'modal'
import { adminOnly, connectStore, formatSize } from 'utils'
Expand Down Expand Up @@ -569,8 +568,8 @@ export default class New extends Component {

let { name, description } = this.refs

name = trim(name.value)
description = trim(description.value)
name = name.value.trim()
description = description.value.trim()
if (isEmpty(name) || isEmpty(description)) {
error('Missing General Parameters', 'Please complete General Information')
return
Expand Down

0 comments on commit 2a96197

Please sign in to comment.