Merge pull request #5500 from chrootsu/lodash-words

lodash: changed _.words() method
This commit is contained in:
Masahiro Wakame
2015-08-26 01:40:41 +09:00
2 changed files with 18 additions and 1 deletions
+3
View File
@@ -1839,8 +1839,11 @@ result = <string>_('hi-diddly-ho there, neighborino').trunc({ 'omission': ' […
result = <string>_.unescape('fred, barney, &amp; pebbles');
result = <string>_('fred, barney, &amp; pebbles').unescape();
// _.words
result = <string[]>_.words('fred, barney, & pebbles');
result = <string[]>_.words('fred, barney, & pebbles', /[^, ]+/g);
result = <string[]>_('fred, barney, & pebbles').words();
result = <string[]>_('fred, barney, & pebbles').words(/[^, ]+/g);
/**********
* Utilities *
+15 -1
View File
@@ -7850,8 +7850,22 @@ declare module _ {
unescape(): string;
}
//_.words
interface LoDashStatic {
words(str?: string, pattern?: string|RegExp): string[];
/**
* Splits string into an array of its words.
* @param string The string to inspect.
* @param pattern The pattern to match words.
* @return Returns the words of string.
*/
words(string?: string, pattern?: string|RegExp): string[];
}
interface LoDashWrapper<T> {
/**
* @see _.words
*/
words(pattern?: string|RegExp): string[];
}
/***********