class ZeroDepError extends Error{category;source;value;constructor(message="An unexpected error has occurred",category="unknown",source="unknown",value=void 0){super(message),this.category=category,this.source=source,this.value=value,this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}}let isString=value=>{try{return"[object String]"===Object.prototype.toString.call(value)}catch{return!1}},defaultOptions={minLength:void 0,maxLength:void 0},guardStringHOF=(options={})=>{let config={...defaultOptions,...options};return value=>{var error;if(!isString(value))throw(error=new ZeroDepError("Value is not a string")).value=value,error;if(void 0!==config.minLength&&value.lengthconfig.maxLength){let error=new ZeroDepError(`String is longer than ${config.maxLength} character(s)`);throw error.value=value,error}}},guardString=guardStringHOF(),stringTrimLeft=(value,char="")=>{return guardString(value),""===char?value.trimStart():(char=[".","?"].includes(char)?"\\"+char:char,char=new RegExp(`^${char}+`),value.replace(char,""))};exports.stringTrimLeft=stringTrimLeft;