diffusion
Version:
Diffusion JavaScript client
59 lines (58 loc) • 2.59 kB
JavaScript
;
/**
* @module Services.Authentication
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityCommandScriptSerialiser = exports.SecurityCommandScriptSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var security_command_script_1 = require("./security-command-script");
/**
* Serialiser for {@link SecurityCommandScript}
*/
var SecurityCommandScriptSerialiserClass = /** @class */ (function (_super) {
__extends(SecurityCommandScriptSerialiserClass, _super);
function SecurityCommandScriptSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link SecurityCommandScript} from the stream
*
* @param bis the input stream
* @return the {@link SecurityCommandScript} that was read
*/
SecurityCommandScriptSerialiserClass.prototype.read = function (input) {
var script = Codec.readString(input);
return new security_command_script_1.SecurityCommandScript(script);
};
/**
* Write a {@link SecurityCommandScript} to the stream
*
* @param bis the input stream
* @param value the {@link SecurityCommandScript} to be written
*/
SecurityCommandScriptSerialiserClass.prototype.write = function (output, value) {
Codec.writeString(output, value.script);
};
return SecurityCommandScriptSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.SecurityCommandScriptSerialiserClass = SecurityCommandScriptSerialiserClass;
/**
* The {@link SecurityCommandScriptSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.SecurityCommandScriptSerialiser = new SecurityCommandScriptSerialiserClass();