easy-api.ts
Version:
A powerful library to create your own API with ease.
1 lines • 1.02 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});let tslib_1=require("tslib"),Error_1=require("../../classes/structures/Error"),APIFunction_1=require("../../classes/structures/APIFunction"),lodash_1=tslib_1.__importDefault(require("lodash"));class DeleteObjectKey extends APIFunction_1.APIFunction{name="$deleteObjectKey";description="Deletes a property from an object.";parameters=[{name:"Name",description:"The name of the object to delete the property from.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Key",description:"Property key to be deleted.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null}];usage="$deleteObjectKey[name;property]";returns=APIFunction_1.ParamType.Unknown;aliases=[];compile=!0;async run(e,[r,t]){if(e.internalVarExists("EATS_OBJ_"+r))return String(lodash_1.default.unset(e.getInternalVar("EATS_OBJ_"+r),t));throw new Error_1.InvalidVariableName(Error_1.VariableType.Object,r,e.function)}}exports.default=DeleteObjectKey;