UNPKG

@httpx/assert

Version:
2 lines 602 B
import {isNumberSafeInt}from'./number.guards.mjs';import {isoDateTimeZRegexp}from'./string.utils.mjs';var s=t=>typeof t=="string"&&t.trim().length>0,a=/^-?\d+$/,p=t=>{if(typeof t!="string")return false;let e=a.test(t)?Number.parseInt(t,10):t;return isNumberSafeInt(e)},f=t=>{if(!s(t)||t.length!==24||!isoDateTimeZRegexp.test(t))return false;try{return new Date(t).toISOString().toUpperCase()===t.toUpperCase()}catch{return false}};export{p as isParsableSafeInt,f as isParsableStrictIsoDateZ,s as isStringNonEmpty};//# sourceMappingURL=string.guards.mjs.map //# sourceMappingURL=string.guards.mjs.map