MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / humanizeArgs

Method humanizeArgs

lib/step/base.js:110–145  ·  view source on GitHub ↗

@return {string}

()

Source from the content-addressed store, hash-verified

108
109 /** @return {string} */
110 humanizeArgs() {
111 return this.args
112 .map(arg => {
113 if (!arg) {
114 return ''
115 }
116 if (typeof arg === 'string') {
117 return `"${arg}"`
118 }
119 if (Array.isArray(arg)) {
120 try {
121 const res = JSON.stringify(arg)
122 return res
123 } catch (err) {
124 return `[${arg.toString()}]`
125 }
126 } else if (typeof arg === 'function') {
127 return arg.toString()
128 } else if (typeof arg === 'undefined') {
129 return `${arg}`
130 } else if (arg instanceof Secret) {
131 return arg.getMasked()
132 } else if (arg.toString && arg.toString() !== '[object Object]') {
133 return arg.toString()
134 } else if (typeof arg === 'object') {
135 const returnedArg = {}
136 for (const [key, value] of Object.entries(arg)) {
137 returnedArg[key] = value
138 if (value instanceof Secret) returnedArg[key] = value.getMasked()
139 }
140 return JSON.stringify(returnedArg)
141 }
142 return arg
143 })
144 .join(', ')
145 }
146
147 /** @return {string} */
148 line() {

Callers 7

toStringMethod · 0.95
toCliStyledMethod · 0.95
toCodeMethod · 0.95
toStringMethod · 0.80
recordStepFunction · 0.80
toStringMethod · 0.80
steps_test.jsFile · 0.80

Calls 3

getMaskedMethod · 0.80
entriesMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected