@teleporthq/teleport-uidl-validator
Advanced tools
Comparing version 0.31.0 to 0.31.3
@@ -78,3 +78,3 @@ "use strict"; | ||
var parseComponentNode = function (node) { | ||
var _a, _b; | ||
var _a; | ||
switch (node.type) { | ||
@@ -114,6 +114,5 @@ case 'element': | ||
} | ||
// @ts-ignore | ||
if ((_a = elementContent.abilities) === null || _a === void 0 ? void 0 : _a.link) { | ||
// @ts-ignore | ||
var _c = (_b = elementContent.abilities) === null || _b === void 0 ? void 0 : _b.link, content = _c.content, type = _c.type; | ||
if ((elementContent === null || elementContent === void 0 ? void 0 : elementContent.abilities) && | ||
'link' in elementContent.abilities) { | ||
var _b = (_a = elementContent.abilities) === null || _a === void 0 ? void 0 : _a.link, content = _b.content, type = _b.type; | ||
if (type === 'url' && typeof content.url === 'string') { | ||
@@ -120,0 +119,0 @@ content.url = teleport_shared_1.UIDLUtils.transformStringAssignmentToJson(content.url); |
@@ -73,3 +73,3 @@ var __assign = (this && this.__assign) || function () { | ||
var parseComponentNode = function (node) { | ||
var _a, _b; | ||
var _a; | ||
switch (node.type) { | ||
@@ -109,6 +109,5 @@ case 'element': | ||
} | ||
// @ts-ignore | ||
if ((_a = elementContent.abilities) === null || _a === void 0 ? void 0 : _a.link) { | ||
// @ts-ignore | ||
var _c = (_b = elementContent.abilities) === null || _b === void 0 ? void 0 : _b.link, content = _c.content, type = _c.type; | ||
if ((elementContent === null || elementContent === void 0 ? void 0 : elementContent.abilities) && | ||
'link' in elementContent.abilities) { | ||
var _b = (_a = elementContent.abilities) === null || _a === void 0 ? void 0 : _a.link, content = _b.content, type = _b.type; | ||
if (type === 'url' && typeof content.url === 'string') { | ||
@@ -115,0 +114,0 @@ content.url = UIDLUtils.transformStringAssignmentToJson(content.url); |
{ | ||
"name": "@teleporthq/teleport-uidl-validator", | ||
"version": "0.31.0", | ||
"version": "0.31.3", | ||
"description": "A module that offers validation and parsing for non-standard UIDL structures", | ||
@@ -28,6 +28,6 @@ "author": "teleportHQ", | ||
"@mojotech/json-type-validation": "^3.1.0", | ||
"@teleporthq/teleport-shared": "^0.31.0", | ||
"@teleporthq/teleport-shared": "^0.31.3", | ||
"@teleporthq/teleport-types": "^0.31.0" | ||
}, | ||
"gitHead": "37c3970566832845c57f0ef11088a9214af720b2" | ||
"gitHead": "290dbc03d87888316b91dae1eb937dbf10bd1ca5" | ||
} |
@@ -20,2 +20,3 @@ import { UIDLUtils } from '@teleporthq/teleport-shared' | ||
UIDLRootComponent, | ||
VUIDLElement, | ||
} from '@teleporthq/teleport-types' | ||
@@ -171,6 +172,7 @@ | ||
// @ts-ignore | ||
if (elementContent.abilities?.link) { | ||
// @ts-ignore | ||
const { content, type } = elementContent.abilities?.link | ||
if ( | ||
elementContent?.abilities && | ||
'link' in (elementContent.abilities as unknown as VUIDLElement['abilities']) | ||
) { | ||
const { content, type } = (elementContent.abilities as VUIDLElement['abilities'])?.link | ||
if (type === 'url' && typeof content.url === 'string') { | ||
@@ -177,0 +179,0 @@ content.url = UIDLUtils.transformStringAssignmentToJson(content.url) |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
439552