lodash: changed _.words() method

This commit is contained in:
Ilya Mochalov
2015-08-24 00:09:02 +05:00
parent af81415504
commit cf410b943a
2 changed files with 18 additions and 1 deletions
+3
View File
@@ -1825,8 +1825,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
@@ -7816,8 +7816,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[];
}
/***********