string/trim.js

  1. import { convertStringMethod } from './convertStringMethod'
  2. /**
  3. * Replaces by former string stripped of whitespaces at start and end.
  4. * @function
  5. * @memberof string
  6. * @param {Object} object The object to modify.
  7. * @param {Array|string} path The path of the property to set.
  8. * @return {Object} Returns the updated object.
  9. * @example trim({ nested: { a: ' Hello world ! ' } }) // => { nested: { a: 'Hello world !' } }
  10. * @see {@link https://mdn.io/String.prototype.trim|String.prototype.trim} for more information.
  11. * @since 1.0.0
  12. */
  13. const trim = convertStringMethod('trim')
  14. export { trim }