xiot-core-spec-ts
Version:
XIOT Specification Codec
26 lines (25 loc) • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionImageCodec = void 0;
const ActionImage_1 = require("../../typedef/image/ActionImage");
const Spec_1 = require("../../typedef/constant/Spec");
const ActionType_1 = require("../../typedef/definition/urn/ActionType");
const DescriptionCodec_1 = require("../definition/DescriptionCodec");
const ArgumentImageCodec_1 = require("./ArgumentImageCodec");
class ActionImageCodec {
static decodeArray(array) {
const list = [];
if (array != null) {
for (const o of array) {
const iid = o[Spec_1.Spec.IID];
const type = new ActionType_1.ActionType(o[Spec_1.Spec.TYPE]);
const description = DescriptionCodec_1.DescriptionCodec.decode(o[Spec_1.Spec.DESCRIPTION]);
const argumentsIn = ArgumentImageCodec_1.ArgumentImageCodec.decodeArray(o[Spec_1.Spec.IN]);
const argumentsOut = ArgumentImageCodec_1.ArgumentImageCodec.decodeArray(o[Spec_1.Spec.OUT]);
list.push(new ActionImage_1.ActionImage(iid, type, description, argumentsIn, argumentsOut));
}
}
return list;
}
}
exports.ActionImageCodec = ActionImageCodec;