Comparing version 0.8.39 to 0.8.40
@@ -117,2 +117,18 @@ 'use strict'; | ||
return str.replace(/(^\s*)|(\s*$)/g, "") | ||
} | ||
} | ||
/** | ||
* @desc: 对字符串中的 <>空格"& 标签进行转义为 <, > | ||
* @return: string. | ||
*/ | ||
exports.escapeHtml = function(str) { | ||
// 转义. | ||
if (str) { | ||
str = exports.replace(str, '&', '&'); | ||
str = exports.replace(str, '<', '<'); | ||
str = exports.replace(str, '>', '>'); | ||
str = exports.replace(str, ' ', ' '); | ||
str = exports.replace(str, '"', '"'); | ||
} | ||
return str||''; | ||
} |
@@ -43,9 +43,2 @@ 'use strict'; | ||
*/ | ||
exports.escapeHtml = function(str) { | ||
// 转义. | ||
if (str) { | ||
str = string.replace(str, '<', '<'); | ||
str = string.replace(str, '>', '>'); | ||
} | ||
return str||''; | ||
} | ||
exports.escapeHtml = string.escapeHtml; |
@@ -403,3 +403,3 @@ febs 库是一些常用的工具的合集; | ||
/** | ||
* @desc: 对字符串中的 <> 标签进行转义为 <, > | ||
* @desc: 对字符串中的 <>空格"& 标签进行转义为 & lt;, & gt; | ||
* @return: string. | ||
@@ -406,0 +406,0 @@ */ |
@@ -279,5 +279,5 @@ // Type definitions for febs | ||
function trim(str: string): string; | ||
/** | ||
* @desc: 对字符串中的 <> 标签进行转义为 <, > | ||
* @desc: 对字符串中的 <>空格"& 标签进行转义为 <, > | ||
* @return: string. | ||
@@ -284,0 +284,0 @@ */ |
@@ -86,3 +86,3 @@ { | ||
"name": "febs", | ||
"version": "0.8.39" | ||
"version": "0.8.40" | ||
} |
@@ -380,8 +380,5 @@ febs 库是一些常用的工具的合集; | ||
febs.string.trim(str: string) : string; | ||
``` | ||
客户端独有. | ||
```js | ||
/** | ||
* @desc: 对字符串中的 <> 标签进行转义为 <, > | ||
* @desc: 对字符串中的 <>空格"& 标签进行转义为 & lt;, & gt; | ||
* @return: string. | ||
@@ -388,0 +385,0 @@ */ |
@@ -41,1 +41,3 @@ 'use strict'; | ||
exports.trim = string.trim; | ||
exports.escapeHtml = string.escapeHtml; |
@@ -294,2 +294,8 @@ // Type definitions for febs | ||
function trim(str: string) : string; | ||
/** | ||
* @desc: 对字符串中的 <>空格 标签进行转义为 <, > | ||
* @return: string. | ||
*/ | ||
function escapeHtml(str: string): string; | ||
} | ||
@@ -296,0 +302,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4442266
79
44630
3
872