mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
38
react-app/node_modules/lodash/string/words.js
generated
vendored
Normal file
38
react-app/node_modules/lodash/string/words.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
var baseToString = require('../internal/baseToString'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
|
||||
/** Used to match words to create compound words. */
|
||||
var reWords = (function() {
|
||||
var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
|
||||
lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
|
||||
|
||||
return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
|
||||
}());
|
||||
|
||||
/**
|
||||
* Splits `string` into an array of its words.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to inspect.
|
||||
* @param {RegExp|string} [pattern] The pattern to match words.
|
||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
|
||||
* @returns {Array} Returns the words of `string`.
|
||||
* @example
|
||||
*
|
||||
* _.words('fred, barney, & pebbles');
|
||||
* // => ['fred', 'barney', 'pebbles']
|
||||
*
|
||||
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
||||
* // => ['fred', 'barney', '&', 'pebbles']
|
||||
*/
|
||||
function words(string, pattern, guard) {
|
||||
if (guard && isIterateeCall(string, pattern, guard)) {
|
||||
pattern = undefined;
|
||||
}
|
||||
string = baseToString(string);
|
||||
return string.match(pattern || reWords) || [];
|
||||
}
|
||||
|
||||
module.exports = words;
|
Reference in New Issue
Block a user