@esposter/shared 2.39.0 → 3.0.0
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/dist/index.d.ts +6 -1
- package/dist/index.js +9 -12
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export declare enum MentionType {
|
|
|
56
56
|
User = "user"
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
|
+
//#region src/models/reactivity/MaybeReactive.d.ts
|
|
60
|
+
export interface MaybeReactive {
|
|
61
|
+
__v_raw?: unknown;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
59
64
|
//#region src/models/router/RoutePath.d.ts
|
|
60
65
|
export declare const RoutePath: {
|
|
61
66
|
readonly About: "/about";
|
|
@@ -162,7 +167,7 @@ export declare abstract class Serializable {
|
|
|
162
167
|
//#region src/models/shared/TakeOne.d.ts
|
|
163
168
|
export interface TakeOne {
|
|
164
169
|
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
165
|
-
<T extends object
|
|
170
|
+
<T extends object>(values: T, index: keyof T): T[keyof T];
|
|
166
171
|
}
|
|
167
172
|
//#endregion
|
|
168
173
|
//#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/primitive.d.ts
|
package/dist/index.js
CHANGED
|
@@ -330,6 +330,11 @@ const sanitizeHtml = (...[html, options]) => baseSanitizeHtml(html, {
|
|
|
330
330
|
});
|
|
331
331
|
//#endregion
|
|
332
332
|
//#region src/services/sanitizeHtml/sanitizeTextHtml.ts
|
|
333
|
+
const COLOR_REGEXES = [
|
|
334
|
+
/^#[\da-fA-F]{3,8}$/u,
|
|
335
|
+
/^rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[\d.]+)?\)$/u,
|
|
336
|
+
/^[a-z]+$/iu
|
|
337
|
+
];
|
|
333
338
|
const sanitizeTextHtml = (html) => sanitizeHtml(html, {
|
|
334
339
|
allowedAttributes: {
|
|
335
340
|
a: [
|
|
@@ -351,17 +356,9 @@ const sanitizeTextHtml = (html) => sanitizeHtml(html, {
|
|
|
351
356
|
]
|
|
352
357
|
},
|
|
353
358
|
allowedStyles: { span: {
|
|
354
|
-
"background-color":
|
|
355
|
-
/^#[\da-fA-F]{3,8}$/u,
|
|
356
|
-
/^rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[\d.]+)?\)$/u,
|
|
357
|
-
/^[a-z]+$/iu
|
|
358
|
-
],
|
|
359
|
+
"background-color": COLOR_REGEXES,
|
|
359
360
|
"border-radius": [/^[\d.]+(?<unit>px|em|rem|%)$/u],
|
|
360
|
-
color:
|
|
361
|
-
/^#[\da-fA-F]{3,8}$/u,
|
|
362
|
-
/^rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[\d.]+)?\)$/u,
|
|
363
|
-
/^[a-z]+$/iu
|
|
364
|
-
]
|
|
361
|
+
color: COLOR_REGEXES
|
|
365
362
|
} }
|
|
366
363
|
});
|
|
367
364
|
//#endregion
|
|
@@ -518,8 +515,8 @@ const toKebabCase = (string) => string.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|
|
|
|
518
515
|
const SUFFIX = "...";
|
|
519
516
|
const truncate = (string, length) => {
|
|
520
517
|
if (string.length <= length) return string;
|
|
521
|
-
if (length < 3) return string.slice(0, length);
|
|
522
|
-
return `${string.slice(0, length - 3)}${SUFFIX}`;
|
|
518
|
+
else if (length < 3) return string.slice(0, length);
|
|
519
|
+
else return `${string.slice(0, length - 3)}${SUFFIX}`;
|
|
523
520
|
};
|
|
524
521
|
//#endregion
|
|
525
522
|
//#region src/util/text/uncapitalize.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esposter/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A library that contains shared typescript code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-handling",
|
|
@@ -50,26 +50,26 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"neverthrow": "^8.2.0",
|
|
53
|
-
"node-html-parser": "^9.0.
|
|
53
|
+
"node-html-parser": "^9.0.4",
|
|
54
54
|
"sanitize-html": "^2.17.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@arethetypeswrong/core": "^0.18.5",
|
|
58
58
|
"@azure/data-tables": "^13.3.2",
|
|
59
|
-
"@esposter/configuration": "
|
|
60
|
-
"@types/node": "^26.
|
|
59
|
+
"@esposter/configuration": "3.0.0",
|
|
60
|
+
"@types/node": "^26.5.1",
|
|
61
61
|
"@types/sanitize-html": "^2.16.1",
|
|
62
62
|
"publint": "^0.3.24",
|
|
63
63
|
"tsdown": "^0.23.0",
|
|
64
64
|
"type-fest": "^5.9.0",
|
|
65
|
-
"vitest": "^
|
|
65
|
+
"vitest": "^5.0.0",
|
|
66
66
|
"vue": "^3.5.42"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"zod": "^4.
|
|
69
|
+
"zod": "^4.6.2"
|
|
70
70
|
},
|
|
71
71
|
"inlinedDependencies": {
|
|
72
72
|
"type-fest": "5.9.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "5ea72289bdd594e598aab8fefd5686df2a642a7e"
|
|
75
75
|
}
|