2.0.0 - 2022-12-28
words: keeps words consisting of alpha-numeric characters. Previously, also symbols like comma or exclamation mark were kept as words
- bump dependencies
- provide named export
Strused viaimport { Str } from '@supercharge/strings'const { Str } = require('@supercharge/strings')
- drop support for Node.js v12 and require Node.js v14
- we’re using this package only with Node.js and not in browser environments and this change may also have effects in the browser that we can’t determine at this point
1.29.1 - 2022-11-18
lcFirst: won’t fail for empty stringsucFirst: won’t fail for empty strings
1.29.0 - 2022-10-20
equals(string | Str): you can now pass aStrinstance for comparisonsnotEquals(string | Str): you can now pass aStrinstance for comparisonsisLowerLetters(): determine whether the wrapped string is lowercase and consists of letters only
- bump deps
1.28.0 - 2022-05-30
hasLength(length): determine whether the string has the givenlengthisAlphaNumeric(input): determine whether the giveninputis an alpha-numeric string
1.27.1 - 2022-05-06
- bring back Node.js v12 support
1.27.0 - 2022-04-25
random: add support for a random string builder- example:
Str.random(use => use.length(10).numbers().characters())results in a random string using only numbers and characters with a length of 10
- example:
1.26.0 - 2022-04-11
squish(): remove all extra whitespaces and also trim the string (remove leading and trailing whitespaces)
1.25.1 - 2022-04-06
- bump deps
- properly handle boolean
falsevalues as strings- before:
falsewas replaced with an empty string - now:
falsewill be wrapped properly to a string'false'
- before:
1.25.0 - 2022-01-24
stripHtml(): remove HTML tags from the string
- bump deps
replace(searchValue: string | RegEx): add theRegExtype annotation to the search value in the replace method
1.24.0 - 2021-11-17
padBoth(length, pad): pad both sides, left and right, of the string with the givenpadstring (repeatedly if needed) so that the resulting string reaches a givenlengthequalsIgnoreCase(value): determine whether the string equals givenvaluewhen ignoring character casing
- use UVU and c8 for testing and coverage report
1.23.1 - 2021-11-12
- updated the
splitCamel()method to trim each word
1.23.0 - 2021-11-12
lines(): breaks the string at the newline character and returns an array of linesisCamel(): determine whether the given string is written in camelCasewords(): returns the list of words for the given string
1.22.0 - 2021-10-13
at(position): returns the character at the givenpositionisSymbol(): determine whether the string is a JavaScriptSymbolisUuid(): determine whether the string is a UUID
1.21.0 - 2021-09-08
containsBom(): determine whether the string contains a byte order mark (BOM) at any positionstartsWithBom(): determine whether the string starts with the byte order mark (BOM)
- bump dependencies
- refined types for
Str.isString(value)allowing TypeScript to properly resolve thestringtype
1.20.0 - 2021-09-03
stripExtraSpaces(): removes all extra spaces from a string and leaves only a single space at the given positionshuffle(): randomly shuffle the characters of the string (using the fisher yates shuffle algorithm)slice(start, end): returns a section of the string fromstarttoendstripBom(): removes the byte order mark (BOM) from the string
- bump dependencies
1.19.0 - 2021-07-29
chars(): returns the list of characters for the given string
- bump dependencies
- remove not needed
eslint-plugin-standarddependency: not needed when usingeslint-config-standard v16
1.18.0 - 2021-01-23
slug(separator = '-'): convert the string to a URL-friendly “slug” in kebab-case
- bump dependencies
kebab(separator = '-'): add theseparatorparameter to thekebabmethod
1.17.1 - 2020-12-10
- fixed typings for
parseCallback)method
1.17.0 - 2020-12-10
parseCallback(separator = '@', defaultValue?): parse a Class[@]method style string into the Class and method names
- bump dependencies
1.16.0 - 2020-11-18
notEquals(value): determine whether the string does not equal the givenvaluenotIncludes(needle): determine whether the string does not contain the givenneedleincludesAll(...needles): determine whether the string contains all of the givenneedles
- bump dependencies
1.15.1 - 2020-10-23
replaceLast(search, replacement)now returns the original string if the searched value isn’t part of the string
1.15.0 - 2020-10-22
reverse(): reverses the stringreplaceLast(search, replacement): replaces the last occurrence of the givensearchstring with thereplacement
- bump dependencies
contains(...needles): determine whether the given string contains any of the given needles. Before, you could only check for one needle (contains(needle))
1.14.0 - 2020-10-21
finish(suffix): ensures the string ends with the givensuffixpadLeft(length, pad): pads the string on the left side until the length is reachedpadRight(length, pad): pads the string on the right side until the length is reached
- bump dependencies
- allow array as an argument for
append,prepend, andcontainsAll
ltrim(char)removes every occurrence ofcharfrom the beginning of the string, not just the firstrtrim(char)removes every occurrence ofcharfrom the end of the string, not just the last
1.13.0 - 2020-10-20
afterLast(delimiter): returns the portion of the string after the last occurrence ofdelimiterappend(...values): appends the givenvaluesto the stringbeforeLast(delimiter): returns the portion of the string before the last occurrence ofdelimiterprepend(...values): prepends the givenvaluesto the stringstart(prefix): ensures the string starts with the givenprefixreplace(search, value): replaces the first occurrence ofsearchwithvaluein the string
- bump dependencies
1.12.0 - 2020-09-15
before(delimiter): returns the portion of the string before the first occurrence of the givendelimiterafter(delimiter): returns the portion of the string after the first occurrence of the givendelimiterstripNums(): removes all numbers from the string
- bump dependencies
- change
mainentrypoint inpackage.jsontodistfolder - move test runner from
@hapi/labtojest - move assertions from
@hapi/codetojest
- remove
index.jsfile which acted as a middleman to export fromdistfolder
1.11.0 - 2020-07-27
containsAll(needles): determine whether all items in theneedlesarray are part of the string
- bump dependencies
1.10.0 - 2020-07-14
notContains(needle): determine whether the given string does not contain the givenneedle
- bump dependencies
1.9.0 - 2020-06-04
ltrim(characters),rtrim(characters)andtrim(characters): support acharactersparameter allowing you to trim a specific string value from the beginning, end, or both of a value:Str('/supercharge/').trim('/').get()=>'supercharge'Str('/supercharge/').ltrim('/').get()=>'supercharge/'Str('/supercharge/').rtrim('/').get()=>'/supercharge'
1.8.0 - 2020-05-18
snake(): converts a string to snake_casekebab(): converts a string to kebab-casepascal(): converts a string to PascalCase or also known as StudlyCase
- GitHub Action to publish this package in the GitHub Package Registry
1.7.0 - 2020-05-13
- type definitions
- bump dependencies
- move codebase to TypeScript to automatically generate type definitions
1.6.0 - 2020-05-12
.limit(limit, end): returns the firstlimitcharacters and ends the limited string withend
1.5.0 - 2020-05-05
Str.isString(value): determine whether the givenvalueis a string
1.4.0 - 2020-04-24
.ltrim(): remove all whitespace from the left of the string.rtrim(): remove all whitespace from the rigth of the string.concat(): returns a string that contains the concatenation of two or more strings
1.3.0 - 2020-04-03
.split(separator): split the string into an ordered set of substrings where theseparatoroccurs.equals(value): determine whether the string equals the givenvalue.startsWith(needle, position): determine whether the string starts with theneedle.endsWith(needle, length): determine whether the string ends with theneedle
1.2.0 - 2020-01-27
.ucFirst(): uppercase the first character in the string.replaceAll(): replace all occurences in a string
- bump deps
- Readme: fix scope in package name (from
@superchargejsto@supercharge)
1.1.0 - 2019-12-17
.isEmpty(): determine whether the string value is empty (''/undefined/null).isNotEmpty(): determine whether the string value has a length of 1 or greater
1.0.1 - 2019-12-15
- GitHub Workflow publishing this package in the GitHub Package Registry
filesconfiguration inpackage.jsonfile to only publish package parts, not tests. This reduces the package size
1.0.0release 🚀 🎉