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(),stringUpperFirst=value=>(guardString(value),""===value?"":1===value.length?value.toUpperCase():value[0].toUpperCase()+value.slice(1)),stringTitleCase=value=>(guardString(value),value.split(" ").map(stringUpperFirst).join(" ").split("-").map(stringUpperFirst).join("-").split("'").map((val,ndx)=>1===ndx&&["d","ll","nt","s","t","ve"].includes(val)?val:stringUpperFirst(val)).join("'").trim());exports.stringTitleCase=stringTitleCase;