New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stencil/react-output-target

Package Overview
Dependencies
Maintainers
11
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stencil/react-output-target - npm Package Compare versions

Comparing version 0.1.0-2 to 0.1.0

11

dist/index.cjs.js

@@ -160,9 +160,14 @@ 'use strict';

* to use in their applications.
* @param cmpMeta: Meta data for a single Web Component
* @param includeCustomElement: If `true`, the Web Component instance
* will be passed in to createReactComponent to be registered
* with the Custom Elements Registry.
* @returns An array where each entry is a string version
* of the React component definition.
*/
function createComponentDefinition(cmpMeta, includeCustomElement = false) {
const tagNameAsPascal = dashToPascalCase(cmpMeta.tagName);
const importAs = (includeCustomElement) ? tagNameAsPascal + 'Cmp' : undefined;
let template = `export const ${tagNameAsPascal} = /*@__PURE__*/createReactComponent<${IMPORT_TYPES}.${tagNameAsPascal}, HTML${tagNameAsPascal}Element>('${cmpMeta.tagName}'`;
if (importAs) {
template += `, ${importAs}`;
if (includeCustomElement) {
template += `, undefined, undefined, ${tagNameAsPascal}Cmp`;
}

@@ -169,0 +174,0 @@ template += `);`;

@@ -151,9 +151,14 @@ import path from 'path';

* to use in their applications.
* @param cmpMeta: Meta data for a single Web Component
* @param includeCustomElement: If `true`, the Web Component instance
* will be passed in to createReactComponent to be registered
* with the Custom Elements Registry.
* @returns An array where each entry is a string version
* of the React component definition.
*/
function createComponentDefinition(cmpMeta, includeCustomElement = false) {
const tagNameAsPascal = dashToPascalCase(cmpMeta.tagName);
const importAs = (includeCustomElement) ? tagNameAsPascal + 'Cmp' : undefined;
let template = `export const ${tagNameAsPascal} = /*@__PURE__*/createReactComponent<${IMPORT_TYPES}.${tagNameAsPascal}, HTML${tagNameAsPascal}Element>('${cmpMeta.tagName}'`;
if (importAs) {
template += `, ${importAs}`;
if (includeCustomElement) {
template += `, undefined, undefined, ${tagNameAsPascal}Cmp`;
}

@@ -160,0 +165,0 @@ template += `);`;

@@ -8,2 +8,8 @@ import type { OutputTargetReact, PackageJSON } from './types';

* to use in their applications.
* @param cmpMeta: Meta data for a single Web Component
* @param includeCustomElement: If `true`, the Web Component instance
* will be passed in to createReactComponent to be registered
* with the Custom Elements Registry.
* @returns An array where each entry is a string version
* of the React component definition.
*/

@@ -10,0 +16,0 @@ export declare function createComponentDefinition(cmpMeta: ComponentCompilerMeta, includeCustomElement?: boolean): string[];

@@ -73,9 +73,14 @@ import path from 'path';

* to use in their applications.
* @param cmpMeta: Meta data for a single Web Component
* @param includeCustomElement: If `true`, the Web Component instance
* will be passed in to createReactComponent to be registered
* with the Custom Elements Registry.
* @returns An array where each entry is a string version
* of the React component definition.
*/
export function createComponentDefinition(cmpMeta, includeCustomElement = false) {
const tagNameAsPascal = dashToPascalCase(cmpMeta.tagName);
const importAs = (includeCustomElement) ? tagNameAsPascal + 'Cmp' : undefined;
let template = `export const ${tagNameAsPascal} = /*@__PURE__*/createReactComponent<${IMPORT_TYPES}.${tagNameAsPascal}, HTML${tagNameAsPascal}Element>('${cmpMeta.tagName}'`;
if (importAs) {
template += `, ${importAs}`;
if (includeCustomElement) {
template += `, undefined, undefined, ${tagNameAsPascal}Cmp`;
}

@@ -82,0 +87,0 @@ template += `);`;

{
"name": "@stencil/react-output-target",
"version": "0.1.0-2",
"version": "0.1.0",
"description": "React output target for @stencil/core components.",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc