How to use the underscored function from underscore.string
Find comprehensive JavaScript underscore.string.underscored code examples handpicked from public code repositorys.
GitHub: guyoung/CaptfEncoder
55 56 57 58 59 60 61 62 63 64 65 66
/** * 将camelized 或者中划线转化成下划线 * @param str */ function underscored(str) { return _s.underscored(str); } /**
183
970
0
+ 9 other calls in file
53 54 55 56 57 58 59 60 61 62 63 64
exports.classify = function(value, options, callback){ callback(null, str.classify(String(value))); }; exports.underscored = function(value, options, callback){ callback(null, str.underscored(String(value))); }; exports.dasherize = function(value, options, callback){ callback(null, str.dasherize(String(value)));
2
2
0
+ 2 other calls in file
55 56 57 58 59 60 61 62 63 64
FIELD_NAMESPACE: this.props.project_namespace.replace(/(\/)/g, '\\'), FIELD_NAME: s.dasherize(this.props.project_name), FIELD_NAME_JS: s.classify(this.props.project_name).toLowerCase(), FIELD_NAME_PHP: field_name_php_camel_case, FIELD_NAME_CLASS_PHP: field_name_class_php, FIELD_NAME_PHP_PATH: 'CARBON_' + s.underscored(this.props.project_name).toUpperCase() + '_DIR', FIELD_NAME_COMPOSER: this.props.composer.replace('\\', '/'), FIELD_DESCRIPTION: s.clean(this.props.project_description), FIELD_NAME_SAMPLE: s.classify(field_name_php_camel_case).toLowerCase(), }
1
4
0
108 109 110 111 112 113 114 115 116 117
let actionPathParts = actionParts.join('/'); let statePath = configUtils.getChoiceByKey('path', 'store'); let actionPath = `${statePath.path}/${reducerRoot}/actions`; let testPath = `${statePath.path}/${reducerRoot}/tests`; let reducerPath = `${statePath.path}/${reducerRoot}/reducers`; let constantName = _.underscored(actionName).toUpperCase(); let settings; settings = { action: { path: `${actionPath}/${actionPathParts}/`,
0
1
0
197 198 199 200 201 202 203 204 205 206
const u = use_underscore || false; field = field.replace(/\//g, ' ').trim(); if (u) { return _s.underscored(field); } else { return _s.trim(_s.dasherize(field), '-'); }
0
0
1
+ 5 other calls in file
38 39 40 41 42 43 44 45 46 47
* @param columns * @returns {string} */ SqlConstructor.prototype.getInsertColumns = function (columns) { var _columns = _.map(columns, function (column) { return _s.underscored(column) }); return '(' + _columns.join(',') + ')'; }
0
0
7
underscore.string.slugify is the most popular function in underscore.string (323 examples)