express-sweet 2.0.4 → 2.0.5
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/CHANGELOG.md +22 -2
- package/README.md +31 -4
- package/dist/build.cjs +5 -5
- package/dist/build.mjs +1 -1
- package/package.json +3 -2
- package/types/handlebars_helpers/array.d.ts +1 -1
- package/types/handlebars_helpers/html.d.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-sweet",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "EXPRESS SWEET is a powerful Express.js extension that streamlines your workflow and boosts productivity with a suite of utilities and enhancements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/build.cjs",
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
"passport": "^0.7.0",
|
|
83
83
|
"passport-local": "^1.0.0",
|
|
84
84
|
"redis": "^4.6.8",
|
|
85
|
-
"sequelize": "^6.37.1"
|
|
85
|
+
"sequelize": "^6.37.1",
|
|
86
|
+
"striptags": "^3.2.0"
|
|
86
87
|
},
|
|
87
88
|
"devDependencies": {
|
|
88
89
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @return {object|null} The first object in the array that matches the criteria, or null if no match is found.
|
|
7
7
|
* @example
|
|
8
8
|
* {{!--
|
|
9
|
-
* items is an array of objects: [{
|
|
9
|
+
* items is an array of objects: [{id: 123, name: 'Item A'}, {id: 456, name: 'Item B'}]
|
|
10
10
|
* This code will output: "Item A"
|
|
11
11
|
* --}}
|
|
12
12
|
* {{#each items}}
|
|
@@ -8,3 +8,20 @@
|
|
|
8
8
|
* {{cacheBusting '/assets/style.css' '//example.com'}}
|
|
9
9
|
*/
|
|
10
10
|
export declare const cacheBusting: (filePath: string, baseUrl?: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Removes HTML tags from a string, optionally allowing specific tags.
|
|
13
|
+
* @param {string} str The string to remove HTML tags from.
|
|
14
|
+
* @param {string|string[]} allowedTags An array of allowed HTML tags. Default is an empty array.
|
|
15
|
+
* @param {string} replacement The string to replace HTML tags with. Default is blank.
|
|
16
|
+
* @return {string} The string with HTML tags removed.
|
|
17
|
+
* @example
|
|
18
|
+
* {{!-- results in: lorem ipsum dolor sit amet --}}
|
|
19
|
+
* {{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>'}}}
|
|
20
|
+
*
|
|
21
|
+
* {{!-- results in: lorem ipsum <strong>dolor</strong> sit amet --}}
|
|
22
|
+
* {{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>' '<strong>' ''}}}
|
|
23
|
+
*
|
|
24
|
+
* {{!-- results in: 🍩lorem ipsum 🍩dolor🍩 🍩sit🍩 amet🍩 --}}
|
|
25
|
+
* {{{stripTags '<a href="https://example.com">lorem ipsum <strong>dolor</strong> <em>sit</em> amet</a>' [] '🍩'}}}
|
|
26
|
+
*/
|
|
27
|
+
export declare const stripTags: (str: string, allowedTags?: string | string[], replacement?: string) => string;
|