mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Remove toString coercion method use.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import toString from './toString.js'
|
||||
|
||||
/** Used to map HTML entities to characters. */
|
||||
const htmlUnescapes = {
|
||||
'&': '&',
|
||||
@@ -32,7 +30,6 @@ const reHasEscapedHtml = RegExp(reEscapedHtml.source)
|
||||
* // => 'fred, barney, & pebbles'
|
||||
*/
|
||||
function unescape(string) {
|
||||
string = toString(string)
|
||||
return (string && reHasEscapedHtml.test(string))
|
||||
? string.replace(reEscapedHtml, (entity) => htmlUnescapes[entity])
|
||||
: string
|
||||
|
||||
Reference in New Issue
Block a user