You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

preact-jsx-runtime

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preact-jsx-runtime - npm Package Compare versions

Comparing version

to
1.1.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.1.0 (2020-08-16)
### Performance
- Optimize to avoid iterating properties in simple props pass-through case.
## 1.0.1 (2020-08-09)

@@ -2,0 +8,0 @@

34

jsx-runtime.js
var preact = require('preact');
/** @typedef {import('preact').ComponentType} ComponentType */
/** @typedef {import('preact/src/jsx').JSXInternal.HTMLAttributes} HTMLAttributes */
/** @typedef {import('preact/src/jsx').JSXInternal.SVGAttributes} SVGAttributes */
/** @typedef {HTMLAttributes & SVGAttributes & Record<string, any>} Props
/**
* @param {import('preact').ComponentType} type Component type.
* @param {import('preact').Attributes} config Component props.
* @param {string=} maybeKey Key, or undefined.
* @param {ComponentType} type Component type.
* @param {Props} config Component props.
* @param {string=} maybeKey Key, or undefined.
*/
function jsx(type, config, maybeKey) {
var props = {},
propName;
/** @type {Props} */
var props;
if (maybeKey !== undefined) {
props.key = '' + maybeKey;
}
/** @type {string} */
var propName;
for (propName in config) {
if (Object.prototype.hasOwnProperty.call(config, propName)) {
props[propName] = config[propName];
if (maybeKey === undefined) {
props = config;
} else {
props = {
key: '' + maybeKey,
};
for (propName in config) {
if (Object.prototype.hasOwnProperty.call(config, propName)) {
props[propName] = config[propName];
}
}

@@ -20,0 +32,0 @@ }

{
"name": "preact-jsx-runtime",
"version": "1.0.1",
"version": "1.1.0",
"description": "Preact JSX runtime definition for use with automatic JSX import",

@@ -5,0 +5,0 @@ "main": "jsx-runtime.js",