{"version":3,"sources":["../src/restrictedProp.js"],"names":["customMessageWrapper","messsageFunction","restrictedProp","props","propName","componentName","location","rest","TypeError","isRequired"],"mappings":";;;;;;;AAAA;;;;AAEA,SAASA,oBAAT,CAA8BC,gBAA9B,EAAgD;AAC9C,WAASC,cAAT,CAAwBC,KAAxB,EAA+BC,QAA/B,EAAyCC,aAAzC,EAAwDC,QAAxD,EAA2E;AACzE,QAAIH,KAAK,CAACC,QAAD,CAAL,IAAmB,IAAvB,EAA6B;AAC3B,aAAO,IAAP;AACD;;AAED,QAAIH,gBAAgB,IAAI,OAAOA,gBAAP,KAA4B,UAApD,EAAgE;AAAA,wCALGM,IAKH;AALGA,QAAAA,IAKH;AAAA;;AAC9D,aAAO,IAAIC,SAAJ,CAAcP,gBAAgB,MAAhB,UAAiBE,KAAjB,EAAwBC,QAAxB,EAAkCC,aAAlC,EAAiDC,QAAjD,SAA8DC,IAA9D,EAAd,CAAP;AACD;;AACD,WAAO,IAAIC,SAAJ,eAAqBJ,QAArB,cAAiCE,QAAjC,iBAAgDD,aAAhD,sBAAP;AACD;;AACDH,EAAAA,cAAc,CAACO,UAAf,GAA4BP,cAA5B;AACA,SAAOA,cAAP;AACD;;eAEc;AAAA,MAACD,gBAAD,uEAAoB,IAApB;AAAA,SAA6B,+BAAcD,oBAAoB,CAACC,gBAAD,CAAlC,EAAsD,gBAAtD,CAA7B;AAAA,C","sourcesContent":["import wrapValidator from './helpers/wrapValidator';\n\nfunction customMessageWrapper(messsageFunction) {\n function restrictedProp(props, propName, componentName, location, ...rest) {\n if (props[propName] == null) {\n return null;\n }\n\n if (messsageFunction && typeof messsageFunction === 'function') {\n return new TypeError(messsageFunction(props, propName, componentName, location, ...rest));\n }\n return new TypeError(`The ${propName} ${location} on ${componentName} is not allowed.`);\n }\n restrictedProp.isRequired = restrictedProp;\n return restrictedProp;\n}\n\nexport default (messsageFunction = null) => wrapValidator(customMessageWrapper(messsageFunction), 'restrictedProp');\n"],"file":"restrictedProp.js"}