-
-
Notifications
You must be signed in to change notification settings - Fork 536
Expand file tree
/
Copy pathstrip.js
More file actions
24 lines (22 loc) · 602 Bytes
/
strip.js
File metadata and controls
24 lines (22 loc) · 602 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* Remove text inside double quotes `""` from the input string.
*
* @param {string} text The input string.
* @returns {string} The string with text inside double quotes `""` removed.
*/
function stripDoubleQuotes(text) {
return text.replace(/"[^"]*"/g, '');
}
/**
* Remove text inside parentheses `()` from the input string.
*
* @param {string} text The input string.
* @returns {string} The string with text inside parentheses `()` removed.
*/
function stripParentheses(text) {
return text.replace(/\([^)]*\)/g, '');
}
module.exports = {
stripDoubleQuotes,
stripParentheses,
};