kitten-cloud-function
Version:
用于编程猫源码云功能(云变量、云列表等)的客户端工具
33 lines (32 loc) • 1.23 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.KittenCloudData = void 0;
const kitten_cloud_function_config_layer_1 = require("../kitten-cloud-function-config-layer");
const kitten_cloud_data_update_manager_1 = require("./update/kitten-cloud-data-update-manager");
/**
* 云数据。
*/
class KittenCloudData extends kitten_cloud_function_config_layer_1.KittenCloudFunctionConfigLayer {
constructor(connection, group, cvid, name) {
super(group);
this.connection = connection;
this.group = group;
this.cvid = cvid;
this.name = name;
this.updateManager = new kitten_cloud_data_update_manager_1.KittenCloudDataUpdateManager(connection, this);
}
singleValueProcess(value) {
if (typeof value == "number") {
return value;
}
if (typeof value != "string") {
throw new Error(`不支持的值类型:${typeof value}`);
}
let stringValue = value;
if (stringValue.length > this.stringLengthLimit.value) {
stringValue = stringValue.slice(0, this.stringLengthLimit.value);
}
return stringValue;
}
}
exports.KittenCloudData = KittenCloudData;
;