UNPKG

pure-parse

Version:

Strongly typed validation library that decouples type aliases from validation logic

2 lines (1 loc) 254 B
import{isObject as r}from"../guards/primitives.js";const s=o=>{const e=new WeakMap;return t=>{if(!r(t))return o(t);if(e.has(t))return e.get(t);const n=o(t);return e.set(t,n),n}},m=o=>(...e)=>s(o(...e));export{s as memo,m as memoizeValidatorConstructor};