inferno-shared
Advanced tools
Comparing version 8.2.3 to 9.0.0-alpha.1
@@ -13,3 +13,2 @@ export declare const ERROR_MSG = "a runtime error occured! Use Inferno in development environment to find the error."; | ||
export declare function warning(message: string): void; | ||
export declare function combineFrom<A, B>(first: A, second: B): A & B; | ||
export declare const emptyFn: () => void; | ||
export declare function hoistStaticProperties(targetComponent: any, sourceComponent: any): void; |
@@ -41,25 +41,38 @@ (function (global, factory) { | ||
function warning(message) { | ||
// tslint:disable-next-line:no-console | ||
console.error(message); | ||
} | ||
function combineFrom(first, second) { | ||
var out = {}; | ||
if (first) { | ||
for (var key in first) { | ||
out[key] = first[key]; | ||
var KNOWN_STATICS = { | ||
childContextTypes: true, | ||
contextType: true, | ||
contextTypes: true, | ||
defaultProps: true, | ||
displayName: true, | ||
getDefaultProps: true, | ||
getDerivedStateFromError: true, | ||
getDerivedStateFromProps: true, | ||
mixins: true, | ||
propTypes: true, | ||
type: true, | ||
// KNOWN STATICS | ||
name: true, | ||
length: true, | ||
prototype: true, | ||
caller: true, | ||
callee: true, | ||
arguments: true, | ||
arity: true | ||
}; | ||
function hoistStaticProperties(targetComponent, sourceComponent) { | ||
// don't hoist over string (html) components | ||
var keys = Object.getOwnPropertyNames(sourceComponent); | ||
for (var i = 0; i < keys.length; ++i) { | ||
var key = keys[i]; | ||
if (!KNOWN_STATICS[key]) { | ||
targetComponent[key] = sourceComponent[key]; | ||
} | ||
} | ||
if (second) { | ||
for (var _key in second) { | ||
out[_key] = second[_key]; | ||
} | ||
} | ||
return out; | ||
} | ||
// tslint:disable-next-line:no-empty | ||
var emptyFn = function emptyFn() {}; | ||
exports.ERROR_MSG = ERROR_MSG; | ||
exports.combineFrom = combineFrom; | ||
exports.emptyFn = emptyFn; | ||
exports.hoistStaticProperties = hoistStaticProperties; | ||
exports.isArray = isArray; | ||
@@ -66,0 +79,0 @@ exports.isFunction = isFunction; |
@@ -1,1 +0,1 @@ | ||
!function(n,r){"object"===typeof exports&&"undefined"!==typeof module?r(exports):"function"===typeof define&&define.amd?define(["exports"],r):r((n="undefined"!==typeof globalThis?globalThis:n||self).Inferno=n.Inferno||{})}(this,(function(n){"use strict";var r="a runtime error occured! Use Inferno in development environment to find the error.",e=Array.isArray;n.ERROR_MSG=r,n.combineFrom=function(n,r){var e={};if(n)for(var o in n)e[o]=n[o];if(r)for(var i in r)e[i]=r[i];return e},n.emptyFn=function(){},n.isArray=e,n.isFunction=function(n){return"function"===typeof n},n.isInvalid=function(n){return null===n||!1===n||!0===n||void 0===n},n.isNull=function(n){return null===n},n.isNullOrUndef=function(n){return void 0===n||null===n},n.isNumber=function(n){return"number"===typeof n},n.isString=function(n){return"string"===typeof n},n.isStringOrNumber=function(n){var r=typeof n;return"string"===r||"number"===r},n.isUndefined=function(n){return void 0===n},n.throwError=function(n){throw n||(n=r),new Error("Inferno Error: "+n)},n.warning=function(n){console.error(n)}})); | ||
!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,t={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),o=0;o<r.length;++o){var i=r[o];t[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=function(e){return null===e},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.throwError=function(e){throw e||(e=n),new Error("Inferno Error: "+e)},e.warning=function(e){console.error(e)}})); |
{ | ||
"name": "inferno-shared", | ||
"version": "8.2.3", | ||
"version": "9.0.0-alpha.1", | ||
"license": "MIT", | ||
"type": "module", | ||
"description": "Helpers functions for Inferno", | ||
@@ -19,5 +20,10 @@ "author": { | ||
], | ||
"main": "index.js", | ||
"module": "dist/index.esm.js", | ||
"dev:module": "dist/index.dev.esm.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./index.cjs" | ||
} | ||
}, | ||
"module": "dist/index.mjs", | ||
"dev:module": "dist/index.dev.mjs", | ||
"typings": "dist/index.d.ts", | ||
@@ -36,3 +42,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "6a482641d2405c46a1c9374d889312d98ca9a4a5" | ||
"gitHead": "902106d6b6abf20cd7fd6353bb9bd30dd5a7af4a" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
13816
0
Yes
9
327
1
1