@trackunit/shared-utils
Advanced tools
Comparing version 0.0.63 to 0.0.64
@@ -1049,2 +1049,16 @@ 'use strict'; | ||
const removeLeftPadding = (id) => Number(id === null || id === void 0 ? void 0 : id.replace(/-/g, "").replace(/^0+/, "")); | ||
/** | ||
* Removes hidden characters from a string. | ||
* | ||
* @param input - The input string to clean. | ||
* @returns {string} The cleaned string with hidden characters removed. | ||
*/ | ||
const stripHiddenCharacters = (input) => { | ||
// Regular expression to match various hidden characters | ||
const hiddenRegex = new RegExp( | ||
// eslint-disable-next-line no-control-regex | ||
/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB\u0000-\u001F\u007F-\u009F]/gu); | ||
// Replace hidden characters with an empty string | ||
return input.replace(hiddenRegex, ""); | ||
}; | ||
@@ -1126,2 +1140,3 @@ /* eslint-disable local-rules/prefer-custom-object-keys */ | ||
exports.stringNaturalCompare = stringNaturalCompare; | ||
exports.stripHiddenCharacters = stripHiddenCharacters; | ||
exports.titleCase = titleCase; | ||
@@ -1128,0 +1143,0 @@ exports.toID = toID; |
@@ -1045,2 +1045,16 @@ var HoursAndMinutesFormat; | ||
const removeLeftPadding = (id) => Number(id === null || id === void 0 ? void 0 : id.replace(/-/g, "").replace(/^0+/, "")); | ||
/** | ||
* Removes hidden characters from a string. | ||
* | ||
* @param input - The input string to clean. | ||
* @returns {string} The cleaned string with hidden characters removed. | ||
*/ | ||
const stripHiddenCharacters = (input) => { | ||
// Regular expression to match various hidden characters | ||
const hiddenRegex = new RegExp( | ||
// eslint-disable-next-line no-control-regex | ||
/[\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB\u0000-\u001F\u007F-\u009F]/gu); | ||
// Replace hidden characters with an empty string | ||
return input.replace(hiddenRegex, ""); | ||
}; | ||
@@ -1069,2 +1083,2 @@ /* eslint-disable local-rules/prefer-custom-object-keys */ | ||
export { DateTimeFormat, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, getDifferenceBetweenDates, getEndOfDay, getISOStringFromDate, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isSorted, isUUID, isValidImage, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, pick, removeLeftPadding, resizeBlob, resizeImage, size, stringCompare, stringCompareFromKey, stringNaturalCompare, titleCase, toID, toIDs, toUUID, trimIds, trimPath, truthy, unionArraysByKey }; | ||
export { DateTimeFormat, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, getDifferenceBetweenDates, getEndOfDay, getISOStringFromDate, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isSorted, isUUID, isValidImage, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, pick, removeLeftPadding, resizeBlob, resizeImage, size, stringCompare, stringCompareFromKey, stringNaturalCompare, stripHiddenCharacters, titleCase, toID, toIDs, toUUID, trimIds, trimPath, truthy, unionArraysByKey }; |
{ | ||
"name": "@trackunit/shared-utils", | ||
"version": "0.0.63", | ||
"version": "0.0.64", | ||
"repository": "https://github.com/Trackunit/manager", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.txt", |
@@ -31,1 +31,8 @@ /** | ||
export declare const removeLeftPadding: (id: string | null | undefined) => number; | ||
/** | ||
* Removes hidden characters from a string. | ||
* | ||
* @param input - The input string to clean. | ||
* @returns {string} The cleaned string with hidden characters removed. | ||
*/ | ||
export declare const stripHiddenCharacters: (input: string) => string; |
107936
2854