mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Optimize _.unescape.
This commit is contained in:
6
dist/lodash.js
vendored
6
dist/lodash.js
vendored
@@ -6411,7 +6411,11 @@
|
||||
* // => 'Fred, Barney & Pebbles'
|
||||
*/
|
||||
function unescape(string) {
|
||||
return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
|
||||
if (string == null) {
|
||||
return '';
|
||||
}
|
||||
string = String(string);
|
||||
return string.indexOf(';') < 0 ? string : string.replace(reEscapedHtml, unescapeHtmlChar);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user