ran npm run tdd & generated TDD
This commit is contained in:
12
test/escapeHTML/escapeHTML.js
Normal file
12
test/escapeHTML/escapeHTML.js
Normal file
@ -0,0 +1,12 @@
|
||||
module.exports = str =>
|
||||
str.replace(
|
||||
/[&<>'"]/g,
|
||||
tag =>
|
||||
({
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
"'": ''',
|
||||
'"': '"'
|
||||
}[tag] || tag)
|
||||
);
|
||||
Reference in New Issue
Block a user