you can use Utils.camelCase for this: https://github.com/mozilla-b2g/gaia/blob/cf66f95f3e323cd00c97115ced37b9375ecca43b/apps/sms/js/utils.js#L479-L483