mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
lodash: signatures of the method _.words changed
This commit is contained in:
+18
-4
@@ -3988,10 +3988,24 @@ result = <string>_.unescape('fred, barney, & pebbles');
|
||||
result = <string>_('fred, barney, & 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);
|
||||
module TestWords {
|
||||
{
|
||||
let result: string[];
|
||||
|
||||
result = _.words('fred, barney, & pebbles');
|
||||
result = _.words('fred, barney, & pebbles', /[^, ]+/g);
|
||||
|
||||
result = _('fred, barney, & pebbles').words();
|
||||
result = _('fred, barney, & pebbles').words(/[^, ]+/g);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string>;
|
||||
|
||||
result = _('fred, barney, & pebbles').chain().words();
|
||||
result = _('fred, barney, & pebbles').chain().words(/[^, ]+/g);
|
||||
}
|
||||
}
|
||||
|
||||
/***********
|
||||
* Utility *
|
||||
|
||||
Vendored
+12
-1
@@ -9638,11 +9638,15 @@ declare module _ {
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* 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[];
|
||||
words(
|
||||
string?: string,
|
||||
pattern?: string|RegExp
|
||||
): string[];
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
@@ -9652,6 +9656,13 @@ declare module _ {
|
||||
words(pattern?: string|RegExp): string[];
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.words
|
||||
*/
|
||||
words(pattern?: string|RegExp): LoDashExplicitArrayWrapper<string>;
|
||||
}
|
||||
|
||||
/***********
|
||||
* Utility *
|
||||
***********/
|
||||
|
||||
Reference in New Issue
Block a user