wranglebot
Version:
open source media asset management
27 lines (24 loc) • 681 B
text/typescript
class SendBack {
status;
message;
result;
error;
/**
* @typedef {Object} SendBackOptions
* @property {200|300|305|400|404|500} status
* @property {string?} message
* @property {any?} result
* @property {Error?} error
*/
/**
* Creates a SendBack Object
* @param {SendBackOptions} options
*/
constructor(options: { status: number; message: string; result?: any; error?: Error }) {
this.status = options.status ? options.status : 500;
this.message = options.message ? options.message : "";
this.result = options.result ? options.result : {};
this.error = options.error ? options.error : false;
}
}
export default SendBack;