@siteimprove/alfa-string
Advanced tools
Comparing version 0.92.0 to 0.93.0
# @siteimprove/alfa-string | ||
## 0.93.0 | ||
### Minor Changes | ||
- **Added:** A `String.hasWhitespace` predicate is now available. ([#1694](https://github.com/Siteimprove/alfa/pull/1694)) | ||
## 0.92.0 | ||
@@ -4,0 +10,0 @@ |
@@ -14,7 +14,7 @@ /** | ||
/** | ||
* Collapses adjacent whitespace into a single ASCII space | ||
* Collapses adjacent whitespace into a single ASCII space | ||
*/ | ||
function flatten(input: string): string; | ||
/** | ||
* Trims, collapses adjacent whitespace into a single ASCII space, optionally lowercases (default: true). | ||
* Trims, collapses adjacent whitespace into a single ASCII space, optionally lowercases (default: true). | ||
*/ | ||
@@ -26,3 +26,7 @@ function normalize(input: string, toLowerCase?: boolean): string; | ||
function isWhitespace(input: string, allowEmpty?: boolean): boolean; | ||
/** | ||
* Checks whether the input contains a whitespace | ||
*/ | ||
function hasWhitespace(input: string): boolean; | ||
} | ||
//# sourceMappingURL=string.d.ts.map |
@@ -14,3 +14,3 @@ /** | ||
/** | ||
* Collapses adjacent whitespace into a single ASCII space | ||
* Collapses adjacent whitespace into a single ASCII space | ||
*/ | ||
@@ -22,3 +22,3 @@ function flatten(input) { | ||
/** | ||
* Trims, collapses adjacent whitespace into a single ASCII space, optionally lowercases (default: true). | ||
* Trims, collapses adjacent whitespace into a single ASCII space, optionally lowercases (default: true). | ||
*/ | ||
@@ -36,3 +36,10 @@ function normalize(input, toLowerCase = true) { | ||
String.isWhitespace = isWhitespace; | ||
/** | ||
* Checks whether the input contains a whitespace | ||
*/ | ||
function hasWhitespace(input) { | ||
return /\s/.test(input); | ||
} | ||
String.hasWhitespace = hasWhitespace; | ||
})(String || (String = {})); | ||
//# sourceMappingURL=string.js.map |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://alfa.siteimprove.com", | ||
"version": "0.92.0", | ||
"version": "0.93.0", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "description": "Utilities for manipulating strings", |
6210
72