@teleporthq/teleport-plugin-common
Advanced tools
Comparing version
@@ -29,3 +29,3 @@ import * as types from '@babel/types'; | ||
export declare const createClassComponent: (name: string, propDefinitions: Record<string, UIDLPropDefinition>, stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.ClassDeclaration; | ||
export declare const createPureComponent: (name: string, stateDefinitions: Record<string, UIDLStateDefinition>, propDefinitions: Record<string, UIDLPropDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.VariableDeclaration; | ||
export declare const createPureComponent: (name: string, stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.VariableDeclaration; | ||
export declare const createReturnExpressionSyntax: (stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.BlockStatement; | ||
@@ -32,0 +32,0 @@ /** |
@@ -316,10 +316,6 @@ "use strict"; | ||
exports.createClassComponent = createClassComponent; | ||
var createPureComponent = function (name, stateDefinitions, propDefinitions, jsxTagTree, t) { | ||
var createPureComponent = function (name, stateDefinitions, jsxTagTree, t) { | ||
if (t === void 0) { t = types; } | ||
var arrowFunctionBody = exports.createReturnExpressionSyntax(stateDefinitions, jsxTagTree); | ||
var arrowFunctionProps = []; | ||
if (Object.keys(propDefinitions).length > 0) { | ||
arrowFunctionProps.push(t.identifier('props')); | ||
} | ||
var arrowFunction = t.arrowFunctionExpression(arrowFunctionProps, arrowFunctionBody); | ||
var arrowFunction = t.arrowFunctionExpression([t.identifier('props')], arrowFunctionBody); | ||
var declarator = t.variableDeclarator(t.identifier(name), arrowFunction); | ||
@@ -326,0 +322,0 @@ var component = t.variableDeclaration('const', [declarator]); |
@@ -29,3 +29,3 @@ import * as types from '@babel/types'; | ||
export declare const createClassComponent: (name: string, propDefinitions: Record<string, UIDLPropDefinition>, stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.ClassDeclaration; | ||
export declare const createPureComponent: (name: string, stateDefinitions: Record<string, UIDLStateDefinition>, propDefinitions: Record<string, UIDLPropDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.VariableDeclaration; | ||
export declare const createPureComponent: (name: string, stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.VariableDeclaration; | ||
export declare const createReturnExpressionSyntax: (stateDefinitions: Record<string, UIDLStateDefinition>, jsxTagTree: types.JSXElement, t?: typeof types) => types.BlockStatement; | ||
@@ -32,0 +32,0 @@ /** |
@@ -275,10 +275,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
}; | ||
export var createPureComponent = function (name, stateDefinitions, propDefinitions, jsxTagTree, t) { | ||
export var createPureComponent = function (name, stateDefinitions, jsxTagTree, t) { | ||
if (t === void 0) { t = types; } | ||
var arrowFunctionBody = createReturnExpressionSyntax(stateDefinitions, jsxTagTree); | ||
var arrowFunctionProps = []; | ||
if (Object.keys(propDefinitions).length > 0) { | ||
arrowFunctionProps.push(t.identifier('props')); | ||
} | ||
var arrowFunction = t.arrowFunctionExpression(arrowFunctionProps, arrowFunctionBody); | ||
var arrowFunction = t.arrowFunctionExpression([t.identifier('props')], arrowFunctionBody); | ||
var declarator = t.variableDeclarator(t.identifier(name), arrowFunction); | ||
@@ -285,0 +281,0 @@ var component = t.variableDeclaration('const', [declarator]); |
{ | ||
"name": "@teleporthq/teleport-plugin-common", | ||
"version": "0.19.17", | ||
"version": "0.19.18", | ||
"description": "Common building and modelating functions for ASTs and HASTs", | ||
@@ -33,3 +33,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "4af7375f20235273eeabb48ef109cab2a02ddceb" | ||
"gitHead": "f286e365fd8a9936f89952ee6f84e33b192c3dc7" | ||
} |
@@ -396,3 +396,2 @@ import * as types from '@babel/types' | ||
stateDefinitions: Record<string, UIDLStateDefinition>, | ||
propDefinitions: Record<string, UIDLPropDefinition>, | ||
jsxTagTree: types.JSXElement, | ||
@@ -402,10 +401,4 @@ t = types | ||
const arrowFunctionBody = createReturnExpressionSyntax(stateDefinitions, jsxTagTree) | ||
const arrowFunctionProps = [] | ||
const arrowFunction = t.arrowFunctionExpression([t.identifier('props')], arrowFunctionBody) | ||
if (Object.keys(propDefinitions).length > 0) { | ||
arrowFunctionProps.push(t.identifier('props')) | ||
} | ||
const arrowFunction = t.arrowFunctionExpression(arrowFunctionProps, arrowFunctionBody) | ||
const declarator = t.variableDeclarator(t.identifier(name), arrowFunction) | ||
@@ -412,0 +405,0 @@ const component = t.variableDeclaration('const', [declarator]) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
410107
-0.22%5875
-0.22%