MCPcopy Create free account
hub / github.com/cryptii/cryptii / _inverseCase

Method _inverseCase

src/Encoder/CaseTransform.js:112–121  ·  view source on GitHub ↗

* Inverses the case of each character. * @param {Chain} content Content to be transformed * @return {Chain} Transformed content

(content)

Source from the content-addressed store, hash-verified

110 * @return {Chain} Transformed content
111 */
112 _inverseCase (content) {
113 return Chain.wrap(
114 content.getChars()
115 .map(char => {
116 const lowerChar = char.toLowerCase()
117 return char !== lowerChar ? lowerChar : char.toUpperCase()
118 })
119 .join('')
120 )
121 }
122}

Callers 2

performEncodeMethod · 0.95
performDecodeMethod · 0.95

Calls 5

wrapMethod · 0.80
joinMethod · 0.80
getCharsMethod · 0.80
toLowerCaseMethod · 0.80
toUpperCaseMethod · 0.80

Tested by

no test coverage detected