string/toLower.js

  1. import { toLower as _toLower } from 'lodash'
  2. import { apply } from 'immutadot/core'
  3. /**
  4. * Converts string, as a whole, to lower case just like String#toLowerCase.
  5. * @function
  6. * @memberof string
  7. * @param {Object} object The object to modify.
  8. * @param {Array|string} path The path of the property to set.
  9. * @return {Object} Returns the updated object.
  10. * @example toLower({ nested: { a: "A STRING" } }, 'nested.a') // => { nested: { a: "a string" } }
  11. * @see {@link https://lodash.com/docs#toLower|lodash.toLower} for more information.
  12. * @since 1.0.0
  13. */
  14. const toLower = apply(
  15. _toLower,
  16. {
  17. arity: 1,
  18. fixedArity: true,
  19. },
  20. )
  21. export { toLower }