UNPKG

valibot-schema-semver

Version:
1 lines 427 B
import {valid,validRange}from'semver';import {custom}from'valibot';var o=e=>typeof e=="string"&&!!valid(e),u=e=>`Invalid type: Expected Semantic Versioning received ${e.received}`,m=e=>typeof e=="string"&&!!validRange(e),a=e=>`Invalid type: Expected Semantic Versioning range received ${e.received}`,c=e=>custom(o,typeof e=="string"?()=>e:e||u),i=e=>custom(m,typeof e=="string"?()=>e:e||a);export{c as semver,i as semverRange};