mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: changed _.words() method
This commit is contained in:
@@ -1825,8 +1825,11 @@ result = <string>_('hi-diddly-ho there, neighborino').trunc({ 'omission': ' […
|
||||
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);
|
||||
|
||||
/**********
|
||||
* Utilities *
|
||||
|
||||
Vendored
+15
-1
@@ -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[];
|
||||
}
|
||||
|
||||
/***********
|
||||
|
||||
Reference in New Issue
Block a user