@etsoo/shared 1.2.67 → 1.2.69
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/__tests__/Utils.ts +5 -0
- package/lib/cjs/IActionResult.d.ts +2 -2
- package/lib/cjs/Utils.js +1 -1
- package/lib/mjs/IActionResult.d.ts +2 -2
- package/lib/mjs/Utils.js +1 -1
- package/package.json +3 -3
- package/src/IActionResult.ts +2 -2
- package/src/Utils.ts +1 -1
package/__tests__/Utils.ts
CHANGED
|
@@ -204,6 +204,11 @@ test("Tests for hasHtmlEntity", () => {
|
|
|
204
204
|
expect(Utils.hasHtmlEntity("< >")).toBeTruthy();
|
|
205
205
|
expect(Utils.hasHtmlEntity("&180;")).toBeFalsy();
|
|
206
206
|
expect(Utils.hasHtmlEntity("&160;")).toBeTruthy();
|
|
207
|
+
expect(
|
|
208
|
+
Utils.hasHtmlEntity(
|
|
209
|
+
"<p>Hello, world! This is <b>BOLD</b>.</p>"
|
|
210
|
+
)
|
|
211
|
+
).toBeTruthy();
|
|
207
212
|
});
|
|
208
213
|
|
|
209
214
|
test("Tests for hasHtmlTag", () => {
|
|
@@ -62,8 +62,8 @@ export type MsgActionResult = IActionResult<{
|
|
|
62
62
|
/**
|
|
63
63
|
* Action result with id, message data
|
|
64
64
|
*/
|
|
65
|
-
export type IdMsgActionResult = IActionResult<{
|
|
66
|
-
id:
|
|
65
|
+
export type IdMsgActionResult<T extends IdType = number> = IActionResult<{
|
|
66
|
+
id: T;
|
|
67
67
|
msg: string;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|
package/lib/cjs/Utils.js
CHANGED
|
@@ -62,8 +62,8 @@ export type MsgActionResult = IActionResult<{
|
|
|
62
62
|
/**
|
|
63
63
|
* Action result with id, message data
|
|
64
64
|
*/
|
|
65
|
-
export type IdMsgActionResult = IActionResult<{
|
|
66
|
-
id:
|
|
65
|
+
export type IdMsgActionResult<T extends IdType = number> = IActionResult<{
|
|
66
|
+
id: T;
|
|
67
67
|
msg: string;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|
package/lib/mjs/Utils.js
CHANGED
|
@@ -357,7 +357,7 @@ export var Utils;
|
|
|
357
357
|
* @returns Result
|
|
358
358
|
*/
|
|
359
359
|
function hasHtmlEntity(input) {
|
|
360
|
-
return /&(lt|gt|nbsp|60|62|160)
|
|
360
|
+
return /&(lt|gt|nbsp|60|62|160|#x3C|#x3E|#xA0);/i.test(input);
|
|
361
361
|
}
|
|
362
362
|
Utils.hasHtmlEntity = hasHtmlEntity;
|
|
363
363
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/shared",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.69",
|
|
4
4
|
"description": "TypeScript shared utilities and functions",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"homepage": "https://github.com/ETSOO/Shared#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/lodash.isequal": "^4.5.8",
|
|
40
|
-
"@vitejs/plugin-react": "^4.
|
|
41
|
-
"jsdom": "^26.
|
|
40
|
+
"@vitejs/plugin-react": "^4.4.0",
|
|
41
|
+
"jsdom": "^26.1.0",
|
|
42
42
|
"typescript": "^5.8.3",
|
|
43
43
|
"vitest": "^3.1.1"
|
|
44
44
|
},
|
package/src/IActionResult.ts
CHANGED
|
@@ -75,8 +75,8 @@ export type MsgActionResult = IActionResult<{
|
|
|
75
75
|
/**
|
|
76
76
|
* Action result with id, message data
|
|
77
77
|
*/
|
|
78
|
-
export type IdMsgActionResult = IActionResult<{
|
|
79
|
-
id:
|
|
78
|
+
export type IdMsgActionResult<T extends IdType = number> = IActionResult<{
|
|
79
|
+
id: T;
|
|
80
80
|
msg: string;
|
|
81
81
|
}>;
|
|
82
82
|
|
package/src/Utils.ts
CHANGED