@serenity-js/core
Version:
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
27 lines • 679 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Photo = void 0;
const Artifact_1 = require("../Artifact");
/**
* @public
* @extends {Artifact}
*/
class Photo extends Artifact_1.Artifact {
static fromBase64(value) {
return new Photo(value);
}
static fromBuffer(value) {
const buffer = value instanceof ArrayBuffer
? Buffer.from(value)
: value;
return Photo.fromBase64(buffer.toString('base64'));
}
/**
* @param fn
*/
map(fn) {
return fn(Buffer.from(this.base64EncodedValue, 'base64'));
}
}
exports.Photo = Photo;
//# sourceMappingURL=Photo.js.map
;