Add tslint (#151)
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
import stringShorten from './shorten';
|
||||
|
||||
/**
|
||||
@summary Utility methods to convert to work with `string` values
|
||||
*/
|
||||
* @summary Utility methods to convert to work with `string` values
|
||||
*/
|
||||
export {
|
||||
stringShorten
|
||||
};
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
/**
|
||||
@name stringShorten
|
||||
@signature stringShorten (value: any, prefixLength: number = 8): string
|
||||
@summary Returns a string with maximum length
|
||||
@description
|
||||
Checks the string against the `prefixLength`, if longer than dopuble this, shortens it by placing `..` in the middle of it
|
||||
@example
|
||||
import { stringShorten } from '@polkadot/util';
|
||||
|
||||
stringShorten('1234567890', 2); // => 12..90
|
||||
*/
|
||||
* @name stringShorten
|
||||
* @signature stringShorten (value: any, prefixLength: number = 8): string
|
||||
* @summary Returns a string with maximum length
|
||||
* @description
|
||||
* Checks the string against the `prefixLength`, if longer than dopuble this, shortens it by placing `..` in the middle of it
|
||||
* @example
|
||||
* import { stringShorten } from '@polkadot/util';
|
||||
*
|
||||
* stringShorten('1234567890', 2); // => 12..90
|
||||
*/
|
||||
export default function stringShorten (_value: any, prefixLength: number = 6): string {
|
||||
const value = `${_value}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user