Converts tests to TypeScript (#300)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
/**
|
||||
* @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
|
||||
@@ -17,7 +16,7 @@
|
||||
* stringShorten('1234567890', 2); // => 12..90
|
||||
* ```
|
||||
*/
|
||||
export default function stringShorten (_value: any, prefixLength: number = 6): string {
|
||||
export default function stringShorten (_value?: any, prefixLength: number = 6): string {
|
||||
const value = `${_value}`;
|
||||
|
||||
if (value.length <= 2 + 2 * prefixLength) {
|
||||
|
||||
Reference in New Issue
Block a user