MCPcopy Index your code
hub / github.com/actions/toolkit / toString

Method toString

packages/core/src/command.ts:49–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 }
48
49 toString(): string {
50 let cmdStr = CMD_PREFIX + this.command
51
52 if (this.properties && Object.keys(this.properties).length > 0) {
53 cmdStr += ' '
54 for (const key in this.properties) {
55 if (this.properties.hasOwnProperty(key)) {
56 const val = this.properties[key]
57 if (val) {
58 // safely append the val - avoid blowing up when attempting to
59 // call .replace() if message is not a string for some reason
60 cmdStr += `${key}=${escape(`${val || ''}`)};`
61 }
62 }
63 }
64 }
65
66 cmdStr += ']'
67
68 // safely append the message - avoid blowing up when attempting to
69 // call .replace() if message is not a string for some reason
70 const message = `${this.message || ''}`
71 cmdStr += escapeData(message)
72
73 return cmdStr
74 }
75}
76
77function escapeData(s: string): string {

Callers 4

issueCommandFunction · 0.95
_processLineBufferMethod · 0.80
exec.test.tsFile · 0.80
tool-cache.test.tsFile · 0.80

Calls 2

escapeFunction · 0.85
escapeDataFunction · 0.85

Tested by

no test coverage detected