How to use the toUpper function from lodash

Find comprehensive JavaScript lodash.toUpper code examples handpicked from public code repositorys.

397
398
399
400
401
402
403
404
405
406
module.exports.toPath              = _.toPath;
module.exports.toPlainObject       = _.toPlainObject;
module.exports.toQuery             = _.toQuery;
module.exports.toSafeInteger       = _.toSafeInteger;
module.exports.toString            = _.toString;
module.exports.toUpper             = _.toUpper;
module.exports.trampoline          = _.trampoline;
module.exports.transform           = _.transform;
module.exports.trim                = _.trim;
module.exports.trimEnd             = _.trimEnd;
fork icon19
star icon122
watch icon0

+ 92 other calls in file

847
848
849
850
851
852
853
854
855
856
857
858
859
console.log(template({ 'user': 'fred' })); // => 'hello fred!'


const toLower = _.toLower('--Foo-Bar--');
console.log(toLower); // => '--foo-bar--'


const toUpper = _.toUpper('--foo-bar--');
console.log(toUpper); // => '--FOO-BAR--'


const trim = _.trim('  abc  ');
console.log(trim); // => 'abc'
fork icon0
star icon4
watch icon0

+ 15 other calls in file

73
74
75
76
77
78
79
80
81
82
service_id:
  lead?.fk_service_id !== -1
    ? getNewMappedServiceId(lead.fk_service_id)
    : null,
patient_gender: _.toUpper(_.trim(lead.gender[0]))
  ? _.toUpper(_.trim(lead.gender[0]))
  : null,
patient_dob:
  !isNaN(lead.age) && lead.age.length > 0
    ? new Date(
fork icon0
star icon1
watch icon0

53
54
55
56
57
58
59
60
61
var patient = Patient({
    firstName: _.capitalize(req.body.firstName),
    lastName: _.capitalize(req.body.lastName),
    sex: sex,
    dateOfBirth: dateOfBirth,
    hospitalNumber: _.toUpper(req.body.hospitalNumber),
    diseases: PD,
    lastUpdate: (new Date().getTime())
});
fork icon0
star icon1
watch icon0

14
15
16
17
18
19
20
21
22
23
}

res.json({
  cards: _.filter(cards, card => {
    const name = _.toUpper(_.get(req, 'query.name', ''))
    const type = _.toUpper(_.get(req, 'query.type', ''))
    const checkName = _.includes(_.toUpper(card.name), name)
    const checkType = _.includes(_.toUpper(card.type), type)
    return checkName && checkType
  })
fork icon0
star icon0
watch icon0

Other functions in lodash

Sorted by popularity

function icon

lodash.get is the most popular function in lodash (7670 examples)