@teleporthq/teleport-plugin-import-statements-html
Advanced tools
Comparing version
@@ -28,3 +28,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -108,2 +108,5 @@ if (y = 0, t) op = [op[0] & 2, t.value]; | ||
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)); | ||
@@ -116,3 +119,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); | ||
}); | ||
@@ -119,0 +126,0 @@ tags.push(metaTag); |
@@ -27,3 +27,3 @@ var __assign = (this && this.__assign) || function () { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -105,2 +105,5 @@ if (y = 0, t) op = [op[0] & 2, t.value]; | ||
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)); | ||
@@ -113,3 +116,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); | ||
}); | ||
@@ -116,0 +123,0 @@ tags.push(metaTag); |
{ | ||
"name": "@teleporthq/teleport-plugin-import-statements-html", | ||
"version": "0.27.8", | ||
"version": "0.28.0-alpha.0", | ||
"description": "A plugin for handling import statements in HTML", | ||
@@ -27,7 +27,7 @@ "author": "teleportHQ", | ||
"dependencies": { | ||
"@teleporthq/teleport-plugin-common": "^0.27.8", | ||
"@teleporthq/teleport-shared": "^0.27.8", | ||
"@teleporthq/teleport-types": "^0.27.8" | ||
"@teleporthq/teleport-plugin-common": "^0.28.0-alpha.0", | ||
"@teleporthq/teleport-shared": "^0.28.0-alpha.0", | ||
"@teleporthq/teleport-types": "^0.28.0-alpha.0" | ||
}, | ||
"gitHead": "3ae7c0728720e2b5b1663c57e08283ede422c227" | ||
"gitHead": "250d0e95a830f2b404486d3ad4f7a3739a74c77f" | ||
} |
@@ -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
451
4.88%74921
-0.74%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed