mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Remove toString coercion method use.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import toString from './toString.js'
|
||||
|
||||
/** Used to map characters to HTML entities. */
|
||||
const htmlEscapes = {
|
||||
'&': '&',
|
||||
@@ -41,7 +39,6 @@ const reHasUnescapedHtml = RegExp(reUnescapedHtml.source)
|
||||
* // => 'fred, barney, & pebbles'
|
||||
*/
|
||||
function escape(string) {
|
||||
string = toString(string)
|
||||
return (string && reHasUnescapedHtml.test(string))
|
||||
? string.replace(reUnescapedHtml, (chr) => htmlEscapes[chr])
|
||||
: string
|
||||
|
||||
Reference in New Issue
Block a user