@fruitsjs/core
Version:
Principal package with functions and models for building Fruits Eco-Blockchain applications.
17 lines • 645 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttachmentVersion = void 0;
function getAttachmentVersion(transaction) {
const { attachment } = transaction;
if (!attachment) {
return undefined;
}
const versionIdentifier = Object.keys(attachment).filter(k => k.startsWith('version'));
if (versionIdentifier.length === 0) {
return undefined;
}
const identifier = versionIdentifier[0];
return identifier.substr(identifier.indexOf('.') + 1);
}
exports.getAttachmentVersion = getAttachmentVersion;
//# sourceMappingURL=getAttachmentVersion.js.map