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

Method getVariantOptions

src/Encoder/Base64.js:170–183  ·  view source on GitHub ↗

* Returns the current variant options. * @return {object} Variant options

()

Source from the content-addressed store, hash-verified

168 * @return {object} Variant options
169 */
170 getVariantOptions () {
171 const name = this.getSettingValue('variant')
172 if (name === 'custom') {
173 // Compose custom options
174 return {
175 alphabet: this.getSettingValue('alphabet').getString(),
176 padding: this.getSettingValue('padding').getCharAt(0),
177 paddingOptional: this.getSettingValue('paddingOptional')
178 }
179 }
180
181 // Find variant options
182 return variants.find(variant => variant.name === name)
183 }
184}

Callers 2

performEncodeMethod · 0.95
performDecodeMethod · 0.95

Calls 3

getSettingValueMethod · 0.80
getStringMethod · 0.80
getCharAtMethod · 0.80

Tested by

no test coverage detected