MCPcopy
hub / github.com/codeceptjs/CodeceptJS / clearString

Function clearString

lib/utils.js:144–163  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

142}
143
144export const clearString = function (str) {
145 if (!str) return ''
146 /* Replace forbidden symbols in string
147 */
148 if (str.endsWith('.')) {
149 str = str.slice(0, -1)
150 }
151 return str
152 .replace(/ /g, '_')
153 .replace(/"/g, "'")
154 .replace(/\//g, '_')
155 .replace(/</g, '(')
156 .replace(/>/g, ')')
157 .replace(/:/g, '_')
158 .replace(/\\/g, '_')
159 .replace(/\|/g, '_')
160 .replace(/\?/g, '.')
161 .replace(/\*/g, '^')
162 .replace(/'/g, '')
163}
164
165export const decodeUrl = function (url) {
166 /* Replace forbidden symbols in string

Callers 10

testToFileNameFunction · 0.90
persistFunction · 0.90
generateStepPrefixFunction · 0.90
traceDirForFunction · 0.90
executeRunFunction · 0.90
amOnPageMethod · 0.90
_beforeMethod · 0.90
saveVideoForPageFunction · 0.90
saveTraceForContextFunction · 0.90
genTestIdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected