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

Method extractValue

src/Field/Byte.js:152–159  ·  view source on GitHub ↗

* Extracts a value serialized by Field.serializeValue and returns it. * @param {mixed} data Serialized data * @return {mixed} Extracted value

(data)

Source from the content-addressed store, hash-verified

150 * @return {mixed} Extracted value
151 */
152 extractValue (data) {
153 if (typeof data !== 'string') {
154 throw new Error(
155 `Value of field '${this.getName()}' is expected to be a valid ` +
156 'base64 string.')
157 }
158 return ByteEncoder.bytesFromBase64String(data)
159 }
160
161 /**
162 * Triggered when value has been changed inside the view.

Callers

nothing calls this directly

Calls 2

bytesFromBase64StringMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected