@citruslime/utils 3.0.0-beta.0 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/citrus-lime-utils.js +5 -5
- package/dist/utils/strings.d.ts +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Citrus-Lime Utils
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A utilities library, for JavaScript & TypeScript projects. Used by [Citrus-Lime UI](https://www.npmjs.com/package/@citruslime/ui).
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
@@ -2,7 +2,7 @@ function g(t, ...n) {
|
|
|
2
2
|
let e = 0;
|
|
3
3
|
return t.replace(/{\d+}/g, () => typeof n[e] < "u" ? n[e++] : "");
|
|
4
4
|
}
|
|
5
|
-
function f(t, n, e
|
|
5
|
+
function f(t, n, e) {
|
|
6
6
|
const o = n.filter((r) => !!r?.trim()).map((r) => `(${p(r)})`).join("|");
|
|
7
7
|
return t.replace(
|
|
8
8
|
new RegExp(o, "ig"),
|
|
@@ -88,10 +88,10 @@ function* y(t, n) {
|
|
|
88
88
|
function x() {
|
|
89
89
|
return Math.random().toString(36).slice(2, 8);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function C(t) {
|
|
92
92
|
return t;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function d(t, n, e) {
|
|
95
95
|
return t[e] < n[e] ? -1 : t[e] > n[e] ? 1 : 0;
|
|
96
96
|
}
|
|
97
97
|
function v(t, n) {
|
|
@@ -111,14 +111,14 @@ function $() {
|
|
|
111
111
|
}
|
|
112
112
|
export {
|
|
113
113
|
y as chunk,
|
|
114
|
-
|
|
114
|
+
d as compareByProperty,
|
|
115
115
|
p as escapeStringForRegExp,
|
|
116
116
|
x as generateStringId,
|
|
117
117
|
w as getCaseInsensitiveQueryParam,
|
|
118
118
|
v as getParamsByName,
|
|
119
119
|
f as highlightText,
|
|
120
120
|
$ as isTouchDevice,
|
|
121
|
-
|
|
121
|
+
C as nameOf,
|
|
122
122
|
g as replacePlaceholders,
|
|
123
123
|
T as validateEmail
|
|
124
124
|
};
|
package/dist/utils/strings.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare function replacePlaceholders(value: string, ...replacements: stri
|
|
|
14
14
|
* @param highlightClasses The classes to be used to highlight the text.
|
|
15
15
|
* @returns The value as a HTML string that highlights the provided terms.
|
|
16
16
|
*/
|
|
17
|
-
export declare function highlightText(value: string, searchTerms: string[], highlightClasses
|
|
17
|
+
export declare function highlightText(value: string, searchTerms: string[], highlightClasses: string): string;
|
|
18
18
|
/**
|
|
19
19
|
* Escapes a string to be used inside a RegExp expression.
|
|
20
20
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citruslime/utils",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Citrus-Lime Ltd",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
],
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
-
"development": "./src/main.ts",
|
|
23
22
|
"import": "./dist/citrus-lime-utils.js",
|
|
24
23
|
"types": "./dist/main.d.ts"
|
|
25
24
|
}
|