UNPKG

504 BTypeScriptView Raw
1import type { AnyString } from '../types.js';
2/**
3 * @name stringShorten
4 * @summary Returns a string with maximum length
5 * @description
6 * Checks the string against the `prefixLength`, if longer than double this, shortens it by placing `..` in the middle of it
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { stringShorten } from '@polkadot/util';
12 *
13 * stringShorten('1234567890', 2); // => 12..90
14 * ```
15 */
16export declare function stringShorten(value: AnyString, prefixLength?: number): string;