easy-api.ts
Version:
A powerful library to create your own API with ease.
1 lines • 1.14 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0});let APIFunction_1=require("../../classes/structures/APIFunction"),Util_1=require("../../classes/internal/Util");class StringReplace extends APIFunction_1.APIFunction{name="$stringReplace";description="Returns whether the given text starts with the provided word.";parameters=[{name:"Text",description:"The text to work with.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Match",description:"The word to be matched.",type:APIFunction_1.ParamType.String,required:!0,rest:!1,defaultValue:null},{name:"Replacer",description:"The word to replace the match with.",type:APIFunction_1.ParamType.String,required:!1,rest:!1,defaultValue:" "},{name:"Strict",description:"Whether strictly replace all ocurrences.",type:APIFunction_1.ParamType.Boolean,required:!1,rest:!1,defaultValue:"true"}];usage="$stringReplace[text;word;replacer?;strict?]";returns=APIFunction_1.ParamType.String;aliases=["$replace","$replaceText"];compile=!0;async run(e,[t,r,a="",n="true"]){return t[Util_1.Util.booleanify(n)?"replaceAll":"replace"](r,a)}}exports.default=StringReplace;