kitten-cloud-function
Version:
用于编程猫源码云功能(云变量、云列表等)的客户端工具
25 lines (24 loc) • 691 B
JavaScript
import { None } from "../../../../utils/other";
export class KittenCloudDataUpdateCommand {
constructor(source, data) {
this.source = source;
this.data = data;
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
});
}
finish() {
this.resolve();
}
fail(error) {
error.message = `${this.toString()}失败:${error.message}`;
if (error.stack != None) {
error.stack = `${this.toString()}失败:${error.stack}`;
}
this.reject(error);
}
toCloudString() {
return JSON.stringify(this.toCloudJSON());
}
}