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 isInteger=value=>{try{return"[object Number]"===Object.prototype.toString.call(value)&&value%1==0}catch{return!1}},defaultOptions$1={min:void 0,max:void 0},guardIntegerHOF=(options={})=>{let config={...defaultOptions$1,...options};return value=>{var error;if(!isInteger(value))throw(error=new ZeroDepError("Value is not an integer")).value=value,error;if(void 0!==config.min&&valueconfig.max){let error=new ZeroDepError("Integer is greater than "+config.max);throw error.value=value,error}}},isString=(guardIntegerHOF(),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(),isBigInt=value=>{try{return"bigint"==typeof value}catch{return!1}},isNumber=value=>{try{return"[object Number]"===Object.prototype.toString.call(value)&&Math.abs(value)!==1/0&&!Number.isNaN(value)}catch{return!1}},guardInteger=guardIntegerHOF({min:1}),stringPadLeft=(value,size,char=" ")=>{if(isString(value)||isNumber(value)||isBigInt(value))return guardInteger(size),guardString(char),(isString(value)?value:value.toString()).padStart(size,char);throw new ZeroDepError("Value is not a string, number or BigInt")};exports.stringPadLeft=stringPadLeft;