@gmana/utils
Advanced tools
Comparing version 1.2.16 to 1.3.0
@@ -423,5 +423,5 @@ import { ClassValue } from 'clsx'; | ||
/** | ||
* | ||
* @param e event from input | ||
* @returns true if URL is INVALID else false | ||
* Checks if the given url is valid | ||
* @param url - The url to check | ||
* @returns True if url is valid, false otherwise | ||
*/ | ||
@@ -500,2 +500,12 @@ declare function isUrl(url: string | URL): boolean; | ||
/** | ||
* Limits the text content of an HTML string to the given length. | ||
* | ||
* Removes all HTML tags from the string, then truncates the text if it exceeds | ||
* the limit. An ellipsis is appended if truncated. | ||
* | ||
* @param html - HTML string to extract text from | ||
* @param limit - Maximum text length before truncating default `68` | ||
* @returns Truncated text content from HTML string | ||
*/ | ||
declare const limitText: (html: string, limit?: number) => string; | ||
@@ -724,4 +734,9 @@ | ||
/** | ||
* Sanitizes the given string by converting it to an array of words, with punctuation and other non-alphanumeric characters removed. | ||
* @example | ||
* words('Hello World') // ['Hello', 'World'] | ||
*/ | ||
declare function words(str: string): string[]; | ||
export { A, B, BACKSPACE, C, D, DELETE, DOWN_ARROW, E, END, ENTER, ESCAPE, F, G, type Geo, H, HOME, I, IdGenerator, InMemoryCache, J, K, L, LEFT_ARROW, LOCALHOST_GEO_DATA, M, N, O, P, PAGE_DOWN, PAGE_UP, Q, R, RIGHT_ARROW, S, SPACE, type StringValue, T, TAB, U, UP_ARROW, V, W, X, Y, Z, baseX, bytesToSize, camelCase, capitalize, cn, colorLuminance, colors, compactObject, copyToClipboard, countries, cubeIn, cubeOut, currencies, darken, debug, decode, download, downloadCanvas, durationFormat, encode, error, fetcher, fetcherA, flatten, formatCurrency, formatDate, formatDateFromTo, formatNumber, getColor, getDateTimeLocal, getDomainWithoutWWW, getGeoData, getImageInContent, getRandomInitials, getRandomInt, getURL, getZDefaults, hash, hexToHsl, hexToRgb, idV1, idV2, info, isBoolean, isBrowser, isEmpty, isFunction, isNavigator, isNumber, isObject, isString, isSymbol, isTokenExpired, isUndef, isUrl, kebabCase, lighten, limitInput, limitText, log, lowerCase, lowerCaseLetters, maxLength, maxNumber, ms, nFormatter, numberToWord, numberToWordKm, numbers, onlyDecimal, onlyNumeric, sentenceCase, shuffle, slugify, snakeCase, specialCharacters, specialCharactersExtra, startCase, statusTagColorList, tagColor, toASCII, toCamelCase, toCapitalize, toKebabCase, toKhmer, toPixel, toSentenceCase, toSnakeCase, toString, toTitleCase, truncate, upperCaseLetters, upperFirst, wait, warn, words }; |
{ | ||
"name": "@gmana/utils", | ||
"version": "1.2.16", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "author": { | ||
"devDependencies": { | ||
"@types/node": "^20.10.6", | ||
"@types/node": "^20.11.5", | ||
"clsx": "^2.1.0", | ||
@@ -32,0 +32,0 @@ "eslint": "^8.56.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
564728
18602