inferno-shared
Version:
Helpers functions for Inferno
2 lines (1 loc) • 1.44 kB
JavaScript
!function(e,n){"object"===typeof exports&&"undefined"!==typeof module?n(exports):"function"===typeof define&&define.amd?define(["exports"],n):n((e="undefined"!==typeof globalThis?globalThis:e||self).Inferno=e.Inferno||{})}(this,function(e){"use strict";var n="a runtime error occured! Use Inferno in development environment to find the error.",r=Array.isArray;function t(e){return null===e}var o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0,name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0};e.ERROR_MSG=n,e.hoistStaticProperties=function(e,n){for(var r=Object.getOwnPropertyNames(n),t=0;t<r.length;++t){var i=r[t];o[i]||(e[i]=n[i])}},e.isArray=r,e.isFunction=function(e){return"function"===typeof e},e.isInvalid=function(e){return null===e||!1===e||!0===e||void 0===e},e.isNull=t,e.isNullOrUndef=function(e){return void 0===e||null===e},e.isNumber=function(e){return"number"===typeof e},e.isString=function(e){return"string"===typeof e},e.isStringOrNumber=function(e){var n=typeof e;return"string"===n||"number"===n},e.isUndefined=function(e){return void 0===e},e.isValidElement=function(e){if("object"!==typeof e||t(e))return!1;return(495&e.flags)>0},e.throwError=function(e){throw e||(e=n),new Error("Inferno Error: "+e)},e.warning=function(e){console.error(e)}});