Documentation / @ember-data/request-utils / string / underscore
ts
function underscore(str): string;
Defined in: warp-drive-packages/utilities/declarations/-private/string/transform.d.ts:59
Returns the lower_case_and_underscored form of a string.
js
import { underscore } from '@warp-drive/utilities/string';
underscore('innerHTML'); // 'inner_html'
underscore('action_name'); // 'action_name'
underscore('css-class-name'); // 'css_class_name'
underscore('my favorite items'); // 'my_favorite_items'
underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice'
Parameters
str
string
Returns
string
Since
4.13.0