mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-22 11:40:10 +08:00
(feature) Renamed _.trunc to _.truncate
This commit is contained in:
+17
-17
@@ -9245,32 +9245,32 @@ module TestTrimEnd {
|
||||
}
|
||||
}
|
||||
|
||||
// _.trunc
|
||||
module TestTrunc {
|
||||
// _.truncate
|
||||
module Testtruncate {
|
||||
{
|
||||
let result: string;
|
||||
|
||||
result = _.trunc('hi-diddly-ho there, neighborino');
|
||||
result = _.trunc('hi-diddly-ho there, neighborino', 24);
|
||||
result = _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
|
||||
result = _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
|
||||
result = _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' […]' });
|
||||
result = _.truncate('hi-diddly-ho there, neighborino');
|
||||
result = _.truncate('hi-diddly-ho there, neighborino', 24);
|
||||
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
|
||||
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
|
||||
result = _.truncate('hi-diddly-ho there, neighborino', { 'omission': ' […]' });
|
||||
|
||||
result = _('hi-diddly-ho there, neighborino').trunc();
|
||||
result = _('hi-diddly-ho there, neighborino').trunc(24);
|
||||
result = _('hi-diddly-ho there, neighborino').trunc({ 'length': 24, 'separator': ' ' });
|
||||
result = _('hi-diddly-ho there, neighborino').trunc({ 'length': 24, 'separator': /,? +/ });
|
||||
result = _('hi-diddly-ho there, neighborino').trunc({ 'omission': ' […]' });
|
||||
result = _('hi-diddly-ho there, neighborino').truncate();
|
||||
result = _('hi-diddly-ho there, neighborino').truncate(24);
|
||||
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': ' ' });
|
||||
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': /,? +/ });
|
||||
result = _('hi-diddly-ho there, neighborino').truncate({ 'omission': ' […]' });
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _('hi-diddly-ho there, neighborino').chain().trunc();
|
||||
result = _('hi-diddly-ho there, neighborino').chain().trunc(24);
|
||||
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'length': 24, 'separator': ' ' });
|
||||
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'length': 24, 'separator': /,? +/ });
|
||||
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'omission': ' […]' });
|
||||
result = _('hi-diddly-ho there, neighborino').chain().truncate();
|
||||
result = _('hi-diddly-ho there, neighborino').chain().truncate(24);
|
||||
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': ' ' });
|
||||
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': /,? +/ });
|
||||
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'omission': ' […]' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+8
-8
@@ -14174,8 +14174,8 @@ declare module _ {
|
||||
trimEnd(chars?: string): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
//_.trunc
|
||||
interface TruncOptions {
|
||||
//_.truncate
|
||||
interface TruncateOptions {
|
||||
/** The maximum string length. */
|
||||
length?: number;
|
||||
/** The string to indicate text is omitted. */
|
||||
@@ -14193,24 +14193,24 @@ declare module _ {
|
||||
* @param options The options object or maximum string length.
|
||||
* @return Returns the truncated string.
|
||||
*/
|
||||
trunc(
|
||||
truncate(
|
||||
string?: string,
|
||||
options?: TruncOptions|number
|
||||
options?: TruncateOptions|number
|
||||
): string;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.trunc
|
||||
* @see _.truncate
|
||||
*/
|
||||
trunc(options?: TruncOptions|number): string;
|
||||
truncate(options?: TruncateOptions|number): string;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.trunc
|
||||
* @see _.truncate
|
||||
*/
|
||||
trunc(options?: TruncOptions|number): LoDashExplicitWrapper<string>;
|
||||
truncate(options?: TruncateOptions|number): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
//_.unescape
|
||||
|
||||
Reference in New Issue
Block a user