express-ext 0.5.1 → 0.5.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/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +6 -6
package/lib/index.js
CHANGED
|
@@ -328,7 +328,7 @@ function escapeHTML(input) {
|
|
|
328
328
|
exports.escapeHTML = escapeHTML
|
|
329
329
|
function generateChip(value, text, noClose, hasStar) {
|
|
330
330
|
var s = noClose ? "" : '<span class="close" onclick="removeChip(event)"></span>'
|
|
331
|
-
var t = hasStar ? '<i
|
|
331
|
+
var t = hasStar ? '<i class="star highlight"></i>' : ""
|
|
332
332
|
return '<div class="chip" data-value="' + escapeHTML(value) + '">' + escapeHTML(text) + t + s + "</div>"
|
|
333
333
|
}
|
|
334
334
|
exports.generateChip = generateChip
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -104,7 +104,7 @@ export class FollowController {
|
|
|
104
104
|
}
|
|
105
105
|
protected userId: string
|
|
106
106
|
protected id: string
|
|
107
|
-
follow(req: Request, res: Response)
|
|
107
|
+
follow(req: Request, res: Response) {
|
|
108
108
|
const userId: string = res.locals[this.userId]
|
|
109
109
|
const id = req.params[this.id]
|
|
110
110
|
if (!id || id.length === 0) {
|
|
@@ -121,7 +121,7 @@ export class FollowController {
|
|
|
121
121
|
})
|
|
122
122
|
.catch((err) => handleError(err, res, this.log))
|
|
123
123
|
}
|
|
124
|
-
unfollow(req: Request, res: Response)
|
|
124
|
+
unfollow(req: Request, res: Response) {
|
|
125
125
|
const userId: string = res.locals[this.userId]
|
|
126
126
|
const id = req.params[this.id]
|
|
127
127
|
if (!id || id.length === 0) {
|
|
@@ -153,7 +153,7 @@ export class UserReactionController {
|
|
|
153
153
|
this.checkReaction = this.checkReaction.bind(this)
|
|
154
154
|
}
|
|
155
155
|
id: string
|
|
156
|
-
react(req: Request, res: Response)
|
|
156
|
+
react(req: Request, res: Response) {
|
|
157
157
|
const id = req.params.id
|
|
158
158
|
const author = req.params.author
|
|
159
159
|
const reaction = req.params.reaction
|
|
@@ -176,7 +176,7 @@ export class UserReactionController {
|
|
|
176
176
|
})
|
|
177
177
|
.catch((err) => handleError(err, res, this.log))
|
|
178
178
|
}
|
|
179
|
-
unreact(req: Request, res: Response)
|
|
179
|
+
unreact(req: Request, res: Response) {
|
|
180
180
|
const id = req.params.id
|
|
181
181
|
const author = req.params.author
|
|
182
182
|
const reaction = req.params.reaction
|
|
@@ -199,7 +199,7 @@ export class UserReactionController {
|
|
|
199
199
|
})
|
|
200
200
|
.catch((err) => handleError(err, res, this.log))
|
|
201
201
|
}
|
|
202
|
-
checkReaction(req: Request, res: Response)
|
|
202
|
+
checkReaction(req: Request, res: Response) {
|
|
203
203
|
const id = req.params.id
|
|
204
204
|
const author = req.params.author
|
|
205
205
|
if (!id || id.length === 0) {
|
|
@@ -314,7 +314,7 @@ export function escapeHTML(input: string): string {
|
|
|
314
314
|
}
|
|
315
315
|
export function generateChip(value: string, text: string, noClose?: boolean, hasStar?: boolean): string {
|
|
316
316
|
const s = noClose ? "" : `<span class="close" onclick="removeChip(event)"></span>`
|
|
317
|
-
const t = hasStar ? `<i
|
|
317
|
+
const t = hasStar ? `<i class="star highlight"></i>` : ""
|
|
318
318
|
return `<div class="chip" data-value="${escapeHTML(value)}">${escapeHTML(text)}${t}${s}</div>`
|
|
319
319
|
}
|
|
320
320
|
export function generateTags(v?: string[] | null, noClose?: boolean): string {
|