We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9943609 commit f03a999Copy full SHA for f03a999
csaf_2_1/mandatoryTests/mandatoryTest_6_1_44.js
@@ -78,13 +78,19 @@ const validate = ajv.compile(inputSchema)
78
*/
79
80
/**
81
+ * Checks if the `stringToCheck` includes more than one unescaped `*` character. A `*` character
82
+ * can be escaped by prefixing it with a backslash (`\`).
83
*
84
* @param {string} stringToCheck
85
* @return {boolean}
86
87
export function containMultipleUnescapedStars(stringToCheck) {
88
const regex = /\*/g
- return (stringToCheck.replace(/\\\*/g, '').match(regex)?.length ?? 0) > 1
89
+ return (
90
+ (stringToCheck
91
+ .replace(/\\\*/g, '') // remove escaped '*'
92
+ .match(regex)?.length ?? 0) > 1 // check if there is more than 1 unescaped '*'
93
+ )
94
}
95
96
0 commit comments