@ttahub/common 2.0.19 → 2.1.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/README.md +3 -0
- package/package.json +1 -1
- package/src/utils.js +19 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/utils.js
CHANGED
|
@@ -30,6 +30,24 @@ function determineMergeGoalStatus(statuses) {
|
|
|
30
30
|
return GOAL_STATUS.DRAFT;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const entityMap = {
|
|
34
|
+
'<': '<',
|
|
35
|
+
'>': '>',
|
|
36
|
+
'&': '&',
|
|
37
|
+
'"': '"',
|
|
38
|
+
"'": ''',
|
|
39
|
+
'/': '/',
|
|
40
|
+
'[': '[',
|
|
41
|
+
']': ']',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function escapeHtml(str) {
|
|
45
|
+
return str.replace(/[<>&"'\/]/g, function (s) {
|
|
46
|
+
return entityMap[s];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
33
50
|
module.exports = {
|
|
34
|
-
determineMergeGoalStatus
|
|
51
|
+
determineMergeGoalStatus,
|
|
52
|
+
escapeHtml,
|
|
35
53
|
}
|