@teleporthq/teleport-plugin-import-statements-html
Advanced tools
Comparing version
@@ -107,2 +107,5 @@ "use strict"; | ||
titleTag = teleport_plugin_common_1.HASTBuilders.createHTMLNode('title'); | ||
if (typeof title !== 'string') { | ||
throw new Error('Unsupporder HTML title type. Only string is supported.'); | ||
} | ||
teleport_plugin_common_1.HASTUtils.addTextNode(titleTag, teleport_shared_1.StringUtils.encode(title)); | ||
@@ -115,3 +118,7 @@ tags.push(titleTag); | ||
Object.keys(meta).forEach(function (key) { | ||
teleport_plugin_common_1.HASTUtils.addAttributeToNode(metaTag, key, meta[key]); | ||
var value = meta[key]; | ||
if (typeof value !== 'string') { | ||
throw new Error('Unsupporder HTML meta type. Only string is supported.'); | ||
} | ||
teleport_plugin_common_1.HASTUtils.addAttributeToNode(metaTag, key, value); | ||
}); | ||
@@ -118,0 +125,0 @@ tags.push(metaTag); |
@@ -104,2 +104,5 @@ var __assign = (this && this.__assign) || function () { | ||
titleTag = HASTBuilders.createHTMLNode('title'); | ||
if (typeof title !== 'string') { | ||
throw new Error('Unsupporder HTML title type. Only string is supported.'); | ||
} | ||
HASTUtils.addTextNode(titleTag, StringUtils.encode(title)); | ||
@@ -112,3 +115,7 @@ tags.push(titleTag); | ||
Object.keys(meta).forEach(function (key) { | ||
HASTUtils.addAttributeToNode(metaTag, key, meta[key]); | ||
var value = meta[key]; | ||
if (typeof value !== 'string') { | ||
throw new Error('Unsupporder HTML meta type. Only string is supported.'); | ||
} | ||
HASTUtils.addAttributeToNode(metaTag, key, value); | ||
}); | ||
@@ -115,0 +122,0 @@ tags.push(metaTag); |
{ | ||
"name": "@teleporthq/teleport-plugin-import-statements-html", | ||
"version": "0.27.3", | ||
"version": "0.27.4-alpha.0", | ||
"description": "A plugin for handling import statements in HTML", | ||
@@ -27,7 +27,7 @@ "author": "teleportHQ", | ||
"dependencies": { | ||
"@teleporthq/teleport-plugin-common": "^0.27.3", | ||
"@teleporthq/teleport-shared": "^0.27.3", | ||
"@teleporthq/teleport-types": "^0.27.3" | ||
"@teleporthq/teleport-plugin-common": "^0.27.4-alpha.0", | ||
"@teleporthq/teleport-shared": "^0.27.4-alpha.0", | ||
"@teleporthq/teleport-types": "^0.27.4-alpha.0" | ||
}, | ||
"gitHead": "14f69b861cb0838d502a5ba226bb7cb5c1291fbb" | ||
"gitHead": "182513645c9074b0739b30e28a0a45d04805e72d" | ||
} |
@@ -62,2 +62,6 @@ import { | ||
const titleTag = HASTBuilders.createHTMLNode('title') | ||
if (typeof title !== 'string') { | ||
throw new Error('Unsupporder HTML title type. Only string is supported.') | ||
} | ||
HASTUtils.addTextNode(titleTag, StringUtils.encode(title)) | ||
@@ -71,3 +75,8 @@ tags.push(titleTag) | ||
Object.keys(meta).forEach((key) => { | ||
HASTUtils.addAttributeToNode(metaTag, key, meta[key]) | ||
const value = meta[key] | ||
if (typeof value !== 'string') { | ||
throw new Error('Unsupporder HTML meta type. Only string is supported.') | ||
} | ||
HASTUtils.addAttributeToNode(metaTag, key, value) | ||
}) | ||
@@ -74,0 +83,0 @@ tags.push(metaTag) |
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
74957
2.64%451
4.88%