/
githubmirror
/
lodash
Обзор
Документация
Войти
/
githubmirror
/
lodash
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.18.0-amd
_createCompounder.js
23 строки
641 B
John-David Dalton
Bump to v4.11.0.
13 апр 2016, 20:19
13 апр 2016, 20:19
63d9a3f
Код
Авторство
О чём код?
define(['./_arrayReduce', './deburr', './words'], function(arrayReduce, deburr, words) { /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]"; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } return createCompounder; });