funda-ui 4.6.101 → 4.6.151

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.
@@ -0,0 +1,55 @@
1
+
2
+ /**
3
+ * HTML entities encode
4
+ *
5
+ * @param {String} str Input text
6
+ * @return {String} Filtered text
7
+ */function htmlEncode(str: string): string {
8
+
9
+ return str.replace(/[&<>'"]/g, tag => ({
10
+ '&': '&amp;',
11
+ '<': '&lt;',
12
+ '>': '&gt;',
13
+ "'": '&#39;',
14
+ '"': '&quot;'
15
+ }[tag]!));
16
+
17
+ }
18
+
19
+
20
+ /**
21
+ * HTML entities decode
22
+ *
23
+ * @param {String} str Input text
24
+ * @return {String} Filtered text
25
+ */
26
+ function htmlDecode(str: string = ''): string {
27
+ const entities: [string, string][] = [
28
+ ['amp', '&'],
29
+ ['apos', '\''],
30
+ ['#x27', '\''],
31
+ ['#x2F', '/'],
32
+ ['#39', '\''],
33
+ ['#47', '/'],
34
+ ['lt', '<'],
35
+ ['gt', '>'],
36
+ ['nbsp', ' '],
37
+ ['quot', '"'],
38
+ ['#60', '<'],
39
+ ['#62', '>']
40
+ ];
41
+
42
+ for (let i = 0, max = entities.length; i < max; i++) {
43
+ str = str.replace(new RegExp('&' + entities[i][0] + ';', 'g'), entities[i][1]);
44
+ }
45
+
46
+ return str;
47
+ }
48
+
49
+
50
+
51
+
52
+ export {
53
+ htmlEncode,
54
+ htmlDecode
55
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "UIUX Lab",
3
3
  "email": "uiuxlab@gmail.com",
4
4
  "name": "funda-ui",
5
- "version": "4.6.101",
5
+ "version": "4.6.151",
6
6
  "description": "React components using pure Bootstrap 5+ which does not contain any external style and script libraries.",
7
7
  "repository": {
8
8
  "type": "git",