Comparing version 1.0.5 to 1.0.7
{ | ||
"name": "string-wks", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "Some string manipulation functions that I need to use commonly", | ||
@@ -19,3 +19,7 @@ "main": "string.js", | ||
}, | ||
"homepage": "https://github.com/weaksou/string#readme" | ||
"homepage": "https://github.com/weaksou/string#readme", | ||
"keywords": [ | ||
"string", | ||
"validate-url" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# I only created this for my personnal use, it will grow up by time :) | ||
# I created this for my personnal use, it will grow up by time :) | ||
@@ -59,3 +59,3 @@ ## basic functions | ||
1. **string:** text | ||
2. **count:** how many inputs you want to output from a string | ||
2. **count:** where to cut the string | ||
3. **dotsCount** *(optional)***:** add three dots at the end if string length is bigger than dotsCount, if not specified default is 100 character. | ||
@@ -72,4 +72,12 @@ >trimTo(string, count) | ||
**trimToSimple** | ||
return an array with two values, | ||
1. first is: the trimed text . | ||
2. what left in the text. | ||
can be usefull creating ***readmore*** functionality. | ||
trimToSimple("this is some text", 10) | ||
> [ 'this is so', 'me text' ] | ||
@@ -11,3 +11,4 @@ //exporting functions | ||
validateURL, | ||
trimTo | ||
trimTo, | ||
trimToSimple | ||
}; | ||
@@ -68,1 +69,8 @@ | ||
} | ||
function trimToSimple(string, count) { | ||
return [ | ||
string.substring(0, count), | ||
string.substring(count, string.length) | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3908
64
82